]> git.mxchange.org Git - hub.git/commitdiff
Added (unfinished) DHT class
authorRoland Häder <roland@mxchange.org>
Mon, 27 Aug 2012 22:20:45 +0000 (22:20 +0000)
committerRoland Häder <roland@mxchange.org>
Mon, 27 Aug 2012 22:20:45 +0000 (22:20 +0000)
.gitattributes
application/hub/interfaces/dht/.htaccess [new file with mode: 0644]
application/hub/interfaces/dht/class_Dht.php [new file with mode: 0644]
application/hub/main/dht/.htaccess [new file with mode: 0644]
application/hub/main/dht/class_ [new file with mode: 0644]
application/hub/main/dht/class_BaseDht.php [new file with mode: 0644]
application/hub/main/dht/node/.htaccess [new file with mode: 0644]
application/hub/main/dht/node/class_NodeDhtFacade.php [new file with mode: 0644]
application/hub/main/package/fragmenter/class_PackageFragmenter.php

index 5779dcfc66dedac2defabb7382964d89bab78ef0..ef31572abb9152488694e07c01f645dcf80cea2c 100644 (file)
@@ -55,6 +55,8 @@ application/hub/interfaces/cruncher/.htaccess svneol=native#text/plain
 application/hub/interfaces/cruncher/class_CruncherHelper.php svneol=native#text/plain
 application/hub/interfaces/decoder/.htaccess -text svneol=unset#text/plain
 application/hub/interfaces/decoder/class_Decodeable.php svneol=native#text/plain
+application/hub/interfaces/dht/.htaccess -text svneol=unset#text/plain
+application/hub/interfaces/dht/class_Dht.php svneol=native#text/plain
 application/hub/interfaces/discovery/.htaccess -text svneol=unset#text/plain
 application/hub/interfaces/discovery/class_DiscoverableRecipient.php svneol=native#text/plain
 application/hub/interfaces/discovery/class_DiscoverableSocket.php svneol=native#text/plain
@@ -220,6 +222,10 @@ application/hub/main/decoder/class_ svneol=native#text/plain
 application/hub/main/decoder/package/.htaccess -text svneol=unset#text/plain
 application/hub/main/decoder/package/class_PackageDecoder.php svneol=native#text/plain
 application/hub/main/decorators/.htaccess -text svneol=unset#text/plain
+application/hub/main/dht/.htaccess -text svneol=unset#text/plain
+application/hub/main/dht/class_ svneol=native#text/plain
+application/hub/main/dht/node/.htaccess -text svneol=unset#text/plain
+application/hub/main/dht/node/class_NodeDhtFacade.php svneol=native#text/plain
 application/hub/main/discovery/.htaccess -text svneol=unset#text/plain
 application/hub/main/discovery/class_BaseHubDiscovery.php svneol=native#text/plain
 application/hub/main/discovery/package/.htaccess -text svneol=unset#text/plain
diff --git a/application/hub/interfaces/dht/.htaccess b/application/hub/interfaces/dht/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/hub/interfaces/dht/class_Dht.php b/application/hub/interfaces/dht/class_Dht.php
new file mode 100644 (file)
index 0000000..758d391
--- /dev/null
@@ -0,0 +1,28 @@
+<?php
+/**
+ * An interface 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/>.
+ */
+interface Dht extends FrameworkInterface {
+}
+
+// [EOF]
+?>
diff --git a/application/hub/main/dht/.htaccess b/application/hub/main/dht/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/hub/main/dht/class_ b/application/hub/main/dht/class_
new file mode 100644 (file)
index 0000000..0543b18
--- /dev/null
@@ -0,0 +1,50 @@
+<?php
+/**
+ * A ??? DHT facade class
+ *
+ * @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 ???DhtFacade extends BaseDht implements Dht {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this class
+        *
+        * @return      $dhtInstance            An instance of a Dht class
+        */
+       public final static function create??? () {
+               // Get new instance
+               $dhtInstance = new ???DhtFacade();
+
+               // Return the prepared instance
+               return $dhtInstance;
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/hub/main/dht/class_BaseDht.php b/application/hub/main/dht/class_BaseDht.php
new file mode 100644 (file)
index 0000000..f9dfa5f
--- /dev/null
@@ -0,0 +1,38 @@
+<?php
+/**
+ * A general DHT class
+ *
+ * @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 BaseDht extends BaseHubSystem {
+       /**
+        * Protected constructor
+        *
+        * @param       $className      Name of the class
+        * @return      void
+        */
+       protected function __construct ($className) {
+               // Call parent constructor
+               parent::__construct($className);
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/hub/main/dht/node/.htaccess b/application/hub/main/dht/node/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/hub/main/dht/node/class_NodeDhtFacade.php b/application/hub/main/dht/node/class_NodeDhtFacade.php
new file mode 100644 (file)
index 0000000..a2666f6
--- /dev/null
@@ -0,0 +1,50 @@
+<?php
+/**
+ * A Node DHT facade class
+ *
+ * @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 NodeDhtFacade extends BaseDht implements Dht {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this class
+        *
+        * @return      $dhtInstance            An instance of a Dht class
+        */
+       public final static function createNode () {
+               // Get new instance
+               $dhtInstance = new NodeDhtFacade();
+
+               // Return the prepared instance
+               return $dhtInstance;
+       }
+}
+
+// [EOF]
+?>
index cbc5cc0ba5072c354482badfacbca33e31ad2cb4..2debe34fadacb94abb637526c45e41f48c20096a 100644 (file)
@@ -118,7 +118,7 @@ class PackageFragmenter extends BaseHubSystem implements Fragmentable, Registera
                // Get new instance
                $fragmenterInstance = new PackageFragmenter();
 
-               // And also a crypto instance (for our encrypted messages)
+               // Get a crypto instance and set it here
                $cryptoInstance = ObjectFactory::createObjectByConfiguredName('crypto_class');
                $fragmenterInstance->setCryptoInstance($cryptoInstance);