1 from sfa.util.faults import *
2 from sfa.util.server import SfaServer
3 from sfa.util.xrn import hrn_to_urn
4 from sfa.server.interface import Interfaces, Interface
5 from sfa.util.config import Config
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
22 class Aggregates(Interfaces):
24 default_dict = {'aggregates': {'aggregate': [Interfaces.default_fields]}}
26 def __init__(self, conf_file = "/etc/sfa/aggregates.xml"):
27 Interfaces.__init__(self, conf_file)
29 # set up a connection to the local aggregate
30 if sfa_config.SFA_AGGREGATE_ENABLED:
31 addr = sfa_config.SFA_AGGREGATE_HOST
32 port = sfa_config.SFA_AGGREGATE_PORT
33 hrn = sfa_config.SFA_INTERFACE_HRN
34 interface = Interface(hrn, addr, port)