]> git.mxchange.org Git - hub.git/commitdiff
Use 'my_' prefix for 'my' (local) node's data
authorRoland Häder <roland@mxchange.org>
Sat, 26 May 2012 22:45:27 +0000 (22:45 +0000)
committerRoland Häder <roland@mxchange.org>
Sat, 26 May 2012 22:45:27 +0000 (22:45 +0000)
application/hub/main/filter/tags/answer/class_PackageAnnouncementAnswerTagFilter.php
application/hub/main/helper/hub/answer/announcement/class_NodeAnnouncementMessageAnswerHelper.php
application/hub/main/template/answer/announcement/class_XmlAnnouncementAnswerTemplateEngine.php
application/hub/templates/xml/answer/announcement/announcement_answer.xml

index f0d6bf5200d6d0b61335e186dc8e48217d123941..12e12a0cdffae28bfe688a3db547afb27908d4ff 100644 (file)
@@ -38,12 +38,12 @@ class PackageAnnouncementAnswerTagFilter extends BaseFilter implements Filterabl
 
                // Init array
                $this->dataXmlNodes = array(
-                       XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_EXTERNAL_IP => '',
-                       XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_INTERNAL_IP => '',
-                       XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_NODE_STATUS => '',
-                       XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_SESSION_ID  => '',
-                       XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_TCP_PORT    => 9060,
-                       XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_UDP_PORT    => 9060
+                       XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_EXTERNAL_IP => '',
+                       XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_INTERNAL_IP => '',
+                       XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_NODE_STATUS => '',
+                       XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_SESSION_ID  => '',
+                       XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_TCP_PORT    => 9060,
+                       XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_UDP_PORT    => 9060
                );
        }
 
index a02daae188e8249f967c7735e70579182231d21f..80a72381e8eedbe00f5c981edc51fc56c69c25ee 100644 (file)
@@ -47,7 +47,7 @@ class NodeAnnouncementMessageAnswerHelper extends BaseHubAnswerHelper implements
                $helperInstance = new NodeAnnouncementMessageAnswerHelper();
 
                // Set session id of other peer as recipient
-               $helperInstance->setRecipientType($messageData[XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_SESSION_ID]);
+               $helperInstance->setRecipientType($messageData[XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_SESSION_ID]);
 
                // Set message data
                $helperInstance->setMessageData($messageData);
index 3ec35f13233feffeb335d74659a72352de7114b1..a1e28a948ab410eac5ec0c38895c4469aee77204 100644 (file)
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 class XmlAnnouncementAnswerTemplateEngine extends BaseTemplateEngine implements CompileableTemplate, Registerable {
+       /**
+        * Some XML nodes must be available for later data extraction
+        */
+       const ANNOUNCEMENT_DATA_SESSION_ID  = 'my-session-id';
+       const ANNOUNCEMENT_DATA_NODE_STATUS = 'my-status';
+       const ANNOUNCEMENT_DATA_EXTERNAL_IP = 'my-external-ip';
+       const ANNOUNCEMENT_DATA_INTERNAL_IP = 'my-internal-ip';
+       const ANNOUNCEMENT_DATA_TCP_PORT    = 'my-tcp-port';
+       const ANNOUNCEMENT_DATA_UDP_PORT    = 'my-udp-port';
+
        /**
         * Main nodes in the XML tree
         */
index 7694b4449b0594342666cbea9f023e9cfce63da4..647ad98255af566c6bb39ce8a021dff9f2ea2834 100644 (file)
@@ -30,27 +30,27 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
                <!--
                This node's external IP/hostname
                //-->
-               <my-external-ip>{?external_ip?}</my-external-ip>
+               <my-external-ip>{?my_external_ip?}</my-external-ip>
                <!--
                This node's internal IP/hostname
                //-->
-               <my-internal-ip>{?internal_ip?}</my-internal-ip>
+               <my-internal-ip>{?my_internal_ip?}</my-internal-ip>
                <!--
                This node's TCP port
                //-->
-               <my-tcp-port>{?node_tcp_listen_port?}</my-tcp-port>
+               <my-tcp-port>{?my_tcp_port?}</my-tcp-port>
                <!--
                This node's UDP port
                //-->
-               <my-udp-port>{?node_udp_listen_port?}</my-udp-port>
+               <my-udp-port>{?my_udp_port?}</my-udp-port>
                <!--
                This node's session id
                //-->
-               <my-session-id>{?session_id?}</my-session-id>
+               <my-session-id>{?my_session_id?}</my-session-id>
                <!--
                This node's status
                //-->
-               <my-status>{?node_status?}</my-status>
+               <my-status>{?my_status?}</my-status>
        </my-data>
        <!--
        The following data is the other node's data. This data is being sent to