]> git.mxchange.org Git - hub.git/commitdiff
Better check against if the node has completed announcement
authorRoland Häder <roland@mxchange.org>
Mon, 12 Nov 2012 17:06:00 +0000 (17:06 +0000)
committerRoland Häder <roland@mxchange.org>
Mon, 12 Nov 2012 17:06:00 +0000 (17:06 +0000)
application/hub/interfaces/helper/nodes/class_NodeHelper.php
application/hub/main/handler/message-types/answer/class_NodeMessageAnnouncementAnswerHandler.php
application/hub/main/handler/message-types/answer/class_NodeMessageRequestNodeListAnswerHandler.php
application/hub/main/nodes/class_BaseHubNode.php

index d0c2aba6a65e343c4737e3835163b1ed368762ab..b19e59b12066a017dcf635676070ebe956b4cfec 100644 (file)
@@ -154,11 +154,11 @@ interface NodeHelper extends Helper {
        function isAcceptingAnnouncements ();
 
        /**
-        * Checks whether this node has attempted to announce itself
+        * Checks whether this node has attempted to announce itself and completed it
         *
-        * @return      $hasAnnounced   Whether this node has attempted to announce itself
+        * @return      $hasAnnounced   Whether this node has attempted to announce itself and completed it
         */
-       function ifNodeHasAnnounced ();
+       function ifNodeHasAnnouncementCompleted ();
 
        /**
         * Checks wether this node is accepting node-list requests
index 266d8c3c535799740c7dbc8ce73bb085599dba5b..691f1da66ee32f073065991e4a63ffe60a8fd892 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->ifNodeHasAnnounced()) {
+               if (!$nodeInstance->ifNodeHasAnnouncementCompleted()) {
                        /*
                         * This node has never announced itself, so it doesn't expect
                         * announcement answer messages.
index a5605a5571a5ad7c48e46bc124d061dfaf622041..704c2487f7ed7e837be1bc556acb51d56f3975ac 100644 (file)
@@ -83,7 +83,7 @@ class NodeMessageRequestNodeListAnswerHandler extends BaseMessageHandler impleme
                $nodeInstance = Registry::getRegistry()->getInstance('node');
 
                // Has this node attempted to announce itself?
-               if (!$nodeInstance->ifNodeHasAnnounced()) {
+               if (!$nodeInstance->ifNodeHasAnnouncementCompleted()) {
                        /*
                         * This node has never announced itself, so it doesn't expect
                         * request-node-list answer messages.
index 22d7273b958c566db0a025e45ee83e37390f7901..9bea518358e7e77e2167153b4abbe12b02c3707b 100644 (file)
@@ -723,20 +723,20 @@ class BaseHubNode extends BaseHubSystem implements Updateable {
        }
 
        /**
-        * Checks whether this node has attempted to announce itself
+        * Checks whether this node has attempted to announce itself and completed it
         *
-        * @return      $hasAnnounced   Whether this node has attempted to announce itself
+        * @return      $hasAnnounced   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 ifNodeHasAnnounced () {
+       public function ifNodeHasAnnouncementCompleted () {
                // Debug message
-               /* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NODE: ifNodeHasAnnounced(): state=' . $this->getStateInstance()->getStateName());
+               /* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NODE: ifNodeHasAnnouncementCompleted(): state=' . $this->getStateInstance()->getStateName());
 
                // Simply check the state of this node
-               $hasAnnounced = ($this->getStateInstance() instanceof NodeAnnouncedState);
+               $hasAnnounced = ($this->getStateInstance() instanceof NodeAnnouncementCompletedState);
 
                // Debug message
-               /* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NODE: ifNodeHasAnnounced(): hasAnnounced=' . intval($hasAnnounced));
+               /* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NODE: ifNodeHasAnnouncementCompleted(): hasAnnounced=' . intval($hasAnnounced));
 
                // Return it
                return $hasAnnounced;