1 from sfa.server.sfaserver import SfaServer
2 from sfa.util.xrn import hrn_to_urn
3 from sfa.server.interface import Interfaces, Interface
4 from sfa.util.config import Config
6 # this truly is a server-side object
7 class Aggregate(SfaServer):
10 # Create a new aggregate object.
12 # @param ip the ip address to listen on
13 # @param port the port to listen on
14 # @param key_file private key filename of registry
15 # @param cert_file certificate filename containing public key (could be a GID file)
16 def __init__(self, ip, port, key_file, cert_file):
17 SfaServer.__init__(self, ip, port, key_file, cert_file,'aggregate')
20 # Aggregates is a dictionary of aggregate connections keyed on the aggregate hrn
21 # as such it's more of a client-side thing for aggregate servers to reach their peers
23 class Aggregates(Interfaces):
25 default_dict = {'aggregates': {'aggregate': [Interfaces.default_fields]}}
27 def __init__(self, conf_file = "/etc/sfa/aggregates.xml"):
28 Interfaces.__init__(self, conf_file)
30 # set up a connection to the local aggregate
31 if sfa_config.SFA_AGGREGATE_ENABLED:
32 addr = sfa_config.SFA_AGGREGATE_HOST
33 port = sfa_config.SFA_AGGREGATE_PORT
34 hrn = sfa_config.SFA_INTERFACE_HRN
35 interface = Interface(hrn, addr, port)