]> git.mxchange.org Git - hub.git/commitdiff
Renamed all 'node-foo' to 'my-foo' and 'other-bar' to 'your-bar' to make them more...
authorRoland Häder <roland@mxchange.org>
Sun, 20 May 2012 12:30:20 +0000 (12:30 +0000)
committerRoland Häder <roland@mxchange.org>
Sun, 20 May 2012 12:30:20 +0000 (12:30 +0000)
application/hub/main/filter/tags/answer/class_PackageAnnouncementAnswerTagFilter.php
application/hub/main/handler/message-types/answer/class_NodeMessageAnnouncementAnswerHandler.php
application/hub/main/template/answer/announcement/class_XmlAnnouncementAnswerTemplateEngine.php
application/hub/templates/xml/answer/announcement/announcement_answer.xml

index 43d5df34b0ea88739a5c2bfd35706f1fe5d6a96f..f0d6bf5200d6d0b61335e186dc8e48217d123941 100644 (file)
@@ -90,6 +90,9 @@ class PackageAnnouncementAnswerTagFilter extends BaseFilter implements Filterabl
         * @todo        Exceptions from renderXmlContent() are currently unhandled
         */
        public function processMessage ($messageContent, Receivable $packageInstance) {
+               // Debug message
+               /* NOISY-DEBUG: */ $this->debugOutput('ANNOUNCEMENT-ANSWER-TAG: messageContent(' . strlen($messageContent) . ')=' . $messageContent);
+
                // Get a template instance from the factory
                $templateInstance = XmlTemplateEngineFactory::createXmlTemplateEngineInstance('node_announcement_answer_template_class');
 
index 1ca0e411ec03d24f500c2ef18357a6c2efd6bef3..540f5279be32aed26e8d4259a68bd5cfae8f2b38 100644 (file)
@@ -64,7 +64,7 @@ class NodeMessageAnnouncementAnswerHandler extends BaseMessageHandler implements
         * @return      void
         */
        public function handleMessageData (array $messageData, Receivable $packageInstance) {
-               die('messageData=' . print_r($messageData, true);
+               die('messageData=' . print_r($messageData, true));
                // Register the announcing node with this node
                $this->registerNodeByMessageData($messageData);
        }
index d8fdc010fde7bfa35551651a4bb7cc0e53c752a2..3ec35f13233feffeb335d74659a72352de7114b1 100644 (file)
@@ -35,19 +35,19 @@ class XmlAnnouncementAnswerTemplateEngine extends BaseTemplateEngine implements
         */
        private $subNodes = array(
                // These nodes don't contain any data
-               'node-data',
-               'other-data',
+               'my-data',
+               'your-data',
                // Data from *this* node
-               'node-external-ip',
-               'node-internal-ip',
-               'node-tcp-port',
-               'node-udp-port',
-               'node-session-id',
-               'node-status',
+               'my-external-ip',
+               'my-internal-ip',
+               'my-tcp-port',
+               'my-udp-port',
+               'my-session-id',
+               'my-status',
                // Data from other node
-               'other-external-ip',
-               'other-internal-ip',
-               'other-session-id',
+               'your-external-ip',
+               'your-internal-ip',
+               'your-session-id',
                // Answer status (code)
                'answer-status'
        );
@@ -263,6 +263,21 @@ class XmlAnnouncementAnswerTemplateEngine extends BaseTemplateEngine implements
                parent::assignVariable($this->getStackerInstance()->getNamed('announcement_answer'), $characters);
        }
 
+       /**
+        * Read announcement-answer variables by calling readVariable() with 'general' as
+        * variable stack.
+        *
+        * @param       $key    Key to read from
+        * @return      $value  Value from variable
+        */
+       public function readAnnouncementAnswerData ($key) {
+               // Read the variable
+               $value = parent::readVariable($key, 'general');
+
+               // Return value
+               return $value;
+       }
+
        /**
         * Getter for cache file (FQFN)
         *
@@ -283,221 +298,221 @@ class XmlAnnouncementAnswerTemplateEngine extends BaseTemplateEngine implements
        }
 
        /**
-        * Starts the node-data
+        * Starts the my-data
         *
         * @return      void
         */
-       private function startNodeData () {
+       private function startMyData () {
                // Push the node name on the stacker
-               $this->getStackerInstance()->pushNamed('announcement_answer', 'node-data');
+               $this->getStackerInstance()->pushNamed('announcement_answer', 'my-data');
        }
 
        /**
-        * Starts the node-external-ip
+        * Starts the my-external-ip
         *
         * @return      void
         */
-       private function startNodeExternalIp () {
+       private function startMyExternalIp () {
                // Push the node name on the stacker
-               $this->getStackerInstance()->pushNamed('announcement_answer', 'node-external-ip');
+               $this->getStackerInstance()->pushNamed('announcement_answer', 'my-external-ip');
        }
 
        /**
-        * Starts the node-internal-ip
+        * Starts the my-internal-ip
         *
         * @return      void
         */
-       private function startNodeInternalIp () {
+       private function startMyInternalIp () {
                // Push the node name on the stacker
-               $this->getStackerInstance()->pushNamed('announcement_answer', 'node-internal-ip');
+               $this->getStackerInstance()->pushNamed('announcement_answer', 'my-internal-ip');
        }
 
        /**
-        * Starts the node-tcp-port
+        * Starts the my-tcp-port
         *
         * @return      void
         */
-       private function startNodeTcpPort () {
+       private function startMyTcpPort () {
                // Push the node name on the stacker
-               $this->getStackerInstance()->pushNamed('announcement_answer', 'node-tcp-port');
+               $this->getStackerInstance()->pushNamed('announcement_answer', 'my-tcp-port');
        }
 
        /**
-        * Starts the node-udp-port
+        * Starts the my-udp-port
         *
         * @return      void
         */
-       private function startNodeUdpPort () {
+       private function startMyUdpPort () {
                // Push the node name on the stacker
-               $this->getStackerInstance()->pushNamed('announcement_answer', 'node-udp-port');
+               $this->getStackerInstance()->pushNamed('announcement_answer', 'my-udp-port');
        }
 
        /**
-        * Starts the node-session-id
+        * Starts the my-session-id
         *
         * @return      void
         */
-       private function startNodeSessionId () {
+       private function startMySessionId () {
                // Push the node name on the stacker
-               $this->getStackerInstance()->pushNamed('announcement_answer', 'node-session-id');
+               $this->getStackerInstance()->pushNamed('announcement_answer', 'my-session-id');
        }
 
        /**
-        * Starts the node-status
+        * Starts the my-status
         *
         * @return      void
         */
-       private function startNodeStatus () {
+       private function startMyStatus () {
                // Push the node name on the stacker
-               $this->getStackerInstance()->pushNamed('announcement_answer', 'node-status');
+               $this->getStackerInstance()->pushNamed('announcement_answer', 'my-status');
        }
 
        /**
-        * Finishes the node-status
+        * Finishes the my-status
         *
         * @return      void
         */
-       private function finishNodeStatus () {
+       private function finishMyStatus () {
                // Pop the last entry
                $this->getStackerInstance()->popNamed('announcement_answer');
        }
 
        /**
-        * Finishes the node-session-id
+        * Finishes the my-session-id
         *
         * @return      void
         */
-       private function finishNodeSessionId () {
+       private function finishMySessionId () {
                // Pop the last entry
                $this->getStackerInstance()->popNamed('announcement_answer');
        }
 
        /**
-        * Finishes the node-udp-port
+        * Finishes the my-udp-port
         *
         * @return      void
         */
-       private function finishNodeUdpPort () {
+       private function finishMyUdpPort () {
                // Pop the last entry
                $this->getStackerInstance()->popNamed('announcement_answer');
        }
 
        /**
-        * Finishes the node-tcp-port
+        * Finishes the my-tcp-port
         *
         * @return      void
         */
-       private function finishNodeTcpPort () {
+       private function finishMyTcpPort () {
                // Pop the last entry
                $this->getStackerInstance()->popNamed('announcement_answer');
        }
 
        /**
-        * Finishes the node-internal-ip
+        * Finishes the my-internal-ip
         *
         * @return      void
         */
-       private function finishNodeInternalIp () {
+       private function finishMyInternalIp () {
                // Pop the last entry
                $this->getStackerInstance()->popNamed('announcement_answer');
        }
 
        /**
-        * Finishes the node-external-ip
+        * Finishes the my-external-ip
         *
         * @return      void
         */
-       private function finishNodeExternalIp () {
+       private function finishMyExternalIp () {
                // Pop the last entry
                $this->getStackerInstance()->popNamed('announcement_answer');
        }
 
        /**
-        * Finishes the node-data
+        * Finishes the my-data
         *
         * @return      void
         */
-       private function finishNodeData () {
+       private function finishMyData () {
                // Pop the last entry
                $this->getStackerInstance()->popNamed('announcement_answer');
        }
 
        /**
-        * Starts the other-data
+        * Starts the your-data
         *
         * @return      void
         */
-       private function startOtherData () {
+       private function startYourData () {
                // Push the node name on the stacker
-               $this->getStackerInstance()->pushNamed('announcement_answer', 'other-data');
+               $this->getStackerInstance()->pushNamed('announcement_answer', 'your-data');
        }
 
        /**
-        * Starts the other-external-ip
+        * Starts the your-external-ip
         *
         * @return      void
         */
-       private function startOtherExternalIp () {
+       private function startYourExternalIp () {
                // Push the node name on the stacker
-               $this->getStackerInstance()->pushNamed('announcement_answer', 'other-external-ip');
+               $this->getStackerInstance()->pushNamed('announcement_answer', 'your-external-ip');
        }
 
        /**
-        * Starts the other-internal-ip
+        * Starts the your-internal-ip
         *
         * @return      void
         */
-       private function startOtherInternalIp () {
+       private function startYourInternalIp () {
                // Push the node name on the stacker
-               $this->getStackerInstance()->pushNamed('announcement_answer', 'other-internal-ip');
+               $this->getStackerInstance()->pushNamed('announcement_answer', 'your-internal-ip');
        }
 
        /**
-        * Starts the other-session-id
+        * Starts the your-session-id
         *
         * @return      void
         */
-       private function startOtherSessionId () {
+       private function startYourSessionId () {
                // Push the node name on the stacker
-               $this->getStackerInstance()->pushNamed('announcement_answer', 'other-session-id');
+               $this->getStackerInstance()->pushNamed('announcement_answer', 'your-session-id');
        }
 
        /**
-        * Finishes the other-session-id
+        * Finishes the your-session-id
         *
         * @return      void
         */
-       private function finishOtherSessionId () {
+       private function finishYourSessionId () {
                // Pop the last entry
                $this->getStackerInstance()->popNamed('announcement_answer');
        }
 
        /**
-        * Finishes the other-internal-ip
+        * Finishes the your-internal-ip
         *
         * @return      void
         */
-       private function finishOtherInternalIp () {
+       private function finishYourInternalIp () {
                // Pop the last entry
                $this->getStackerInstance()->popNamed('announcement_answer');
        }
 
        /**
-        * Finishes the other-external-ip
+        * Finishes the your-external-ip
         *
         * @return      void
         */
-       private function finishOtherExternalIp () {
+       private function finishYourExternalIp () {
                // Pop the last entry
                $this->getStackerInstance()->popNamed('announcement_answer');
        }
 
        /**
-        * Finishes the other-data
+        * Finishes the your-data
         *
         * @return      void
         */
-       private function finishOtherData () {
+       private function finishYourData () {
                // Pop the last entry
                $this->getStackerInstance()->popNamed('announcement_answer');
        }
index 9360edd833c3efa263c40353719f1328eb158dd9..7694b4449b0594342666cbea9f023e9cfce63da4 100644 (file)
@@ -26,50 +26,50 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
        <!--
        The following data is from this node.
        //-->
-       <node-data>
+       <my-data>
                <!--
                This node's external IP/hostname
                //-->
-               <node-external-ip>{?external_ip?}</node-external-ip>
+               <my-external-ip>{?external_ip?}</my-external-ip>
                <!--
                This node's internal IP/hostname
                //-->
-               <node-internal-ip>{?internal_ip?}</node-internal-ip>
+               <my-internal-ip>{?internal_ip?}</my-internal-ip>
                <!--
                This node's TCP port
                //-->
-               <node-tcp-port>{?node_tcp_listen_port?}</node-tcp-port>
+               <my-tcp-port>{?node_tcp_listen_port?}</my-tcp-port>
                <!--
                This node's UDP port
                //-->
-               <node-udp-port>{?node_udp_listen_port?}</node-udp-port>
+               <my-udp-port>{?node_udp_listen_port?}</my-udp-port>
                <!--
                This node's session id
                //-->
-               <node-session-id>{?session_id?}</node-session-id>
+               <my-session-id>{?session_id?}</my-session-id>
                <!--
                This node's status
                //-->
-               <node-status>{?node_status?}</node-status>
-       </node-data>
+               <my-status>{?node_status?}</my-status>
+       </my-data>
        <!--
        The following data is the other node's data. This data is being sent to
        confirm that it has been received correctly.
        //-->
-       <other-data>
+       <your-data>
                <!--
                Other node's external IP/hostname
                //-->
-               <other-external-ip>{?other_external_ip?}</other-external-ip>
+               <your-external-ip>{?your_external_ip?}</your-external-ip>
                <!--
                Other node's internal IP/hostname
                //-->
-               <other-internal-ip>{?other_internal_ip?}</other-internal-ip>
+               <your-internal-ip>{?your_internal_ip?}</your-internal-ip>
                <!--
                Other node's session id
                //-->
-               <other-session-id>{?other_session_id?}</other-session-id>
-       </other-data>
+               <your-session-id>{?your_session_id?}</your-session-id>
+       </your-data>
        <!--
        Status of this answer. This can be something like OKAY if all went fine or
        any other error code.