]> git.mxchange.org Git - hub.git/commitdiff
Some stuff needs to be renamed to match better naming: 'announced' is not true
authorRoland Haeder <roland@mxchange.org>
Fri, 14 Mar 2014 20:09:22 +0000 (21:09 +0100)
committerRoland Haeder <roland@mxchange.org>
Fri, 14 Mar 2014 20:09:22 +0000 (21:09 +0100)
at this state as the node is currently trying to announce itself. So
'announcing' fits the exact state.

Signed-off-by: Roland Haeder <roland@mxchange.org>
application/hub/interfaces/helper/nodes/class_NodeHelper.php
application/hub/main/handler/message-types/answer/class_NodeMessageAnnouncementAnswerHandler.php
application/hub/main/helper/node/connection/class_NodeSelfConnectHelper.php
application/hub/main/nodes/class_BaseHubNode.php
application/hub/main/states/node/class_BaseNodeState.php

index ea990cacb7a4b698c06134b92953e16f6ef0cbfb..4db905e04b1a17e6df0f1c62323494e929b826b6 100644 (file)
@@ -141,7 +141,7 @@ interface NodeHelper extends Helper, AddableCriteria {
         *
         * @return      $hasAnnounced   Whether this node has attempted to announce itself
         */
-       function ifNodeHasAnnounced ();
+       function ifNodeIsAnnouncing ();
 
        /**
         * Checks whether this node has attempted to announce itself and completed it
index 190ed0b92dd0f3d432f3d8a46f1ffb879c7a19b9..e29b8b3fa0c2ece2996837c52a5017f605bb11cb 100644 (file)
@@ -96,7 +96,7 @@ class NodeMessageAnnouncementAnswerHandler extends BaseMessageHandler implements
                $nodeInstance = Registry::getRegistry()->getInstance('node');
 
                // Has this node attempted to announce itself?
-               if (!$nodeInstance->ifNodeHasAnnounced()) {
+               if (!$nodeInstance->ifNodeIsAnnouncing()) {
                        /*
                         * This node has never announced itself, so it doesn't expect
                         * announcement answer messages.
index e387152fd621c94320c79fabb6965fe16225f98f..97c7c551a62225507219ee82d52842dbc23f0f0d 100644 (file)
@@ -83,7 +83,7 @@ class NodeSelfConnectHelper extends BaseNodeHelper implements HelpableNode {
         */
        public function sendPackage (NodeHelper $nodeInstance) {
                // Sanity check: Is the node in the approx. state? (active)
-               $nodeInstance->getStateInstance()->validateNodeStateIsActiveOrAnnounced();
+               $nodeInstance->getStateInstance()->validateNodeStateIsActiveOrAnnouncing();
 
                // Compile the template, this inserts the loaded node data into the gaps.
                $this->getTemplateInstance()->compileTemplate();
index b32c3dc905b5b043415aafbb6f7cc20068acdbbe..175862d5d10c67357bf6a56275687e5e079d7c40 100644 (file)
@@ -662,15 +662,15 @@ class BaseHubNode extends BaseHubSystem implements Updateable, AddableCriteria {
         * @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 ifNodeHasAnnounced () {
+       public function ifNodeIsAnnouncing () {
                // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NODE[' . __METHOD__ . ':' . __LINE__ . ']: ifNodeHasAnnounced(): state=' . $this->getStateInstance()->getStateName());
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NODE[' . __METHOD__ . ':' . __LINE__ . ']: ifNodeIsAnnouncing(): state=' . $this->getStateInstance()->getStateName());
 
                // Simply check the state of this node
-               $hasAnnounced = ($this->getStateInstance() instanceof NodeAnnouncedState);
+               $hasAnnounced = ($this->getStateInstance() instanceof NodeAnnouncingState);
 
                // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NODE[' . __METHOD__ . ':' . __LINE__ . ']: ifNodeHasAnnounced(): hasAnnounced=' . intval($hasAnnounced));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NODE[' . __METHOD__ . ':' . __LINE__ . ']: ifNodeIsAnnouncing(): hasAnnounced=' . intval($hasAnnounced));
 
                // Return it
                return $hasAnnounced;
index 3f3974dd6397ed2d861ec3ef6e806e8d317019d9..90e8fbd3a7a749f7af19ecd63b0549b657791989 100644 (file)
@@ -55,9 +55,9 @@ class BaseNodeState extends BaseState {
         * @return      void
         * @throws      InvalidStateException   If the state is not 'active' and not 'announcing'
         */
-       public function validateNodeStateIsActiveOrAnnounced () {
+       public function validateNodeStateIsActiveOrAnnouncing () {
                // Just compare it...
-               if ((!$this instanceof NodeActiveState) && (!$this instanceof NodeAnnouncedState)) {
+               if ((!$this instanceof NodeActiveState) && (!$this instanceof NodeAnnouncingState)) {
                        // Throw the exception
                        throw new InvalidStateException($this, self::EXCEPTION_INVALID_STATE);
                } // END - if