def __init__(self, baseChannel, serverId=None, dcFileNames=None, dcSuffix='AI', connectMethod=None, threadedNet=None): if connectMethod is None: connectMethod = self.CM_HTTP ConnectionRepository.__init__(self, connectMethod, config, hasOwnerView=False, threadedNet=threadedNet) self.setClientDatagram(False) self.dcSuffix = dcSuffix if hasattr(self, 'setVerbose'): if self.config.GetBool('verbose-internalrepository'): self.setVerbose(1) # The State Server we are configured to use for creating objects. #If this is None, generating objects is not possible. self.serverId = self.config.GetInt('air-stateserver', 0) or None if serverId is not None: self.serverId = serverId maxChannels = self.config.GetInt('air-channel-allocation', 1000000) self.channelAllocator = UniqueIdAllocator( baseChannel, baseChannel + maxChannels - 1) self._registeredChannels = set() self.__contextCounter = 0 self.netMessenger = NetMessenger(self) self.dbInterface = AstronDatabaseInterface(self) self.__callbacks = {} self.ourChannel = self.allocateChannel() self.eventLogId = self.config.GetString('eventlog-id', 'AIR:%d' % self.ourChannel) self.eventSocket = None eventLogHost = self.config.GetString('eventlog-host', '') if eventLogHost: if ':' in eventLogHost: host, port = eventLogHost.split(':', 1) self.setEventLogHost(host, int(port)) else: self.setEventLogHost(eventLogHost) self.readDCFile(dcFileNames)