]> git.mxchange.org Git - hub.git/commitdiff
Moved "discovery" interfaces to sub folders, to allow generic interface 'Discoverable...
authorRoland Haeder <roland@mxchange.org>
Sat, 15 Feb 2014 11:58:58 +0000 (12:58 +0100)
committerRoland Haeder <roland@mxchange.org>
Sat, 15 Feb 2014 11:58:58 +0000 (12:58 +0100)
Signed-off-by: Roland Haeder <roland@mxchange.org>
12 files changed:
application/hub/interfaces/discovery/class_Discoverable.php [new file with mode: 0644]
application/hub/interfaces/discovery/class_DiscoverableDhtRecipient.php [deleted file]
application/hub/interfaces/discovery/class_DiscoverableNodeRecipient.php [deleted file]
application/hub/interfaces/discovery/class_DiscoverableSocket.php [deleted file]
application/hub/interfaces/discovery/dht/.htaccess [new file with mode: 0644]
application/hub/interfaces/discovery/dht/class_DiscoverableDhtRecipient.php [new file with mode: 0644]
application/hub/interfaces/discovery/node/.htaccess [new file with mode: 0644]
application/hub/interfaces/discovery/node/class_DiscoverableNodeRecipient.php [new file with mode: 0644]
application/hub/interfaces/discovery/socket/.htaccess [new file with mode: 0644]
application/hub/interfaces/discovery/socket/class_DiscoverableSocket.php [new file with mode: 0644]
application/hub/main/discovery/class_BaseHubDiscovery.php
application/hub/main/factories/package/class_NetworkPackageFactory.php

