]> git.mxchange.org Git - hub.git/commitdiff
Introduced updateNodeData() to update/refresh node data ... ;)
authorRoland Häder <roland@mxchange.org>
Wed, 27 Jun 2012 17:17:06 +0000 (17:17 +0000)
committerRoland Häder <roland@mxchange.org>
Wed, 27 Jun 2012 17:17:06 +0000 (17:17 +0000)
application/hub/interfaces/nodes/class_NodeHelper.php
application/hub/main/factories/states/node/class_NodeStateFactory.php
application/hub/main/nodes/class_BaseHubNode.php
application/hub/main/package/class_NetworkPackage.php

index d969b273521c80e5b9503544933a05a5bb365a37..d995d202ba375fd2b5a83c8db6daa3d38cd1f0e2 100644 (file)
@@ -131,6 +131,13 @@ interface NodeHelper extends FrameworkInterface {
         * @return      void
         */
        function addElementsToDataSet (StoreableCriteria $criteriaInstance, Requestable $requestInstance);
+
+       /**
+        * Updates/refreshes node data (e.g. state).
+        *
+        * @return      void
+        */
+       function updateNodeData ();
 }
 
 // [EOF]
index 2fd672477672727154b0d8d7ecb6a43a75e3d53c..5909cad06525e9b9ddbd07152ccd0f1be39faebb 100644 (file)
@@ -53,6 +53,9 @@ class NodeStateFactory extends ObjectFactory {
                // Once we have that state, set it in the node instance
                $nodeInstance->setStateInstance($stateInstance);
 
+               // Update node data
+               $nodeInstance->updateNodeData();
+
                // For any purposes, return the state instance
                return $stateInstance;
        }
index 58cdde153701ad7f9ecb5a54b1d8861214752e67..821ae67dbb201128cf5cfb1732ca7c8185d43cae 100644 (file)
@@ -395,9 +395,6 @@ class BaseHubNode extends BaseHubSystem implements Updateable {
                        throw new HubAlreadyAnnouncedException($this, self::EXCEPTION_HUB_ALREADY_ANNOUNCED);
                } // END - if
 
-               // Set some dummy configuration entries, e.g. node_status
-               $this->getConfigInstance()->setConfigEntry('node_status', $this->getStateInstance()->getStateName());
-
                // Debug output
                $this->debugOutput('HUB-Announcement: START (taskInstance=' . $taskInstance->__toString(). ')');
 
@@ -643,6 +640,17 @@ class BaseHubNode extends BaseHubSystem implements Updateable {
                // Return it
                return $addressPort;
        }
+
+       /**
+        * Updates/refreshes node data (e.g. state).
+        *
+        * @return      void
+        * @todo        Find more to do here
+        */
+       public function updateNodeData () {
+               // Set some dummy configuration entries, e.g. node_status
+               $this->getConfigInstance()->setConfigEntry('node_status', $this->getStateInstance()->getStateName());
+       }
 }
 
 // [EOF]
index b57155abaf1c1b0d03f462a27f9fb3d2dba9c512..361d9c4ea2da9e312addb903482156f03f567133 100644 (file)
@@ -544,7 +544,7 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R
         * @return      $signature      Signature as BASE64-encoded string
         */
        private function generatePackageSignature ($content, $senderId) {
-               // ash content and sender id together, use md5() as last algo
+               // Hash content and sender id together, use md5() as last algo
                $hash = md5($this->getCryptoInstance()->hashString($senderId . $content, $this->getNodeId(), false));
 
                // Encrypt the content again with the hash as a key
@@ -586,6 +586,7 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R
        public function enqueueRawDataFromTemplate (HelpableHub $helperInstance, $protocolName) {
                // Get the raw content ...
                $content = $helperInstance->getTemplateInstance()->getRawTemplateData();
+               //* DEBUG: */ $this->debugOutput('content(' . strlen($content) . ')=' . $content);
 
                // ... and compress it
                $content = $this->getCompressorInstance()->compressStream($content);