]> git.mxchange.org Git - hub.git/commitdiff
Added missing XML node 'dht-node-list' + object type 'dht_bootstrap_answer.
authorRoland 'Quix0r' Haeder <roland@mxchange.org>
Fri, 14 Mar 2014 22:05:47 +0000 (23:05 +0100)
committerRoland 'Quix0r' Haeder <roland@mxchange.org>
Fri, 14 Mar 2014 23:18:25 +0000 (00:18 +0100)
Signed-off-by: Roland 'Quix0r' Haeder <roland@mxchange.org>
application/hub/main/template/answer/dht/class_XmlDhtBootstrapAnswerTemplateEngine.php
application/hub/templates/xml/object_registry/object_registry.xml

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
         *
index c3470188c54b21cc24cabd233b76ab5fcaca9411..a83a1838019afc4e9ea7df946b508eb3dff45c7a 100644 (file)
@@ -105,6 +105,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
                        <object-protocol>tcp</object-protocol>
                        <object-recipient-type>all</object-recipient-type>
                </object-list-entry>
+               <object-list-entry>
+                       <object-name>dht_bootstrap_answer</object-name>
+                       <object-recipient-limitation>direct</object-recipient-limitation>
+                       <object-max-spread>1</object-max-spread>
+                       <object-protocol>tcp</object-protocol>
+                       <object-recipient-type>hub</object-recipient-type>
+               </object-list-entry>
                <object-list-entry>
                        <object-name>dht_publish_entry</object-name>
                        <object-recipient-limitation>all</object-recipient-limitation>