]> git.mxchange.org Git - hub.git/blobdiff - application/hub/main/template/dht/class_XmlDhtBootstrapTemplateEngine.php
Updated 'core'.
[hub.git] / application / hub / main / template / dht / class_XmlDhtBootstrapTemplateEngine.php
index 151a5988744f0da1781e8a8f4eca450ce29741b1..c99756b53058201e9d9e1537e8d40a48f5f513d7 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2015 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @todo               This template engine does not make use of setTemplateType()
@@ -26,13 +26,12 @@ class XmlDhtBootstrapTemplateEngine extends BaseXmlTemplateEngine implements Com
        /**
         * Some XML nodes must be available for later data extraction
         */
-       const DHT_BOOTSTRAP_DATA_BOOTSTRAP_DATA = 'dht-bootstrap-data';
-       const DHT_BOOTSTRAP_DATA_SESSION_ID     = 'session-id';
-       const DHT_BOOTSTRAP_DATA_NODE_STATUS    = 'node-status';
-       const DHT_BOOTSTRAP_DATA_NODE_MODE      = 'node-mode';
-       const DHT_BOOTSTRAP_DATA_EXTERNAL_IP    = 'external-ip';
-       const DHT_BOOTSTRAP_DATA_INTERNAL_IP    = 'internal-ip';
-       const DHT_BOOTSTRAP_DATA_LISTEN_PORT    = 'listen-port';
+       const DHT_BOOTSTRAP_DATA_BOOTSTRAP_DATA   = 'dht-bootstrap-data';
+       const DHT_BOOTSTRAP_DATA_SESSION_ID       = 'session-id';
+       const DHT_BOOTSTRAP_DATA_NODE_STATUS      = 'node-status';
+       const DHT_BOOTSTRAP_DATA_NODE_MODE        = 'node-mode';
+       const DHT_BOOTSTRAP_DATA_EXTERNAL_ADDRESS = 'external-address';
+       const DHT_BOOTSTRAP_DATA_INTERNAL_ADDRESS = 'internal-address';
 
        /**
         * Protected constructor
@@ -44,16 +43,15 @@ class XmlDhtBootstrapTemplateEngine extends BaseXmlTemplateEngine implements Com
                parent::__construct(__CLASS__);
 
                // Init array
-               $this->subNodes = array(
+               $this->setSubNodes(array(
                        self::DHT_BOOTSTRAP_DATA_BOOTSTRAP_DATA,
                        'listener',
                        self::DHT_BOOTSTRAP_DATA_NODE_STATUS,
                        self::DHT_BOOTSTRAP_DATA_NODE_MODE,
-                       self::DHT_BOOTSTRAP_DATA_LISTEN_PORT,
                        self::DHT_BOOTSTRAP_DATA_SESSION_ID,
-                       self::DHT_BOOTSTRAP_DATA_EXTERNAL_IP,
-                       self::DHT_BOOTSTRAP_DATA_INTERNAL_IP
-               );
+                       self::DHT_BOOTSTRAP_DATA_EXTERNAL_ADDRESS,
+                       self::DHT_BOOTSTRAP_DATA_INTERNAL_ADDRESS
+               ));
        }
 
        /**
@@ -161,24 +159,14 @@ class XmlDhtBootstrapTemplateEngine extends BaseXmlTemplateEngine implements Com
                $this->getStackInstance()->pushNamed('dht_bootstrap', 'listener');
        }
 
-       /**
-        * Starts the TCP/UDP listen port
-        *
-        * @return      void
-        */
-       protected function startListenPort () {
-               // Push the node name on the stacker
-               $this->getStackInstance()->pushNamed('dht_bootstrap', self::DHT_BOOTSTRAP_DATA_LISTEN_PORT);
-       }
-
        /**
         * Starts the public ip
         *
         * @return      void
         */
-       protected function startExternalIp () {
+       protected function startExternalAddress () {
                // Push the node name on the stacker
-               $this->getStackInstance()->pushNamed('dht_bootstrap', self::DHT_BOOTSTRAP_DATA_EXTERNAL_IP);
+               $this->getStackInstance()->pushNamed('dht_bootstrap', self::DHT_BOOTSTRAP_DATA_EXTERNAL_ADDRESS);
        }
 
        /**
@@ -186,9 +174,9 @@ class XmlDhtBootstrapTemplateEngine extends BaseXmlTemplateEngine implements Com
         *
         * @return      void
         */
-       protected function startInternalIp () {
+       protected function startInternalAddress () {
                // Push the node name on the stacker
-               $this->getStackInstance()->pushNamed('dht_bootstrap', self::DHT_BOOTSTRAP_DATA_INTERNAL_IP);
+               $this->getStackInstance()->pushNamed('dht_bootstrap', self::DHT_BOOTSTRAP_DATA_INTERNAL_ADDRESS);
        }
 
        /**
@@ -216,7 +204,7 @@ class XmlDhtBootstrapTemplateEngine extends BaseXmlTemplateEngine implements Com
         *
         * @return      void
         */
-       protected function finishInternalIp () {
+       protected function finishInternalAddress () {
                // Pop the last entry
                $this->getStackInstance()->popNamed('dht_bootstrap');
        }
@@ -226,17 +214,7 @@ class XmlDhtBootstrapTemplateEngine extends BaseXmlTemplateEngine implements Com
         *
         * @return      void
         */
-       protected function finishExternalIp () {
-               // Pop the last entry
-               $this->getStackInstance()->popNamed('dht_bootstrap');
-       }
-
-       /**
-        * Finishes the TCP/UDP listen port
-        *
-        * @return      void
-        */
-       protected function finishListenPort () {
+       protected function finishExternalAddress () {
                // Pop the last entry
                $this->getStackInstance()->popNamed('dht_bootstrap');
        }