diff --git a/application/hub/interfaces/discovery/class_Discoverable.php b/application/hub/interfaces/discovery/class_Discoverable.php
new file mode 100644 (file)
index 0000000..aa582a6
--- /dev/null
@@ -0,0 +1,28 @@
+<?php
+/**
+ * An interface for socket discovery
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.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 Discoverable extends FrameworkInterface {
+}
+
+// [EOF]
+?>
diff --git a/application/hub/interfaces/discovery/class_DiscoverableDhtRecipient.php b/application/hub/interfaces/discovery/class_DiscoverableDhtRecipient.php
deleted file mode 100644 (file)
index f1c6864..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php
-/**
- * An interface for socket discovery
- *
- * @author             Roland Haeder <webmaster@shipsimu.org>
- * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core Developer Team
- * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.shipsimu.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 DiscoverableDhtRecipient extends FrameworkInterface {
-       /**
-        * Resolves one or more recipients for a DHT transfer by given package data.
-        *
-        * @param       $packageData    Valid package data array
-        * @return      $recipients             An indexed array with DHT recipients
-        */
-       function resolveRecipientsByPackageData (array $packageData);
-}
-
-// [EOF]
-?>
diff --git a/application/hub/interfaces/discovery/class_DiscoverableNodeRecipient.php b/application/hub/interfaces/discovery/class_DiscoverableNodeRecipient.php
deleted file mode 100644 (file)
index 9ec8206..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-<?php
-/**
- * An interface for recipient discovery
- *
- * @author             Roland Haeder <webmaster@shipsimu.org>
- * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core Developer Team
- * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.shipsimu.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 DiscoverableNodeRecipient extends FrameworkInterface, IteratorAggregate {
-       /**
-        * Tries to discover all recipients for given package data
-        *
-        * @param       $packageData    Raw package data array
-        * @return      void
-        */
-       function discoverRecipients (array $packageData);
-
-       /**
-        * Tries to discover all recipients by given decoded package data.
-        *
-        * @param       $decodedData    Raw raw package data array
-        * @return      void
-        */
-       function discoverRawRecipients (array $decodedData);
-
-       /**
-        * "Getter" for recipient iterator
-        *
-        * @return      $iteratorInstance       An instance of a Iterateable object
-        */
-       function getIterator ();
-
-       /**
-        * Clears all recipients for e.g. another package to deliver
-        *
-        * @return      void
-        */
-       function clearRecipients ();
-}
-
-// [EOF]
-?>
diff --git a/application/hub/interfaces/discovery/class_DiscoverableSocket.php b/application/hub/interfaces/discovery/class_DiscoverableSocket.php
deleted file mode 100644 (file)
index 8da19c5..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-<?php
-/**
- * An interface for socket discovery
- *
- * @author             Roland Haeder <webmaster@shipsimu.org>
- * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core Developer Team
- * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.shipsimu.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 DiscoverableSocket extends FrameworkInterface {
-       /**
-        * Tries to discover the right socket for given package data and returns a
-        * matching socket resource.
-        *
-        * @param       $packageData            Raw package data array
-        * @param       $connectionType         Type of connection, can be 'incoming' or 'outgoing', *NEVER* 'server'!
-        * @return      $socketResource         A valid socket resource
-        * @throws      NoListGroupException    If the procol group is not found in peer list
-        * @throws      NullPointerException    If listenerInstance is NULL
-        */
-       function discoverSocket (array $packageData, $connectionType);
-}
-
-// [EOF]
-?>
diff --git a/application/hub/interfaces/discovery/dht/.htaccess b/application/hub/interfaces/discovery/dht/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/hub/interfaces/discovery/dht/class_DiscoverableDhtRecipient.php b/application/hub/interfaces/discovery/dht/class_DiscoverableDhtRecipient.php
new file mode 100644 (file)
index 0000000..d015336
--- /dev/null
@@ -0,0 +1,35 @@
+<?php
+/**
+ * An interface for socket discovery
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.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 DiscoverableDhtRecipient extends Discoverable {
+       /**
+        * Resolves one or more recipients for a DHT transfer by given package data.
+        *
+        * @param       $packageData    Valid package data array
+        * @return      $recipients             An indexed array with DHT recipients
+        */
+       function resolveRecipientsByPackageData (array $packageData);
+}
+
+// [EOF]
+?>
diff --git a/application/hub/interfaces/discovery/node/.htaccess b/application/hub/interfaces/discovery/node/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/hub/interfaces/discovery/node/class_DiscoverableNodeRecipient.php b/application/hub/interfaces/discovery/node/class_DiscoverableNodeRecipient.php
new file mode 100644 (file)
index 0000000..2b1b7b4
--- /dev/null
@@ -0,0 +1,57 @@
+<?php
+/**
+ * An interface for recipient discovery
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.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 DiscoverableNodeRecipient extends Discoverable, IteratorAggregate {
+       /**
+        * Tries to discover all recipients for given package data
+        *
+        * @param       $packageData    Raw package data array
+        * @return      void
+        */
+       function discoverRecipients (array $packageData);
+
+       /**
+        * Tries to discover all recipients by given decoded package data.
+        *
+        * @param       $decodedData    Raw raw package data array
+        * @return      void
+        */
+       function discoverRawRecipients (array $decodedData);
+
+       /**
+        * "Getter" for recipient iterator
+        *
+        * @return      $iteratorInstance       An instance of a Iterateable object
+        */
+       function getIterator ();
+
+       /**
+        * Clears all recipients for e.g. another package to deliver
+        *
+        * @return      void
+        */
+       function clearRecipients ();
+}
+
+// [EOF]
+?>
diff --git a/application/hub/interfaces/discovery/socket/.htaccess b/application/hub/interfaces/discovery/socket/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/hub/interfaces/discovery/socket/class_DiscoverableSocket.php b/application/hub/interfaces/discovery/socket/class_DiscoverableSocket.php
new file mode 100644 (file)
index 0000000..332bf1e
--- /dev/null
@@ -0,0 +1,39 @@
+<?php
+/**
+ * An interface for socket discovery
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.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 DiscoverableSocket extends Discoverable {
+       /**
+        * Tries to discover the right socket for given package data and returns a
+        * matching socket resource.
+        *
+        * @param       $packageData            Raw package data array
+        * @param       $connectionType         Type of connection, can be 'incoming' or 'outgoing', *NEVER* 'server'!
+        * @return      $socketResource         A valid socket resource
+        * @throws      NoListGroupException    If the procol group is not found in peer list
+        * @throws      NullPointerException    If listenerInstance is NULL
+        */
+       function discoverSocket (array $packageData, $connectionType);
+}
+
+// [EOF]
+?>
index e9efd02427c32eea9751f85f84997e8d72fb3b85..90b53869a4ff7d30099b795b7e3f0d1317289a5b 100644 (file)
@@ -21,7 +21,7 @@
  * 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 BaseHubDiscovery extends BaseDiscovery {
+class BaseHubDiscovery extends BaseDiscovery implements Discoverable {
        /**
         * Protected constructor
         *
index 7c195d74fe380b4090d03e21849fa99b34ef7cf9..8fbaa246bcb50c7862e252c0228e4b3575e6c3a2 100644 (file)
@@ -48,7 +48,7 @@ class NetworkPackageFactory extends ObjectFactory {
                        /*
                         * Prepare the compressor for our package, ZLIB should be fine but we
                         * keep it open here so you can experiment with the settings and don't
-                        * need to touch any code.
+                        * need to touch this code.
                         */
                        $compressorInstance = self::createObjectByConfiguredName('raw_package_compressor_class');