* @return void
*/
public function handleMessageData (array $messageData, Receivable $packageInstance) {
- die(__METHOD__ . ':messageData=' . print_r($messageData, true));
+ // Are node id and session id the same?
+ if (($messageData[XmlSelfConnectTemplateEngine::SELF_CONNECT_DATA_NODE_ID] == $this->getNodeId()) && ($messageData[XmlSelfConnectTemplateEngine::SELF_CONNECT_DATA_SESSION_ID] == $this->getSessionId())) {
+ // Both are equal
+ $this->debugOutput('SELF-CONNECT: Have connected to myself, node and session id are equal!');
+
+ // Get node instance ...
+ $nodeInstance = Registry::getRegistry()->getInstance('node');
+
+ // ... and change state
+ $nodeInstance->getStateInstance()->nodeHasSelfConnected();
+ } else {
+ // Something really horrible happened
+ // @TODO Throw an exception here instead of dying
+ $this->debugInstance(__METHOD__ . ':IDs mismatch! messageData=' . print_r($messageData, true));
+ }
}
/**