]> git.mxchange.org Git - hub.git/blobdiff - application/hub/main/template/answer/dht/class_XmlDhtBootstrapAnswerTemplateEngine.php
Added missing XML node 'dht-node-list' + object type 'dht_bootstrap_answer.
[hub.git] / application / hub / main / template / answer / dht / class_XmlDhtBootstrapAnswerTemplateEngine.php
index cc33e5e7cb45e9070661e7f9f8d1d1865220a7b6..cc0cd9fb757ffd1fb226d08d153132e066c12638 100644 (file)
@@ -30,7 +30,8 @@ class XmlDhtBootstrapAnswerTemplateEngine extends BaseXmlAnswerTemplateEngine im
        const DHT_BOOTSTRAP_DATA_NODE_STATUS   = 'my-status';
        const DHT_BOOTSTRAP_DATA_EXTERNAL_IP   = 'my-external-ip';
        const DHT_BOOTSTRAP_DATA_INTERNAL_IP   = 'my-internal-ip';
-       const DHT_BOOTSTRAP_DATA_LISTEN_PORT      = 'my-listen-port';
+       const DHT_BOOTSTRAP_DATA_LISTEN_PORT   = 'my-listen-port';
+       const DHT_BOOTSTRAP_DATA_NODE_LIST     = 'dht-node-list';
 
        /**
         * Protected constructor
@@ -58,6 +59,8 @@ class XmlDhtBootstrapAnswerTemplateEngine extends BaseXmlAnswerTemplateEngine im
                        'your-session-id',
                        // Answer status (generic field)
                        self::ANSWER_STATUS,
+                       // DHT node list
+                       self::DHT_BOOTSTRAP_DATA_NODE_LIST,
                );
        }
 
@@ -187,6 +190,26 @@ class XmlDhtBootstrapAnswerTemplateEngine extends BaseXmlAnswerTemplateEngine im
                $this->getStackerInstance()->pushNamed('node_dht_bootstrap_answer', self::DHT_BOOTSTRAP_DATA_NODE_STATUS);
        }
 
+       /**
+        * Starts the dht-node-list
+        *
+        * @return      void
+        */
+       protected function startDhtNodeList () {
+               // Push the node name on the stacker
+               $this->getStackerInstance()->pushNamed('node_dht_bootstrap_answer', self::DHT_BOOTSTRAP_DATA_NODE_LIST);
+       }
+
+       /**
+        * Finishes the dht-node-list
+        *
+        * @return      void
+        */
+       protected function finishDhtNodeList () {
+               // Pop the last entry
+               $this->getStackerInstance()->popNamed('node_dht_bootstrap_answer');
+       }
+
        /**
         * Finishes the my-status
         *