]> git.mxchange.org Git - hub.git/blobdiff - application/hub/main/template/answer/announcement/class_XmlAnnouncementAnswerTemplateEngine.php
Rewrites, some more methods:
[hub.git] / application / hub / main / template / answer / announcement / class_XmlAnnouncementAnswerTemplateEngine.php
index 953d681308a3e785b6afa31715df344d3a4c1b20..17feefd456b20ee14dad667ee2f53b4857260e0b 100644 (file)
@@ -22,7 +22,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-class XmlAnnouncementAnswerTemplateEngine extends BaseXmlTemplateEngine implements CompileableTemplate, Registerable {
+class XmlAnnouncementAnswerTemplateEngine extends BaseXmlAnswerTemplateEngine implements CompileableTemplate, Registerable {
        /**
         * Some XML nodes must be available for later data extraction
         */
@@ -30,8 +30,7 @@ class XmlAnnouncementAnswerTemplateEngine extends BaseXmlTemplateEngine implemen
        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';
+       const ANNOUNCEMENT_DATA_LISTEN_PORT      = 'my-listen-port';
 
        /**
         * Protected constructor
@@ -50,14 +49,15 @@ class XmlAnnouncementAnswerTemplateEngine extends BaseXmlTemplateEngine implemen
                        // Data from *this* node
                        self::ANNOUNCEMENT_DATA_EXTERNAL_IP,
                        self::ANNOUNCEMENT_DATA_INTERNAL_IP,
-                       self::ANNOUNCEMENT_DATA_TCP_PORT,
-                       self::ANNOUNCEMENT_DATA_UDP_PORT,
+                       self::ANNOUNCEMENT_DATA_LISTEN_PORT,
                        self::ANNOUNCEMENT_DATA_NODE_STATUS,
                        self::ANNOUNCEMENT_DATA_SESSION_ID,
                        // Data from other node
                        'your-external-ip',
                        'your-internal-ip',
                        'your-session-id',
+                       // Answer status (generic field)
+                       self::ANSWER_STATUS,
                );
        }
 
@@ -162,19 +162,9 @@ class XmlAnnouncementAnswerTemplateEngine extends BaseXmlTemplateEngine implemen
         *
         * @return      void
         */
-       protected function startMyTcpPort () {
+       protected function startMyListenPort () {
                // Push the node name on the stacker
-               $this->getStackerInstance()->pushNamed('node_announcement_answer', self::ANNOUNCEMENT_DATA_TCP_PORT);
-       }
-
-       /**
-        * Starts the my-udp-port
-        *
-        * @return      void
-        */
-       protected function startMyUdpPort () {
-               // Push the node name on the stacker
-               $this->getStackerInstance()->pushNamed('node_announcement_answer', self::ANNOUNCEMENT_DATA_UDP_PORT);
+               $this->getStackerInstance()->pushNamed('node_announcement_answer', self::ANNOUNCEMENT_DATA_LISTEN_PORT);
        }
 
        /**
@@ -217,22 +207,12 @@ class XmlAnnouncementAnswerTemplateEngine extends BaseXmlTemplateEngine implemen
                $this->getStackerInstance()->popNamed('node_announcement_answer');
        }
 
-       /**
-        * Finishes the my-udp-port
-        *
-        * @return      void
-        */
-       protected function finishMyUdpPort () {
-               // Pop the last entry
-               $this->getStackerInstance()->popNamed('node_announcement_answer');
-       }
-
        /**
         * Finishes the my-tcp-port
         *
         * @return      void
         */
-       protected function finishMyTcpPort () {
+       protected function finishMyListenPort () {
                // Pop the last entry
                $this->getStackerInstance()->popNamed('node_announcement_answer');
        }