def connectionInitialized(self): super(CollabNode, self).connectionInitialized() log.msg('connection done') # make it able to handle ad-hoc commands self.xmlstream.addObserver(collab.COMMAND_SET, self.handleCommand) # communications sub menus - want connections to all be init so doing this here self.lastHandler = wizards.makeSubSystemCommands( self.menu, self.jid, self.commandHandler, 'Input/Output/Errors', 'comm_inputs', dict({ 'View': wizards.ViewCollabNodeWizardFactory(self.jid, self.inputNode, self.outputNode, self.errorNode), })) self.lastHandler = wizards.makeSubSystemCommands( self.menu, self.jid, self.lastHandler, 'Load Balancer', 'load_balancer', dict({ 'Configure': wizards.ConfigureCollabLoadBalancingWizardFactory(self.jid, self.loopingLoadBalancer) })) #set load balancer looping call every x second if not self.loopingLoadBalancer.running: d = self.loopingLoadBalancer.start(collab.DEFAULT_LOAD_BALANCER_FREQ) d.addErrback(self._errback) return d return defer.succeed(None)
def connectionMade(self): # make into ad-hod command handler self.xmlstream.addObserver(collab.COMMAND_SET, self.handleRequest) getPSNodes = wizards.getPSNodes(self.discoClient, self.jid) getAdmins = wizards.getAllUsers(self.discoClient, jid.JID(collab.COLLAB_HOST), self.jid) getHosts = wizards.getHosts(self.xmlrpc) getPublishers = wizards.getPublishers getComponents = wizards.getComponents # communications sub menus - want client to be connected so doing this here h = wizards.makeSubSystemCommands( self.menu, self.jid, self.commandHandler, 'Communication Channels', 'comms_channels', dict({ 'Add': wizards.AddCommsWizardFactory(self.jid, self, getAdmins, getPublishers, getComponents), 'Delete': wizards.DeleteCommsWizardFactory(self.jid, self, getPSNodes), 'Configure channel': wizards.ConfigureCommsWizardFactory(self.jid, self, getPSNodes, getAdmins, getPublishers), })) # machines sub menus h = wizards.makeSubSystemCommands( self.menu, self.jid, h, 'Calculation Nodes', 'calcs_nodes', dict({ 'Add': wizards.AddMachineWizardFactory(self.jid, getHosts, self.xmlrpc), 'Remove': wizards.RemoveMachineWizardFactory(self.jid, getHosts, self.xmlrpc), })) # collab nodes sub menus h = wizards.makeSubSystemCommands( self.menu, self.jid, h, 'Collab Nodes', 'collabs_nodes', dict({ 'Add': wizards.AddCollabWizardFactory(self.jid, getHosts, getComponents), }))
def connectionInitialized(self): super(CollabProxy, self).connectionInitialized() self.lastHandler = wizards.makeSubSystemCommands( self.menu, self.jid, self.lastHandler, 'Analysis', 'mc_analysis', dict({ 'Register client': wizards.ClientRegisterWizardFactory(self.jid, self.api_register), 'Unregister client': wizards.ClientUnregisterWizardFactory(self.jid, self.api_unregister), }))