]> git.mxchange.org Git - hub.git/commitdiff
Added handling methods, implemented configuration copy/removal methods
authorRoland Häder <roland@mxchange.org>
Wed, 30 Jan 2013 20:42:18 +0000 (20:42 +0000)
committerRoland Häder <roland@mxchange.org>
Wed, 30 Jan 2013 20:42:18 +0000 (20:42 +0000)
application/hub/main/handler/message-types/requests/class_NodeMessageRequestNodeListHandler.php
application/hub/main/template/answer/requests/class_XmlRequestNodeListAnswerTemplateEngine.php

index d503cad54c9b23c076e0ca96d166625ebda85ead..ff5f030e6dab5e1e0848cdd0454b557eac42189e 100644 (file)
@@ -39,6 +39,11 @@ class NodeMessageRequestNodeListHandler extends BaseMessageHandler implements Ha
                        XmlRequestNodeListTemplateEngine::REQUEST_DATA_ACCEPTED_OBJECT_TYPES,
                );
 
+               // Init config-copy array
+               $this->configCopy = array(
+                       XmlRequestNodeListAnswerTemplateEngine::REQUEST_DATA_SESSION_ID  => 'session_id',
+               );
+
                // Init search data array
                $this->searchData = array(
                        XmlRequestNodeListTemplateEngine::REQUEST_DATA_SESSION_ID,
@@ -111,7 +116,17 @@ class NodeMessageRequestNodeListHandler extends BaseMessageHandler implements Ha
         * @return      void
         */
        protected function initMessageConfigurationData (array $messageData) {
-               $this->partialStub('Please implement this method.');
+               // Debug message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(' REQUEST-HANDLER: messageData=' . print_r($messageData, true));
+
+               // "Walk" throught the config-copy array
+               foreach ($this->configCopy as $targetKey => $sourceKey) {
+                       // Debug message
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('REQUEST-HANDLER: Copying from sourceKey=' . $sourceKey . ' to targetKey=' . $targetKey . '...');
+
+                       // Copy from source to targetKey
+                       $this->getConfigInstance()->setConfigEntry($targetKey, $this->getConfigInstance()->getConfigEntry($sourceKey));
+               } // END - foreach
        }
 
        /**
@@ -122,7 +137,11 @@ class NodeMessageRequestNodeListHandler extends BaseMessageHandler implements Ha
         * @return      void
         */
        protected function removeMessageConfigurationData (array $messageData) {
-               $this->partialStub('Please implement this method.');
+               // "Walk" throught the config-copy array again
+               foreach ($this->configCopy as $configKey => $dummy) {
+                       // Now unset this configuration entry (to save some memory again)
+                       $this->getConfigInstance()->unsetConfigEntry($configKey);
+               } // END - foreach
        }
 }
 
index fd0bf4520929160e414e72271bc8ed248b8bcd9c..3dee4a96030fe594a9185262c3a3af78bb008aa4 100644 (file)
@@ -115,6 +115,46 @@ class XmlRequestNodeListAnswerTemplateEngine extends BaseXmlTemplateEngine imple
                $this->getStackerInstance()->pushNamed('node_request_node_list_answer', 'request-node-list-answer');
        }
 
+       /**
+        * Starts the my-session-id
+        *
+        * @return      void
+        */
+       protected function startMySessionId () {
+               // Push the node name on the stacker
+               $this->getStackerInstance()->pushNamed('node_request_node_list_answer', self::REQUEST_DATA_SESSION_ID);
+       }
+
+       /**
+        * Starts the node-list
+        *
+        * @return      void
+        */
+       protected function startNodeList () {
+               // Push the node name on the stacker
+               $this->getStackerInstance()->pushNamed('node_request_node_list_answer', self::REQUEST_DATA_NODE_LIST);
+       }
+
+       /**
+        * Finishes the node-list
+        *
+        * @return      void
+        */
+       protected function finishNodeList () {
+               // Pop the last entry
+               $this->getStackerInstance()->popNamed('node_request_node_list_answer');
+       }
+
+       /**
+        * Finishes the my-session-id
+        *
+        * @return      void
+        */
+       protected function finishMySessionId () {
+               // Pop the last entry
+               $this->getStackerInstance()->popNamed('node_request_node_list_answer');
+       }
+
        /**
         * Finishes the 'request-node-list-answer'
         *