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
9 class Aggregate(SfaServer):
12 # Create a new aggregate object.
14 # @param ip the ip address to listen on
15 # @param port the port to listen on
16 # @param key_file private key filename of registry
17 # @param cert_file certificate filename containing public key (could be a GID file)
18 def __init__(self, ip, port, key_file, cert_file):
19 SfaServer.__init__(self, ip, port, key_file, cert_file, 'aggregate')
22 # Aggregates is a dictionary of aggregate connections keyed on the aggregate hrn
23 # as such it's more of a client-side thing for aggregate servers to reach their peers
27 class Aggregates(Interfaces):
29 default_dict = {'aggregates': {'aggregate': [Interfaces.default_fields]}}
31 def __init__(self, conf_file="/etc/sfa/aggregates.xml"):
32 Interfaces.__init__(self, conf_file)
34 # set up a connection to the local aggregate
35 if sfa_config.SFA_AGGREGATE_ENABLED:
36 addr = sfa_config.SFA_AGGREGATE_HOST
37 port = sfa_config.SFA_AGGREGATE_PORT
38 hrn = sfa_config.SFA_INTERFACE_HRN
39 interface = Interface(hrn, addr, port)