From 5800ec58d99f23058e21881df55792149caefa12 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Thu, 16 Aug 2012 18:58:04 +0000 Subject: [PATCH] Added missing method nodeAnnouncedToUpperHubs to state NodeReachableState, fixed wrong array elements --- .../class_NoAnnouncementAttemptedException.php | 12 ++++++------ .../states/node/seniors/class_NodeReachableState.php | 10 ++++++++++ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/application/hub/exceptions/announcement/class_NoAnnouncementAttemptedException.php b/application/hub/exceptions/announcement/class_NoAnnouncementAttemptedException.php index fa8fdf59b..6363de18f 100644 --- a/application/hub/exceptions/announcement/class_NoAnnouncementAttemptedException.php +++ b/application/hub/exceptions/announcement/class_NoAnnouncementAttemptedException.php @@ -36,12 +36,12 @@ class NoAnnouncementAttemptedException extends FrameworkException { $messageArray[0]->__toString(), $this->getLine(), $messageArray[1]->__toString(), - $messageArray[2][XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_SESSION_ID], - $messageArray[2][XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_EXTERNAL_IP], - $messageArray[2][XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_INTERNAL_IP], - $messageArray[2][XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_TCP_PORT], - $messageArray[2][XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_UDP_PORT], - $messageArray[2][XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_NODE_STATUS] + $messageArray[2][XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_SESSION_ID], + $messageArray[2][XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_EXTERNAL_IP], + $messageArray[2][XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_INTERNAL_IP], + $messageArray[2][XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_TCP_PORT], + $messageArray[2][XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_UDP_PORT], + $messageArray[2][XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_NODE_STATUS] ); // Call parent exception constructor diff --git a/application/hub/main/states/node/seniors/class_NodeReachableState.php b/application/hub/main/states/node/seniors/class_NodeReachableState.php index f4b8965c7..a0cdba1f8 100644 --- a/application/hub/main/states/node/seniors/class_NodeReachableState.php +++ b/application/hub/main/states/node/seniors/class_NodeReachableState.php @@ -54,6 +54,16 @@ class NodeReachableState extends BaseNodeState implements Stateable { // Return the prepared instance return $stateInstance; } + + /** + * State change for if the node got announced to it's upper hubs + * + * @return void + */ + public function nodeAnnouncedToUpperHubs () { + // Create the new state instance + NodeStateFactory::createNodeStateInstanceByName('announced', $this->getNodeInstance()); + } } // [EOF] -- 2.39.5