]> git.mxchange.org Git - hub.git/commitdiff
The old state check was still required here, so re-add it
authorRoland Häder <roland@mxchange.org>
Mon, 12 Nov 2012 17:11:14 +0000 (17:11 +0000)
committerRoland Häder <roland@mxchange.org>
Mon, 12 Nov 2012 17:11:14 +0000 (17:11 +0000)
application/hub/interfaces/helper/nodes/class_NodeHelper.php
application/hub/main/handler/message-types/answer/class_NodeMessageAnnouncementAnswerHandler.php
application/hub/main/nodes/class_BaseHubNode.php

index b19e59b12066a017dcf635676070ebe956b4cfec..a7379ca7e015cd6e0f78b8daec7a38a973c5bcd4 100644 (file)
@@ -153,10 +153,17 @@ interface NodeHelper extends Helper {
         */
        function isAcceptingAnnouncements ();
 
+       /**
+        * Checks whether this node has attempted to announce itself
+        *
+        * @return      $hasAnnounced   Whether this node has attempted to announce itself
+        */
+       function ifNodeHasAnnounced ();
+
        /**
         * Checks whether this node has attempted to announce itself and completed it
         *
-        * @return      $hasAnnounced   Whether this node has attempted to announce itself and completed it
+        * @return      $hasAnnouncementCompleted       Whether this node has attempted to announce itself and completed it
         */
        function ifNodeHasAnnouncementCompleted ();
 
index 691f1da66ee32f073065991e4a63ffe60a8fd892..266d8c3c535799740c7dbc8ce73bb085599dba5b 100644 (file)
@@ -97,7 +97,7 @@ class NodeMessageAnnouncementAnswerHandler extends BaseMessageHandler implements
                $nodeInstance = Registry::getRegistry()->getInstance('node');
 
                // Has this node attempted to announce itself?
-               if (!$nodeInstance->ifNodeHasAnnouncementCompleted()) {
+               if (!$nodeInstance->ifNodeHasAnnounced()) {
                        /*
                         * This node has never announced itself, so it doesn't expect
                         * announcement answer messages.
index 9bea518358e7e77e2167153b4abbe12b02c3707b..8f01488139862ea64d853e4b607d240e4cbec29e 100644 (file)
@@ -723,17 +723,17 @@ class BaseHubNode extends BaseHubSystem implements Updateable {
        }
 
        /**
-        * Checks whether this node has attempted to announce itself and completed it
+        * Checks whether this node has attempted to announce itself
         *
-        * @return      $hasAnnounced   Whether this node has attempted to announce itself and completed it
+        * @return      $hasAnnounced   Whether this node has attempted to announce itself
         * @todo        Add checking if this node has been announced to the sender node
         */
-       public function ifNodeHasAnnouncementCompleted () {
+       public function ifNodeHasAnnounced () {
                // Debug message
                /* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NODE: ifNodeHasAnnouncementCompleted(): state=' . $this->getStateInstance()->getStateName());
 
                // Simply check the state of this node
-               $hasAnnounced = ($this->getStateInstance() instanceof NodeAnnouncementCompletedState);
+               $hasAnnounced = ($this->getStateInstance() instanceof NodeAnnouncedState);
 
                // Debug message
                /* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NODE: ifNodeHasAnnouncementCompleted(): hasAnnounced=' . intval($hasAnnounced));
@@ -742,6 +742,26 @@ class BaseHubNode extends BaseHubSystem implements Updateable {
                return $hasAnnounced;
        }
 
+       /**
+        * Checks whether this node has attempted to announce itself and completed it
+        *
+        * @return      $hasAnnouncementCompleted       Whether this node has attempted to announce itself and completed it
+        * @todo        Add checking if this node has been announced to the sender node
+        */
+       public function ifNodeHasAnnouncementCompleted () {
+               // Debug message
+               /* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NODE: ifNodeHasAnnouncementCompleted(): state=' . $this->getStateInstance()->getStateName());
+
+               // Simply check the state of this node
+               $hasAnnouncementCompleted = ($this->getStateInstance() instanceof NodeAnnouncementCompletedState);
+
+               // Debug message
+               /* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NODE: ifNodeHasAnnouncementCompleted(): hasAnnouncementCompleted=' . intval($hasAnnouncementCompleted));
+
+               // Return it
+               return $hasAnnouncementCompleted;
+       }
+
        /**
         * Enables whether this node accepts announcements
         *