]> git.mxchange.org Git - hub.git/commitdiff
Added in last commit missing files.
authorRoland Haeder <roland@mxchange.org>
Wed, 26 Mar 2014 18:57:48 +0000 (19:57 +0100)
committerRoland Haeder <roland@mxchange.org>
Wed, 26 Mar 2014 18:57:48 +0000 (19:57 +0100)
Signed-off-by: Roland Haeder <roland@mxchange.org>
application/hub/main/nodes/class [new file with mode: 0644]
application/hub/main/tasks/dht/.htaccess [new file with mode: 0644]
application/hub/main/tasks/dht/bootstrap/.htaccess [new file with mode: 0644]
application/hub/main/tasks/dht/bootstrap/class_DhtBootstrapTask.php [new file with mode: 0644]
application/hub/main/tasks/dht/class_Dht [new file with mode: 0644]

diff --git a/application/hub/main/nodes/class b/application/hub/main/nodes/class
new file mode 100644 (file)
index 0000000..24dbb98
--- /dev/null
@@ -0,0 +1,11 @@
+
+       /**
+        * Adds extra tasks to the given handler for this node
+        *
+        * @param       $handlerInstance        An instance of a HandleableTask class
+        * @return      void
+        * @todo        0% done
+        */
+       public function addExtraTasks (HandleableTask $handlerInstance) {
+               $this->partialStub('Please add some tasks or empty this method.');
+       }
diff --git a/application/hub/main/tasks/dht/.htaccess b/application/hub/main/tasks/dht/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/hub/main/tasks/dht/bootstrap/.htaccess b/application/hub/main/tasks/dht/bootstrap/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/hub/main/tasks/dht/bootstrap/class_DhtBootstrapTask.php b/application/hub/main/tasks/dht/bootstrap/class_DhtBootstrapTask.php
new file mode 100644 (file)
index 0000000..5ca4af4
--- /dev/null
@@ -0,0 +1,78 @@
+<?php
+/**
+ * A Bootstrap task for DHTs, use this only for nodes which do not announce
+ * themself to upper nodes as if they completed announcement they will attempt
+ * to bootstrap their DHT. This said condition currently only matches with
+ * bootstrap nodes (mode=boot) as they don't announce as they are already the
+ * bootstrapper and there are no super nodes.
+ *
+ * If there would be super nodes, a centralization occurs (on the super nodes).
+ *
+ * @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 DhtBootstrapTask 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 createDhtBootstrapTask () {
+               // Get new instance
+               $taskInstance = new DhtBootstrapTask();
+
+               // Return the prepared instance
+               return $taskInstance;
+       }
+
+       /**
+        * Accepts the visitor to process the visitor
+        *
+        * @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%
+        */
+       public function executeTask () {
+               $this->partialStub('Unimplemented task.');
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/hub/main/tasks/dht/class_Dht b/application/hub/main/tasks/dht/class_Dht
new file mode 100644 (file)
index 0000000..ca7fc9f
--- /dev/null
@@ -0,0 +1,72 @@
+<?php
+/**
+ * A ??? task for DHTs
+ *
+ * @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 Dht???Task 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 createDht???Task () {
+               // Get new instance
+               $taskInstance = new Dht???Task();
+
+               // Return the prepared instance
+               return $taskInstance;
+       }
+
+       /**
+        * Accepts the visitor to process the visitor
+        *
+        * @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%
+        */
+       public function executeTask () {
+               $this->partialStub('Unimplemented task.');
+       }
+}
+
+// [EOF]
+?>