Exemplo n.º 1
0
 def metricsStartSession(self, correlationID, payload):
     if not self.session:
         (sessionID,) = framing.decodePayload(payload)
         log.msg("Starting session %s" % sessionID)
         self.session = self.factory.sessionStore.createNewSession(sessionID)
         return (True, constants.RESULT_NONE, '')
     else:
         return (False, constants.ERROR_ALREADY_IN_SESSION, '')
Exemplo n.º 2
0
 def metricsListSessions(self, correlationID, payload):
     (flags,) = framing.decodePayload(payload)
     sessions = self.factory.sessionStore.getSessions(**flags)
     log.msg("Sending sessions... %s" % sessions)
     self._sendSuccess(correlationID, constants.RESULT_DATA_FOLLOWS, '')
     self.sendCommand(correlationID, constants.METHOD_RECEIVE_SESSION_LIST_COUNT, framing.encodePayload(len(sessions)))
     for session in sessions:
         self.sendCommand(correlationID, constants.METHOD_RECEIVE_SESSION_LIST_ITEM, framing.encodePayload(session.sessionID))
     return None
Exemplo n.º 3
0
 def metricsSetProtocolVersion(self, correlationID, payload):
     (self.protocolVersion,) = framing.decodePayload(payload)
     return (True, constants.RESULT_NONE, '')
Exemplo n.º 4
0
 def metricsReceiveSessionListItem(self, correlationID, payload):
     log.msg("Received session list item: %s" % framing.decodePayload(payload)[0])
Exemplo n.º 5
0
 def metricsReceiveSessionListCount(self, correlationID, payload):
     log.msg("Expecting %s sessions" % framing.decodePayload(payload)[0])