]> git.mxchange.org Git - hub.git/commitdiff
Added empty task for DHT bootstrapping
authorRoland Häder <roland@mxchange.org>
Fri, 1 Feb 2013 23:02:37 +0000 (23:02 +0000)
committerRoland Häder <roland@mxchange.org>
Fri, 1 Feb 2013 23:02:37 +0000 (23:02 +0000)
.gitattributes
application/hub/config.php
application/hub/main/filter/task/node/class_NodeTaskHandlerInitializerFilter.php
application/hub/main/tasks/node/announcement/class_NodeAnnouncementTask.php
application/hub/main/tasks/node/class_Node
application/hub/main/tasks/node/dht/class_NodeDhtBootstrapTask.php [new file with mode: 0644]
application/hub/main/tasks/node/dht/class_NodeDhtQueryTask.php
application/hub/main/tasks/node/self_connect/class_NodeSelfConnectTask.php

index 2d95c0e4ebab736ead7efe537c277b87a897af03..aff2770db57f76c6c888104496ec5968f3e3bbb2 100644 (file)
@@ -634,6 +634,7 @@ application/hub/main/tasks/node/class_Node svneol=native#text/plain
 application/hub/main/tasks/node/decoder/.htaccess -text svneol=unset#text/plain
 application/hub/main/tasks/node/decoder/class_NodePackageDecoderTask.php -text
 application/hub/main/tasks/node/dht/.htaccess -text svneol=unset#text/plain
+application/hub/main/tasks/node/dht/class_NodeDhtBootstrapTask.php svneol=native#text/plain
 application/hub/main/tasks/node/dht/class_NodeDhtQueryTask.php svneol=native#text/plain
 application/hub/main/tasks/node/listener/.htaccess -text svneol=unset#text/plain
 application/hub/main/tasks/node/ping/.htaccess -text svneol=unset#text/plain
index 692d382246b4c8937000b080b5b790e668724d66..2eb64ee7d35e636287d0598a1f8f53a2930b13a5 100644 (file)
@@ -498,6 +498,9 @@ $cfg->setConfigEntry('node_chunk_assembler_task_class', 'NodeChunkAssemblerTask'
 // CFG: NODE-PACKAGE-DECODER-TASK-CLASS
 $cfg->setConfigEntry('node_package_decoder_task_class', 'NodePackageDecoderTask');
 
+// CFG: NODE-DHT-BOOTSTRAP-TASK-CLASS
+$cfg->setConfigEntry('node_dht_bootstrap_task_class', 'NodeDhtInitializationTask');
+
 // CFG: NODE-DHT-QUERY-TASK-CLASS
 $cfg->setConfigEntry('node_dht_query_task_class', 'NodeDhtQueryTask');
 
@@ -546,6 +549,15 @@ $cfg->setConfigEntry('task_chunk_assembler_interval_delay', 50);
 // CFG: TASK-CHUNK-ASSEMBLER-MAX-RUNS
 $cfg->setConfigEntry('task_chunk_assembler_max_runs', 0);
 
+// CFG: TASK-DHT-BOOTSTRAP-STATUP-DELAY
+$cfg->setConfigEntry('task_dht_bootstrap_startup_delay', 100);
+
+// CFG: TASK-DHT-BOOTSTRAP-INTERVAL-DELAY
+$cfg->setConfigEntry('task_dht_bootstrap_interval_delay', 3600000); // = 1 hour
+
+// CFG: TASK-DHT-BOOTSTRAP-MAX-RUNS
+$cfg->setConfigEntry('task_dht_bootstrap_max_runs', 1);
+
 // CFG: TASK-DHT-QUERY-STATUP-DELAY
 $cfg->setConfigEntry('task_dht_query_startup_delay', 1400);
 
index 5d17d92da46314b1f731de23446678c96440ed1c..c28671577009b6a43759e803433d11e8b581cc81 100644 (file)
@@ -91,6 +91,12 @@ class NodeTaskHandlerInitializerFilter extends BaseNodeFilter implements Filtera
                // Register it as well
                $handlerInstance->registerTask('package_decoder', $taskInstance);
 
+               // Generate DHT initialization task
+               $taskInstance = ObjectFactory::createObjectByConfiguredName('node_dht_bootstrap_task_class');
+
+               // Register it as well
+               $handlerInstance->registerTask('dht_bootstrap', $taskInstance);
+
                // Generate DHT query task
                $taskInstance = ObjectFactory::createObjectByConfiguredName('node_dht_query_task_class');
 
index 803f5c71d6897aae3aa14780e53632ad87655748..2d0e1e3d68ed7195af08d60691eb9bd9b8b27039 100644 (file)
@@ -50,7 +50,6 @@ class NodeAnnouncementTask extends BaseTask implements Taskable, Visitable {
         *
         * @param       $visitorInstance        An instance of a Visitor class
         * @return      void
-        * @todo        0%
         */
        public function accept (Visitor $visitorInstance) {
                // Visit this task
index 82b881ed53c631d81008de61ddab2aa2aa2e764f..154e8f43699d9f3202e103ea40e84ba37e00910a 100644 (file)
@@ -61,7 +61,7 @@ class Node???Task extends BaseTask implements Taskable, Visitable {
         * Executes the task
         *
         * @return      void
-        * @todo        0%
+        * @todo        0% done
         */
        public function executeTask () {
                $this->partialStub('Unimplemented task.');
diff --git a/application/hub/main/tasks/node/dht/class_NodeDhtBootstrapTask.php b/application/hub/main/tasks/node/dht/class_NodeDhtBootstrapTask.php
new file mode 100644 (file)
index 0000000..25348ba
--- /dev/null
@@ -0,0 +1,72 @@
+<?php
+/**
+ * A DhtBootstrap node-task
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * 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 NodeDhtBootstrapTask extends BaseTask implements Taskable, Visitable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this class
+        *
+        * @return      $taskInstance   An instance of a Visitable class
+        */
+       public final static function createNodeDhtBootstrapTask () {
+               // Get new instance
+               $taskInstance = new NodeDhtBootstrapTask();
+
+               // Return the prepared instance
+               return $taskInstance;
+       }
+
+       /**
+        * Accepts the visitor to process the visit "request"
+        *
+        * @param       $visitorInstance        An instance of a Visitor class
+        * @return      void
+        * @todo        Maybe visit some sub-objects
+        */
+       public function accept (Visitor $visitorInstance) {
+               // Visit this task
+               $visitorInstance->visitTask($this);
+       }
+
+       /**
+        * Executes the task
+        *
+        * @return      void
+        * @todo        0% done
+        */
+       public function executeTask () {
+               $this->partialStub('Unimplemented task.');
+       }
+}
+
+// [EOF]
+?>
index 833cbe93a791d42474c58d6974bcb35f45f49bb3..0281d86630f04832f01f7b6c9da391dababe3da0 100644 (file)
@@ -61,7 +61,7 @@ class NodeDhtQueryTask extends BaseTask implements Taskable, Visitable {
         * Executes the task
         *
         * @return      void
-        * @todo        0%
+        * @todo        0% done
         */
        public function executeTask () {
                $this->partialStub('Unimplemented task.');
index f1e837cfb4df936e0ba1adb464f46245379305d2..2b7a32976c6a5ae4192f6b08d65468b2b855970b 100644 (file)
@@ -50,7 +50,6 @@ class NodeSelfConnectTask extends BaseTask implements Taskable, Visitable {
         *
         * @param       $visitorInstance        An instance of a Visitor class
         * @return      void
-        * @todo        0%
         */
        public function accept (Visitor $visitorInstance) {
                // Visit this task