store connections to federated registries and aggregates in the api object
authorTony Mack <tmack@cs.princeton.edu>
Mon, 5 Apr 2010 20:46:50 +0000 (20:46 +0000)
committerTony Mack <tmack@cs.princeton.edu>
Mon, 5 Apr 2010 20:46:50 +0000 (20:46 +0000)
sfa/util/api.py

index 48af3ad..ca2557f 100644 (file)
@@ -19,6 +19,8 @@ from sfa.trust.credential import *
 from sfa.trust.certificate import *
 from sfa.util.namespace import *
 from sfa.util.sfalogging import *
+from sfa.server.registry import Registries
+from sfa.server.aggregate import Aggregates
 
 # See "2.2 Characters" in the XML specification:
 #
@@ -115,6 +117,7 @@ class BaseAPI:
         # Load configuration
         self.config = Config(config)
         self.auth = Auth(peer_cert)
+        self.hrn = self.config.SFA_INTERFACE_HRN
         self.interface = interface
         self.key_file = key_file
         self.key = Keypair(filename=self.key_file)
@@ -124,6 +127,12 @@ class BaseAPI:
         self.source = None 
         self.time_format = "%Y-%m-%d %H:%M:%S"
         self.logger=get_sfa_logger()
+        
+        # load registries
+        self.registries = Registries(self) 
+
+        # load aggregates
+        self.aggregates = Aggregates(self)
 
 
     def callable(self, method):