From: Roland Haeder Date: Sat, 15 Feb 2014 11:58:58 +0000 (+0100) Subject: Moved "discovery" interfaces to sub folders, to allow generic interface 'Discoverable... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=139a03a9ca952758bb14c840467c8c45a9b34d64;p=hub.git Moved "discovery" interfaces to sub folders, to allow generic interface 'Discoverable' being added. Signed-off-by: Roland Haeder --- diff --git a/application/hub/interfaces/discovery/class_Discoverable.php b/application/hub/interfaces/discovery/class_Discoverable.php new file mode 100644 index 000000000..aa582a616 --- /dev/null +++ b/application/hub/interfaces/discovery/class_Discoverable.php @@ -0,0 +1,28 @@ + + * @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 . + */ +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 index f1c686441..000000000 --- a/application/hub/interfaces/discovery/class_DiscoverableDhtRecipient.php +++ /dev/null @@ -1,35 +0,0 @@ - - * @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 . - */ -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 index 9ec820615..000000000 --- a/application/hub/interfaces/discovery/class_DiscoverableNodeRecipient.php +++ /dev/null @@ -1,57 +0,0 @@ - - * @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 . - */ -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 index 8da19c551..000000000 --- a/application/hub/interfaces/discovery/class_DiscoverableSocket.php +++ /dev/null @@ -1,39 +0,0 @@ - - * @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 . - */ -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 index 000000000..3a4288278 --- /dev/null +++ b/application/hub/interfaces/discovery/dht/.htaccess @@ -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 index 000000000..d0153361a --- /dev/null +++ b/application/hub/interfaces/discovery/dht/class_DiscoverableDhtRecipient.php @@ -0,0 +1,35 @@ + + * @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 . + */ +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 index 000000000..3a4288278 --- /dev/null +++ b/application/hub/interfaces/discovery/node/.htaccess @@ -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 index 000000000..2b1b7b443 --- /dev/null +++ b/application/hub/interfaces/discovery/node/class_DiscoverableNodeRecipient.php @@ -0,0 +1,57 @@ + + * @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 . + */ +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 index 000000000..3a4288278 --- /dev/null +++ b/application/hub/interfaces/discovery/socket/.htaccess @@ -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 index 000000000..332bf1ebb --- /dev/null +++ b/application/hub/interfaces/discovery/socket/class_DiscoverableSocket.php @@ -0,0 +1,39 @@ + + * @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 . + */ +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] +?> diff --git a/application/hub/main/discovery/class_BaseHubDiscovery.php b/application/hub/main/discovery/class_BaseHubDiscovery.php index e9efd0242..90b53869a 100644 --- a/application/hub/main/discovery/class_BaseHubDiscovery.php +++ b/application/hub/main/discovery/class_BaseHubDiscovery.php @@ -21,7 +21,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class BaseHubDiscovery extends BaseDiscovery { +class BaseHubDiscovery extends BaseDiscovery implements Discoverable { /** * Protected constructor * diff --git a/application/hub/main/factories/package/class_NetworkPackageFactory.php b/application/hub/main/factories/package/class_NetworkPackageFactory.php index 7c195d74f..8fbaa246b 100644 --- a/application/hub/main/factories/package/class_NetworkPackageFactory.php +++ b/application/hub/main/factories/package/class_NetworkPackageFactory.php @@ -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');