From 01c1eee4daca999fb09fb116c19efd589cf0cba8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sat, 5 Mar 2011 15:43:19 +0000 Subject: [PATCH 1/1] A lot files renamed (sorry guys for the mess) and moved to sub directories --- .gitattributes | 26 ++++ application/hub/config.php | 52 ++++---- .../hub/interfaces/nodes/class_NodeHelper.php | 9 +- .../class_HubConsoleCruncherCommand.php | 6 +- .../console/class_HubConsoleMainCommand.php | 22 ++-- application/hub/main/cruncher/class_ | 3 + .../main/cruncher/class_BaseHubCruncher.php | 24 ++++ .../mcrypt/class_HubMcryptCruncher.php | 14 ++- .../filter/activation/class_HubActivation | 65 +--------- ...ss_HubActivationSelfAnnouncementFilter.php | 68 +---------- .../hub/main/filter/activation/node/.htaccess | 1 + .../activation/node/class_NodeActivation | 66 +++++++++++ ...s_NodeActivationSelfAnnouncementFilter.php | 69 +++++++++++ .../main/filter/bootstrap/class_HubBootstrap | 65 +--------- ...s_HubBootstrapExtraBootstrappingFilter.php | 65 +--------- .../class_HubBootstrapGenerateHubIdFilter.php | 69 +---------- ...ss_HubBootstrapGenerateSessionIdFilter.php | 67 +---------- .../class_HubBootstrapInitQueuesFilter.php | 65 +--------- .../class_HubBootstrapListenerPoolFilter.php | 65 +--------- ...lass_HubBootstrapRestoreNodeListFilter.php | 65 +--------- .../main/filter/bootstrap/cruncher/.htaccess | 1 + .../cruncher/class_CruncherBootstrap | 66 +++++++++++ ...ncherBootstrapExtraBootstrappingFilter.php | 66 +++++++++++ .../hub/main/filter/bootstrap/node/.htaccess | 1 + .../filter/bootstrap/node/class_NodeBootstrap | 66 +++++++++++ ..._NodeBootstrapExtraBootstrappingFilter.php | 66 +++++++++++ ...lass_NodeBootstrapGenerateNodeIdFilter.php | 70 +++++++++++ ...s_NodeBootstrapGenerateSessionIdFilter.php | 68 +++++++++++ .../class_NodeBootstrapInitQueuesFilter.php | 66 +++++++++++ .../class_NodeBootstrapListenerPoolFilter.php | 66 +++++++++++ ...ass_NodeBootstrapRestoreNodeListFilter.php | 66 +++++++++++ .../main/filter/shutdown/class_HubShutdown | 66 +---------- .../class_HubShutdownCruncherFilter.php | 67 +---------- .../class_HubShutdownDeinitQueuesFilter.php | 75 +----------- .../class_HubShutdownFlushNodeListFilter.php | 66 +---------- .../shutdown/class_HubShutdownNodeFilter.php | 67 +---------- .../class_HubShutdownTaskHandlerFilter.php | 66 +---------- .../main/filter/shutdown/cruncher/.htaccess | 1 + .../class_CruncherShutdownCruncherFilter.php | 68 +++++++++++ .../hub/main/filter/shutdown/node/.htaccess | 1 + .../filter/shutdown/node/class_NodeShutdown | 67 +++++++++++ .../class_NodeShutdownDeinitQueuesFilter.php | 76 ++++++++++++ .../class_NodeShutdownFlushNodeListFilter.php | 67 +++++++++++ .../node/class_NodeShutdownNodeFilter.php | 68 +++++++++++ .../class_NodeShutdownTaskHandlerFilter.php | 67 +++++++++++ ...s_CruncherTaskHandlerInitializerFilter.php | 69 +---------- .../class_HubTaskHandlerInitializerFilter.php | 111 +---------------- .../hub/main/filter/task/cruncher/.htaccess | 1 + ...s_CruncherTaskHandlerInitializerFilter.php | 70 +++++++++++ .../hub/main/filter/task/node/.htaccess | 1 + ...class_NodeTaskHandlerInitializerFilter.php | 112 ++++++++++++++++++ .../hub/main/nodes/class_BaseHubNode.php | 4 +- .../hub/main/nodes/list/class_HubListNode.php | 2 +- .../main/nodes/master/class_HubMasterNode.php | 2 +- .../nodes/regular/class_HubRegularNode.php | 2 +- 55 files changed, 1466 insertions(+), 1218 deletions(-) create mode 100644 application/hub/main/filter/activation/node/.htaccess create mode 100644 application/hub/main/filter/activation/node/class_NodeActivation create mode 100644 application/hub/main/filter/activation/node/class_NodeActivationSelfAnnouncementFilter.php create mode 100644 application/hub/main/filter/bootstrap/cruncher/.htaccess create mode 100644 application/hub/main/filter/bootstrap/cruncher/class_CruncherBootstrap create mode 100644 application/hub/main/filter/bootstrap/cruncher/class_CruncherBootstrapExtraBootstrappingFilter.php create mode 100644 application/hub/main/filter/bootstrap/node/.htaccess create mode 100644 application/hub/main/filter/bootstrap/node/class_NodeBootstrap create mode 100644 application/hub/main/filter/bootstrap/node/class_NodeBootstrapExtraBootstrappingFilter.php create mode 100644 application/hub/main/filter/bootstrap/node/class_NodeBootstrapGenerateNodeIdFilter.php create mode 100644 application/hub/main/filter/bootstrap/node/class_NodeBootstrapGenerateSessionIdFilter.php create mode 100644 application/hub/main/filter/bootstrap/node/class_NodeBootstrapInitQueuesFilter.php create mode 100644 application/hub/main/filter/bootstrap/node/class_NodeBootstrapListenerPoolFilter.php create mode 100644 application/hub/main/filter/bootstrap/node/class_NodeBootstrapRestoreNodeListFilter.php create mode 100644 application/hub/main/filter/shutdown/cruncher/.htaccess create mode 100644 application/hub/main/filter/shutdown/cruncher/class_CruncherShutdownCruncherFilter.php create mode 100644 application/hub/main/filter/shutdown/node/.htaccess create mode 100644 application/hub/main/filter/shutdown/node/class_NodeShutdown create mode 100644 application/hub/main/filter/shutdown/node/class_NodeShutdownDeinitQueuesFilter.php create mode 100644 application/hub/main/filter/shutdown/node/class_NodeShutdownFlushNodeListFilter.php create mode 100644 application/hub/main/filter/shutdown/node/class_NodeShutdownNodeFilter.php create mode 100644 application/hub/main/filter/shutdown/node/class_NodeShutdownTaskHandlerFilter.php create mode 100644 application/hub/main/filter/task/cruncher/.htaccess create mode 100644 application/hub/main/filter/task/cruncher/class_CruncherTaskHandlerInitializerFilter.php create mode 100644 application/hub/main/filter/task/node/.htaccess create mode 100644 application/hub/main/filter/task/node/class_NodeTaskHandlerInitializerFilter.php diff --git a/.gitattributes b/.gitattributes index 4abaa43f4..5847ecfbb 100644 --- a/.gitattributes +++ b/.gitattributes @@ -176,6 +176,9 @@ application/hub/main/filter/.htaccess -text svneol=unset#text/plain application/hub/main/filter/activation/.htaccess -text svneol=unset#text/plain application/hub/main/filter/activation/class_HubActivation -text application/hub/main/filter/activation/class_HubActivationSelfAnnouncementFilter.php -text svneol=unset#text/plain +application/hub/main/filter/activation/node/.htaccess svneol=native#text/plain +application/hub/main/filter/activation/node/class_NodeActivation -text +application/hub/main/filter/activation/node/class_NodeActivationSelfAnnouncementFilter.php svneol=native#text/plain application/hub/main/filter/bootstrap/.htaccess -text svneol=unset#text/plain application/hub/main/filter/bootstrap/class_HubBootstrap -text application/hub/main/filter/bootstrap/class_HubBootstrapAquireHubIdFilter.php -text svneol=unset#text/plain @@ -186,6 +189,17 @@ application/hub/main/filter/bootstrap/class_HubBootstrapGenerateSessionIdFilter. application/hub/main/filter/bootstrap/class_HubBootstrapInitQueuesFilter.php -text svneol=unset#text/plain application/hub/main/filter/bootstrap/class_HubBootstrapListenerPoolFilter.php -text svneol=unset#text/plain application/hub/main/filter/bootstrap/class_HubBootstrapRestoreNodeListFilter.php -text svneol=unset#text/plain +application/hub/main/filter/bootstrap/cruncher/.htaccess svneol=native#text/plain +application/hub/main/filter/bootstrap/cruncher/class_CruncherBootstrap -text +application/hub/main/filter/bootstrap/cruncher/class_CruncherBootstrapExtraBootstrappingFilter.php svneol=native#text/plain +application/hub/main/filter/bootstrap/node/.htaccess svneol=native#text/plain +application/hub/main/filter/bootstrap/node/class_NodeBootstrap -text +application/hub/main/filter/bootstrap/node/class_NodeBootstrapExtraBootstrappingFilter.php svneol=native#text/plain +application/hub/main/filter/bootstrap/node/class_NodeBootstrapGenerateNodeIdFilter.php svneol=native#text/plain +application/hub/main/filter/bootstrap/node/class_NodeBootstrapGenerateSessionIdFilter.php svneol=native#text/plain +application/hub/main/filter/bootstrap/node/class_NodeBootstrapInitQueuesFilter.php svneol=native#text/plain +application/hub/main/filter/bootstrap/node/class_NodeBootstrapListenerPoolFilter.php svneol=native#text/plain +application/hub/main/filter/bootstrap/node/class_NodeBootstrapRestoreNodeListFilter.php svneol=native#text/plain application/hub/main/filter/class_ -text svneol=unset#text/plain application/hub/main/filter/console/.htaccess -text svneol=unset#text/plain application/hub/main/filter/console/class_Console -text @@ -208,10 +222,22 @@ application/hub/main/filter/shutdown/class_HubShutdownFlushNodeListFilter.php -t application/hub/main/filter/shutdown/class_HubShutdownListenerPoolFilter.php -text svneol=unset#text/plain application/hub/main/filter/shutdown/class_HubShutdownNodeFilter.php -text svneol=unset#text/plain application/hub/main/filter/shutdown/class_HubShutdownTaskHandlerFilter.php -text svneol=unset#text/plain +application/hub/main/filter/shutdown/cruncher/.htaccess svneol=native#text/plain +application/hub/main/filter/shutdown/cruncher/class_CruncherShutdownCruncherFilter.php svneol=native#text/plain +application/hub/main/filter/shutdown/node/.htaccess svneol=native#text/plain +application/hub/main/filter/shutdown/node/class_NodeShutdown -text +application/hub/main/filter/shutdown/node/class_NodeShutdownDeinitQueuesFilter.php svneol=native#text/plain +application/hub/main/filter/shutdown/node/class_NodeShutdownFlushNodeListFilter.php svneol=native#text/plain +application/hub/main/filter/shutdown/node/class_NodeShutdownNodeFilter.php svneol=native#text/plain +application/hub/main/filter/shutdown/node/class_NodeShutdownTaskHandlerFilter.php svneol=native#text/plain application/hub/main/filter/task/.htaccess -text svneol=unset#text/plain application/hub/main/filter/task/class_CruncherTaskHandlerInitializerFilter.php svneol=native#text/plain application/hub/main/filter/task/class_HubTaskHandlerInitializerFilter.php -text svneol=unset#text/plain application/hub/main/filter/task/class_TaskHandlerInitializerFilter.php -text svneol=unset#text/plain +application/hub/main/filter/task/cruncher/.htaccess svneol=native#text/plain +application/hub/main/filter/task/cruncher/class_CruncherTaskHandlerInitializerFilter.php svneol=native#text/plain +application/hub/main/filter/task/node/.htaccess svneol=native#text/plain +application/hub/main/filter/task/node/class_NodeTaskHandlerInitializerFilter.php svneol=native#text/plain application/hub/main/handler/.htaccess -text svneol=unset#text/plain application/hub/main/handler/class_ -text svneol=unset#text/plain application/hub/main/handler/class_BaseHandler.php -text svneol=unset#text/plain diff --git a/application/hub/config.php b/application/hub/config.php index c18e59d03..89d2adfec 100644 --- a/application/hub/config.php +++ b/application/hub/config.php @@ -165,14 +165,14 @@ $cfg->setConfigEntry('node_initializer_filter', 'NodeInitializationFilter'); // CFG: CRUNCHER-INITIALIZER-FILTER $cfg->setConfigEntry('cruncher_initializer_filter', 'CruncherInitializationFilter'); -// CFG: HUB-ACTIVATION-TASK-HANDLER-INITIALIZER-FILTER -$cfg->setConfigEntry('hub_activation_task_handler_initializer_filter', 'HubTaskHandlerInitializerFilter'); +// CFG: NODE-ACTIVATION-TASK-HANDLER-INITIALIZER-FILTER +$cfg->setConfigEntry('node_activation_task_handler_initializer_filter', 'NodeTaskHandlerInitializerFilter'); // CFG: CRUNCHER-BOOTSTRAP-TASK-HANDLER-INITIALIZER-FILTER $cfg->setConfigEntry('cruncher_bootstrap_task_handler_initializer_filter', 'CruncherTaskHandlerInitializerFilter'); -// CFG: HUB-ACTIVATION-SELF-ANNOUNCEMENT-TASK-FILTER -$cfg->setConfigEntry('hub_activation_self_announcement_task_filter', 'HubActivationSelfAnnouncementFilter'); +// CFG: NODE-ACTIVATION-SELF-ANNOUNCEMENT-TASK-FILTER +$cfg->setConfigEntry('node_activation_self_announcement_task_filter', 'NodeActivationSelfAnnouncementFilter'); // CFG: NODE-WELCOME-TEASER-FILTER $cfg->setConfigEntry('node_welcome_teaser_filter', 'NodeWelcomeTeaserFilter'); @@ -180,38 +180,38 @@ $cfg->setConfigEntry('node_welcome_teaser_filter', 'NodeWelcomeTeaserFilter'); // CFG: CRUNCHER-WELCOME-TEASER-FILTER $cfg->setConfigEntry('cruncher_welcome_teaser_filter', 'CruncherWelcomeTeaserFilter'); -// CFG: HUB-BOOTSTRAP-GENERATE-HUBID-FILTER -$cfg->setConfigEntry('hub_bootstrap_generate_hubid_filter', 'HubBootstrapGenerateHubIdFilter'); +// CFG: NODE-BOOTSTRAP-GENERATE-HUBID-FILTER +$cfg->setConfigEntry('node_bootstrap_generate_nodeid_filter', 'NodeBootstrapGenerateNodeIdFilter'); -// CFG: HUB-BOOTSTRAP-GENERATE-SESSIONID-FILTER -$cfg->setConfigEntry('hub_bootstrap_generate_sessionid_filter', 'HubBootstrapGenerateSessionIdFilter'); +// CFG: NODE-BOOTSTRAP-GENERATE-SESSIONID-FILTER +$cfg->setConfigEntry('node_bootstrap_generate_sessionid_filter', 'NodeBootstrapGenerateSessionIdFilter'); -// CFG: HUB-BOOTSTRAP-RESTORE-NODELIST-FILTER -$cfg->setConfigEntry('hub_bootstrap_restore_nodelist_filter', 'HubBootstrapRestoreNodeListFilter'); +// CFG: NODE-BOOTSTRAP-RESTORE-NODELIST-FILTER +$cfg->setConfigEntry('node_bootstrap_restore_nodelist_filter', 'NodeBootstrapRestoreNodeListFilter'); -// CFG: HUB-BOOTSTRAP-INIT-QUEUES-FILTER -$cfg->setConfigEntry('hub_bootstrap_init_queues_filter', 'HubBootstrapInitQueuesFilter'); +// CFG: NODE-BOOTSTRAP-INIT-QUEUES-FILTER +$cfg->setConfigEntry('node_bootstrap_init_queues_filter', 'NodeBootstrapInitQueuesFilter'); -// CFG: HUB-BOOTSTRAP-EXTRA-BOOTSTRAP-FILTER -$cfg->setConfigEntry('hub_bootstrap_extra_bootstrap_filter', 'HubBootstrapExtraBootstrappingFilter'); +// CFG: NODE-BOOTSTRAP-EXTRA-BOOTSTRAP-FILTER +$cfg->setConfigEntry('node_bootstrap_extra_bootstrap_filter', 'NodeBootstrapExtraBootstrappingFilter'); -// CFG: HUB-BOOTSTRAP-LISTENER-POOL-FILTER -$cfg->setConfigEntry('hub_bootstrap_listener_pool_filter', 'HubBootstrapListenerPoolFilter'); +// CFG: NODE-BOOTSTRAP-LISTENER-POOL-FILTER +$cfg->setConfigEntry('node_bootstrap_listener_pool_filter', 'NodeBootstrapListenerPoolFilter'); -// CFG: HUB-SHUTDOWN-FLUSH-NODE-LIST-FILTER -$cfg->setConfigEntry('hub_shutdown_flush_node_list_filter', 'HubShutdownFlushNodeListFilter'); +// CFG: NODE-SHUTDOWN-FLUSH-NODE-LIST-FILTER +$cfg->setConfigEntry('node_shutdown_flush_node_list_filter', 'NodeShutdownFlushNodeListFilter'); -// CFG: HUB-SHUTDOWN-DEINIT-QUEUES-FILTER -$cfg->setConfigEntry('hub_shutdown_deinit_queues_filter', 'HubShutdownDeinitQueuesFilter'); +// CFG: NODE-SHUTDOWN-DEINIT-QUEUES-FILTER +$cfg->setConfigEntry('node_shutdown_deinit_queues_filter', 'NodeShutdownDeinitQueuesFilter'); -// CFG: HUB-SHUTDOWN-TASK-HANDLER-FILTER -$cfg->setConfigEntry('hub_shutdown_task_handler_filter', 'HubShutdownTaskHandlerFilter'); +// CFG: NODE-SHUTDOWN-TASK-HANDLER-FILTER +$cfg->setConfigEntry('node_shutdown_task_handler_filter', 'NodeShutdownTaskHandlerFilter'); -// CFG: HUB-SHUTDOWN-NODE-FILTER -$cfg->setConfigEntry('hub_shutdown_node_filter', 'HubShutdownNodeFilter'); +// CFG: NODE-SHUTDOWN-NODE-FILTER +$cfg->setConfigEntry('node_shutdown_node_filter', 'NodeShutdownNodeFilter'); -// CFG: HUB-SHUTDOWN-CRUNCHER-FILTER -$cfg->setConfigEntry('hub_shutdown_cruncher_filter', 'HubShutdownCruncherFilter'); +// CFG: CRUNCHER-SHUTDOWN-CRUNCHER-FILTER +$cfg->setConfigEntry('cruncher_shutdown_cruncher_filter', 'CruncherShutdownCruncherFilter'); // CFG: NEWS-READER-CLASS $cfg->setConfigEntry('news_reader_class', 'ConsoleNewsReader'); diff --git a/application/hub/interfaces/nodes/class_NodeHelper.php b/application/hub/interfaces/nodes/class_NodeHelper.php index 6480248ae..dc96ab30a 100644 --- a/application/hub/interfaces/nodes/class_NodeHelper.php +++ b/application/hub/interfaces/nodes/class_NodeHelper.php @@ -63,7 +63,7 @@ interface NodeHelper extends FrameworkInterface { * @param $responseInstance A Responseable class * @return void */ - function bootstrapAcquireHubId (Requestable $requestInstance, Responseable $responseInstance); + function bootstrapAcquireNodeId (Requestable $requestInstance, Responseable $responseInstance); /** * Activates the hub by doing some final preparation and setting @@ -96,13 +96,6 @@ interface NodeHelper extends FrameworkInterface { */ function bootstrapRestoreNodeList (); - /** - * Add some node-specific filters - * - * @return void - */ - function addExtraNodeFilters (); - /** * Announces this hub to the upper (bootstrap or list) hubs. After this is * successfully done the given task is unregistered from the handler. diff --git a/application/hub/main/commands/console/class_HubConsoleCruncherCommand.php b/application/hub/main/commands/console/class_HubConsoleCruncherCommand.php index 71679c920..21743bd64 100644 --- a/application/hub/main/commands/console/class_HubConsoleCruncherCommand.php +++ b/application/hub/main/commands/console/class_HubConsoleCruncherCommand.php @@ -110,13 +110,13 @@ class HubConsoleCruncherCommand extends BaseCommand implements Commandable { // Add bootstrap filters $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('cruncher_bootstrap_task_handler_initializer_filter')); - //$controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('hub_bootstrap_generate_hubid_filter')); + //$controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('cruncher_bootstrap_generate_nodeid_filter')); // Add shutdown filters - //$controllerInstance->addShutdownFilter(ObjectFactory::createObjectByConfiguredName('hub_shutdown_task_handler_filter')); + //$controllerInstance->addShutdownFilter(ObjectFactory::createObjectByConfiguredName('cruncher_shutdown_task_handler_filter')); // This is the last generic filter - $controllerInstance->addShutdownFilter(ObjectFactory::createObjectByConfiguredName('hub_shutdown_cruncher_filter')); + $controllerInstance->addShutdownFilter(ObjectFactory::createObjectByConfiguredName('cruncher_shutdown_cruncher_filter')); } } diff --git a/application/hub/main/commands/console/class_HubConsoleMainCommand.php b/application/hub/main/commands/console/class_HubConsoleMainCommand.php index 85a82af78..e9140aa8b 100644 --- a/application/hub/main/commands/console/class_HubConsoleMainCommand.php +++ b/application/hub/main/commands/console/class_HubConsoleMainCommand.php @@ -114,23 +114,23 @@ class HubConsoleMainCommand extends BaseCommand implements Commandable { $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('node_welcome_teaser_filter')); // Add bootstrap filters - $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('hub_bootstrap_generate_hubid_filter')); - $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('hub_bootstrap_generate_sessionid_filter')); - $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('hub_bootstrap_restore_nodelist_filter')); - $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('hub_bootstrap_init_queues_filter')); - $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('hub_bootstrap_extra_bootstrap_filter')); - $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('hub_bootstrap_listener_pool_filter')); + $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('node_bootstrap_generate_nodeid_filter')); + $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('node_bootstrap_generate_sessionid_filter')); + $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('node_bootstrap_restore_nodelist_filter')); + $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('node_bootstrap_init_queues_filter')); + $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('node_bootstrap_extra_bootstrap_filter')); + $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('node_bootstrap_listener_pool_filter')); // Add hub activation filters - $controllerInstance->addActivationFilter(ObjectFactory::createObjectByConfiguredName('hub_activation_task_handler_initializer_filter')); + $controllerInstance->addActivationFilter(ObjectFactory::createObjectByConfiguredName('node_activation_task_handler_initializer_filter')); // Add shutdown filters - $controllerInstance->addShutdownFilter(ObjectFactory::createObjectByConfiguredName('hub_shutdown_flush_node_list_filter')); - $controllerInstance->addShutdownFilter(ObjectFactory::createObjectByConfiguredName('hub_shutdown_deinit_queues_filter')); - $controllerInstance->addShutdownFilter(ObjectFactory::createObjectByConfiguredName('hub_shutdown_task_handler_filter')); + $controllerInstance->addShutdownFilter(ObjectFactory::createObjectByConfiguredName('node_shutdown_flush_node_list_filter')); + $controllerInstance->addShutdownFilter(ObjectFactory::createObjectByConfiguredName('node_shutdown_deinit_queues_filter')); + $controllerInstance->addShutdownFilter(ObjectFactory::createObjectByConfiguredName('node_shutdown_task_handler_filter')); // This is the last generic filter - $controllerInstance->addShutdownFilter(ObjectFactory::createObjectByConfiguredName('hub_shutdown_node_filter')); + $controllerInstance->addShutdownFilter(ObjectFactory::createObjectByConfiguredName('node_shutdown_node_filter')); } } diff --git a/application/hub/main/cruncher/class_ b/application/hub/main/cruncher/class_ index a9946b1df..c08a53e30 100644 --- a/application/hub/main/cruncher/class_ +++ b/application/hub/main/cruncher/class_ @@ -30,6 +30,9 @@ class Hub???Cruncher extends BaseHubCruncher implements CruncherHelper, Register protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); + + // Set version number + $this->setVersion('x.x'); } /** diff --git a/application/hub/main/cruncher/class_BaseHubCruncher.php b/application/hub/main/cruncher/class_BaseHubCruncher.php index f552a19aa..60ef0cb34 100644 --- a/application/hub/main/cruncher/class_BaseHubCruncher.php +++ b/application/hub/main/cruncher/class_BaseHubCruncher.php @@ -22,6 +22,11 @@ * along with this program. If not, see . */ class BaseHubCruncher extends BaseHubSystem implements Updateable { + /** + * Version information + */ + private $version = 'x.x'; + /** * Protected constructor * @@ -33,6 +38,25 @@ class BaseHubCruncher extends BaseHubSystem implements Updateable { parent::__construct($className); } + /** + * Getter for version + * + * @return $version Version number of this cruncher + */ + protected final function getVersion () { + return $this->version; + } + + /** + * Setter for version + * + * @param $version Version number of this cruncher + * @return void + */ + protected final function setVersion ($version) { + $this->version = (string) $version; + } + /** * Updates a given field with new value * diff --git a/application/hub/main/cruncher/mcrypt/class_HubMcryptCruncher.php b/application/hub/main/cruncher/mcrypt/class_HubMcryptCruncher.php index c0f7ac8eb..d23236d86 100644 --- a/application/hub/main/cruncher/mcrypt/class_HubMcryptCruncher.php +++ b/application/hub/main/cruncher/mcrypt/class_HubMcryptCruncher.php @@ -30,6 +30,9 @@ class HubMcryptCruncher extends BaseHubCruncher implements CruncherHelper, Regis protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); + + // Set version number + $this->setVersion('0.0.0'); } /** @@ -70,13 +73,22 @@ class HubMcryptCruncher extends BaseHubCruncher implements CruncherHelper, Regis * @return void */ public function outputConsoleTeaser () { - $this->partialStub('Please implement this method.'); + // Output all lines + $this->debugOutput(' '); + $this->debugOutput('MCrypt Cruncher v' . $this->getVersion() . ' is starting ...'); + $this->debugOutput('Copyright (c) 2007 - 2008 Roland Haeder, 2009 - 2011 Hub Developer Team'); + $this->debugOutput(' '); + $this->debugOutput('This program comes with ABSOLUTELY NO WARRANTY; for details see docs/COPYING.'); + $this->debugOutput('This is free software, and you are welcome to redistribute it under certain'); + $this->debugOutput('conditions; see docs/COPYING for details.'); + $this->debugOutput(' '); } /** * Add some cruncher-specific filters * * @return void + * @todo 0% done */ public function addExtraCruncherFilters () { // Add some filters here diff --git a/application/hub/main/filter/activation/class_HubActivation b/application/hub/main/filter/activation/class_HubActivation index 518730959..f551ef47b 100644 --- a/application/hub/main/filter/activation/class_HubActivation +++ b/application/hub/main/filter/activation/class_HubActivation @@ -1,66 +1,3 @@ - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 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 . - */ -class HubActivation???Filter extends BaseFilter implements Filterable { - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this filter class - * - * @return $filterInstance An instance of this filter class - */ - public final static function createHubActivation???Filter () { - // Get a new instance - $filterInstance = new HubActivation???Filter(); - - // Return the instance - return $filterInstance; - } - - /** - * Executes the filter with given request and response objects - * - * @param $requestInstance An instance of a class with an Requestable interface - * @param $responseInstance An instance of a class with an Responseable interface - * @return void - * @todo 0% done - */ - public function execute (Requestable $requestInstance, Responseable $responseInstance) { - // Get node instance - $nodeInstance = Registry::getRegistry()->getInstance('node'); - - // Now do something - $this->partialStub('Please implement this step.'); - } -} - -// [EOF] +// @DEPRECATED ?> diff --git a/application/hub/main/filter/activation/class_HubActivationSelfAnnouncementFilter.php b/application/hub/main/filter/activation/class_HubActivationSelfAnnouncementFilter.php index 4b701ec49..f551ef47b 100644 --- a/application/hub/main/filter/activation/class_HubActivationSelfAnnouncementFilter.php +++ b/application/hub/main/filter/activation/class_HubActivationSelfAnnouncementFilter.php @@ -1,69 +1,3 @@ - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 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 . - */ -class HubActivationSelfAnnouncementFilter extends BaseFilter implements Filterable { - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this filter class - * - * @return $filterInstance An instance of this filter class - */ - public static final function createHubActivationSelfAnnouncementFilter () { - // Get a new instance - $filterInstance = new HubActivationSelfAnnouncementFilter(); - - // Return the instance - return $filterInstance; - } - - /** - * Executes the filter with given request and response objects - * - * @param $requestInstance An instance of a class with an Requestable interface - * @param $responseInstance An instance of a class with an Responseable interface - * @return void - * @todo 0% done - */ - public function execute (Requestable $requestInstance, Responseable $responseInstance) { - // Get task handler instance - $handlerInstance = Registry::getRegistry()->getInstance('task'); - - // Prepare a self-test task for the listeners - $taskInstance = ObjectFactory::createObjectByConfiguredName('hub_self_announcement_task_class'); - - // Register it - $handlerInstance->registerTask('self_announcement', $taskInstance); - } -} - -// [EOF] +// @DEPRECATED ?> diff --git a/application/hub/main/filter/activation/node/.htaccess b/application/hub/main/filter/activation/node/.htaccess new file mode 100644 index 000000000..3a4288278 --- /dev/null +++ b/application/hub/main/filter/activation/node/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/hub/main/filter/activation/node/class_NodeActivation b/application/hub/main/filter/activation/node/class_NodeActivation new file mode 100644 index 000000000..518730959 --- /dev/null +++ b/application/hub/main/filter/activation/node/class_NodeActivation @@ -0,0 +1,66 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 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 . + */ +class HubActivation???Filter extends BaseFilter implements Filterable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this filter class + * + * @return $filterInstance An instance of this filter class + */ + public final static function createHubActivation???Filter () { + // Get a new instance + $filterInstance = new HubActivation???Filter(); + + // Return the instance + return $filterInstance; + } + + /** + * Executes the filter with given request and response objects + * + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface + * @return void + * @todo 0% done + */ + public function execute (Requestable $requestInstance, Responseable $responseInstance) { + // Get node instance + $nodeInstance = Registry::getRegistry()->getInstance('node'); + + // Now do something + $this->partialStub('Please implement this step.'); + } +} + +// [EOF] +?> diff --git a/application/hub/main/filter/activation/node/class_NodeActivationSelfAnnouncementFilter.php b/application/hub/main/filter/activation/node/class_NodeActivationSelfAnnouncementFilter.php new file mode 100644 index 000000000..a5e664c23 --- /dev/null +++ b/application/hub/main/filter/activation/node/class_NodeActivationSelfAnnouncementFilter.php @@ -0,0 +1,69 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 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 . + */ +class NodeActivationSelfAnnouncementFilter extends BaseFilter implements Filterable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this filter class + * + * @return $filterInstance An instance of this filter class + */ + public static final function createNodeActivationSelfAnnouncementFilter () { + // Get a new instance + $filterInstance = new NodeActivationSelfAnnouncementFilter(); + + // Return the instance + return $filterInstance; + } + + /** + * Executes the filter with given request and response objects + * + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface + * @return void + * @todo 0% done + */ + public function execute (Requestable $requestInstance, Responseable $responseInstance) { + // Get task handler instance + $handlerInstance = Registry::getRegistry()->getInstance('task'); + + // Prepare a self-test task for the listeners + $taskInstance = ObjectFactory::createObjectByConfiguredName('hub_self_announcement_task_class'); + + // Register it + $handlerInstance->registerTask('self_announcement', $taskInstance); + } +} + +// [EOF] +?> diff --git a/application/hub/main/filter/bootstrap/class_HubBootstrap b/application/hub/main/filter/bootstrap/class_HubBootstrap index 4919c6bc1..f551ef47b 100644 --- a/application/hub/main/filter/bootstrap/class_HubBootstrap +++ b/application/hub/main/filter/bootstrap/class_HubBootstrap @@ -1,66 +1,3 @@ - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 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 . - */ -class HubBootstrap???Filter extends BaseFilter implements Filterable { - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this filter class - * - * @return $filterInstance An instance of this filter class - */ - public final static function createHubBootstrap???Filter () { - // Get a new instance - $filterInstance = new HubBootstrap???Filter(); - - // Return the instance - return $filterInstance; - } - - /** - * Executes the filter with given request and response objects - * - * @param $requestInstance An instance of a class with an Requestable interface - * @param $responseInstance An instance of a class with an Responseable interface - * @return void - * @todo 0% done - */ - public function execute (Requestable $requestInstance, Responseable $responseInstance) { - // Get node instance - $nodeInstance = Registry::getRegistry()->getInstance('node'); - - // Now do something - $this->partialStub('Please implement this step.'); - } -} - -// [EOF] +// @DEPRECATED ?> diff --git a/application/hub/main/filter/bootstrap/class_HubBootstrapExtraBootstrappingFilter.php b/application/hub/main/filter/bootstrap/class_HubBootstrapExtraBootstrappingFilter.php index 306a62228..f551ef47b 100644 --- a/application/hub/main/filter/bootstrap/class_HubBootstrapExtraBootstrappingFilter.php +++ b/application/hub/main/filter/bootstrap/class_HubBootstrapExtraBootstrappingFilter.php @@ -1,66 +1,3 @@ - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 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 . - */ -class HubBootstrapExtraBootstrappingFilter extends BaseFilter implements Filterable { - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this filter class - * - * @return $filterInstance An instance of this filter class - */ - public static final function createHubBootstrapExtraBootstrappingFilter () { - // Get a new instance - $filterInstance = new HubBootstrapExtraBootstrappingFilter(); - - // Return the instance - return $filterInstance; - } - - /** - * Executes the filter with given request and response objects - * - * @param $requestInstance An instance of a class with an Requestable interface - * @param $responseInstance An instance of a class with an Responseable interface - * @return void - * @throws FilterChainException If $nodeInstance is null (no NullPointerException here) - */ - public function execute (Requestable $requestInstance, Responseable $responseInstance) { - // Get node instance - $nodeInstance = Registry::getRegistry()->getInstance('node'); - - // Do some extra bootstrapping steps - $nodeInstance->doBootstrapping(); - } -} - -// [EOF] +// @DEPRECATED ?> diff --git a/application/hub/main/filter/bootstrap/class_HubBootstrapGenerateHubIdFilter.php b/application/hub/main/filter/bootstrap/class_HubBootstrapGenerateHubIdFilter.php index 5e62bb1ca..f551ef47b 100644 --- a/application/hub/main/filter/bootstrap/class_HubBootstrapGenerateHubIdFilter.php +++ b/application/hub/main/filter/bootstrap/class_HubBootstrapGenerateHubIdFilter.php @@ -1,70 +1,3 @@ - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 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 . - */ -class HubBootstrapGenerateHubIdFilter extends BaseFilter implements Filterable { - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this filter class - * - * @return $filterInstance An instance of this filter class - */ - public static final function createHubBootstrapGenerateHubIdFilter () { - // Get a new instance - $filterInstance = new HubBootstrapGenerateHubIdFilter(); - - // Return the instance - return $filterInstance; - } - - /** - * Executes the filter with given request and response objects - * - * @param $requestInstance An instance of a class with an Requestable interface - * @param $responseInstance An instance of a class with an Responseable interface - * @return void - * @throws FilterChainException If $nodeInstance is null (no NullPointerException here) - */ - public function execute (Requestable $requestInstance, Responseable $responseInstance) { - // Get node instance - $nodeInstance = Registry::getRegistry()->getInstance('node'); - - // --------------------- Hub-id acquirement phase --------------------- - // Acquire a hub-id. This step generates on first launch a new one and - // on any later launches it will restore the hub-id from the database. - // A passed 'nickname=xxx' argument will be used to add some - // 'personality' to the hub. - $nodeInstance->bootstrapAcquireHubId($requestInstance, $responseInstance); - } -} - -// [EOF] +// @DEPRECATED ?> diff --git a/application/hub/main/filter/bootstrap/class_HubBootstrapGenerateSessionIdFilter.php b/application/hub/main/filter/bootstrap/class_HubBootstrapGenerateSessionIdFilter.php index 53ccfb379..f551ef47b 100644 --- a/application/hub/main/filter/bootstrap/class_HubBootstrapGenerateSessionIdFilter.php +++ b/application/hub/main/filter/bootstrap/class_HubBootstrapGenerateSessionIdFilter.php @@ -1,68 +1,3 @@ - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 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 . - */ -class HubBootstrapGenerateSessionIdFilter extends BaseFilter implements Filterable { - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this filter class - * - * @return $filterInstance An instance of this filter class - */ - public static final function createHubBootstrapGenerateSessionIdFilter () { - // Get a new instance - $filterInstance = new HubBootstrapGenerateSessionIdFilter(); - - // Return the instance - return $filterInstance; - } - - /** - * Executes the filter with given request and response objects - * - * @param $requestInstance An instance of a class with an Requestable interface - * @param $responseInstance An instance of a class with an Responseable interface - * @return void - * @throws FilterChainException If $nodeInstance is null (no NullPointerException here) - */ - public function execute (Requestable $requestInstance, Responseable $responseInstance) { - // Get node instance - $nodeInstance = Registry::getRegistry()->getInstance('node'); - - // ------------------- More generic bootstrap steps ------------------- - // Generate the session id which will only be stored in RAM and kept for - // the whole "session". - $nodeInstance->bootstrapGenerateSessionId(); - } -} - -// [EOF] +// @DEPRECATED ?> diff --git a/application/hub/main/filter/bootstrap/class_HubBootstrapInitQueuesFilter.php b/application/hub/main/filter/bootstrap/class_HubBootstrapInitQueuesFilter.php index 6ea4b86ab..f551ef47b 100644 --- a/application/hub/main/filter/bootstrap/class_HubBootstrapInitQueuesFilter.php +++ b/application/hub/main/filter/bootstrap/class_HubBootstrapInitQueuesFilter.php @@ -1,66 +1,3 @@ - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 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 . - */ -class HubBootstrapInitQueuesFilter extends BaseFilter implements Filterable { - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this filter class - * - * @return $filterInstance An instance of this filter class - */ - public static final function createHubBootstrapInitQueuesFilter () { - // Get a new instance - $filterInstance = new HubBootstrapInitQueuesFilter(); - - // Return the instance - return $filterInstance; - } - - /** - * Executes the filter with given request and response objects - * - * @param $requestInstance An instance of a class with an Requestable interface - * @param $responseInstance An instance of a class with an Responseable interface - * @return void - * @throws FilterChainException If $nodeInstance is null (no NullPointerException here) - */ - public function execute (Requestable $requestInstance, Responseable $responseInstance) { - // Get node instance - $nodeInstance = Registry::getRegistry()->getInstance('node'); - - // Now init the queues - $nodeInstance->initQueues(); - } -} - -// [EOF] +// @DEPRECATED ?> diff --git a/application/hub/main/filter/bootstrap/class_HubBootstrapListenerPoolFilter.php b/application/hub/main/filter/bootstrap/class_HubBootstrapListenerPoolFilter.php index 8000a78ef..f551ef47b 100644 --- a/application/hub/main/filter/bootstrap/class_HubBootstrapListenerPoolFilter.php +++ b/application/hub/main/filter/bootstrap/class_HubBootstrapListenerPoolFilter.php @@ -1,66 +1,3 @@ - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 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 . - */ -class HubBootstrapListenerPoolFilter extends BaseFilter implements Filterable { - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this filter class - * - * @return $filterInstance An instance of this filter class - */ - public static final function createHubBootstrapListenerPoolFilter () { - // Get a new instance - $filterInstance = new HubBootstrapListenerPoolFilter(); - - // Return the instance - return $filterInstance; - } - - /** - * Executes the filter with given request and response objects - * - * @param $requestInstance An instance of a class with an Requestable interface - * @param $responseInstance An instance of a class with an Responseable interface - * @return void - * @throws FilterChainException If $nodeInstance is null (no NullPointerException here) - */ - public function execute (Requestable $requestInstance, Responseable $responseInstance) { - // Get node instance - $nodeInstance = Registry::getRegistry()->getInstance('node'); - - // Now do something - $nodeInstance->initializeListenerPool(); - } -} - -// [EOF] +// @DEPRECATED ?> diff --git a/application/hub/main/filter/bootstrap/class_HubBootstrapRestoreNodeListFilter.php b/application/hub/main/filter/bootstrap/class_HubBootstrapRestoreNodeListFilter.php index a634e0abd..f551ef47b 100644 --- a/application/hub/main/filter/bootstrap/class_HubBootstrapRestoreNodeListFilter.php +++ b/application/hub/main/filter/bootstrap/class_HubBootstrapRestoreNodeListFilter.php @@ -1,66 +1,3 @@ - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 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 . - */ -class HubBootstrapRestoreNodeListFilter extends BaseFilter implements Filterable { - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this filter class - * - * @return $filterInstance An instance of this filter class - */ - public static final function createHubBootstrapRestoreNodeListFilter () { - // Get a new instance - $filterInstance = new HubBootstrapRestoreNodeListFilter(); - - // Return the instance - return $filterInstance; - } - - /** - * Executes the filter with given request and response objects - * - * @param $requestInstance An instance of a class with an Requestable interface - * @param $responseInstance An instance of a class with an Responseable interface - * @return void - * @throws FilterChainException If $nodeInstance is null (no NullPointerException here) - */ - public function execute (Requestable $requestInstance, Responseable $responseInstance) { - // Get node instance - $nodeInstance = Registry::getRegistry()->getInstance('node'); - - // Restore a previously downloaded bootstrap-node list. - $nodeInstance->bootstrapRestoreNodeList(); - } -} - -// [EOF] +// @DEPRECATED ?> diff --git a/application/hub/main/filter/bootstrap/cruncher/.htaccess b/application/hub/main/filter/bootstrap/cruncher/.htaccess new file mode 100644 index 000000000..3a4288278 --- /dev/null +++ b/application/hub/main/filter/bootstrap/cruncher/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/hub/main/filter/bootstrap/cruncher/class_CruncherBootstrap b/application/hub/main/filter/bootstrap/cruncher/class_CruncherBootstrap new file mode 100644 index 000000000..b5541131c --- /dev/null +++ b/application/hub/main/filter/bootstrap/cruncher/class_CruncherBootstrap @@ -0,0 +1,66 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 Cruncher 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 . + */ +class CruncherBootstrap???Filter extends BaseFilter implements Filterable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this filter class + * + * @return $filterInstance An instance of this filter class + */ + public final static function createCruncherBootstrap???Filter () { + // Get a new instance + $filterInstance = new CruncherBootstrap???Filter(); + + // Return the instance + return $filterInstance; + } + + /** + * Executes the filter with given request and response objects + * + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface + * @return void + * @todo 0% done + */ + public function execute (Requestable $requestInstance, Responseable $responseInstance) { + // Get node instance + $nodeInstance = Registry::getRegistry()->getInstance('node'); + + // Now do something + $this->partialStub('Please implement this step.'); + } +} + +// [EOF] +?> diff --git a/application/hub/main/filter/bootstrap/cruncher/class_CruncherBootstrapExtraBootstrappingFilter.php b/application/hub/main/filter/bootstrap/cruncher/class_CruncherBootstrapExtraBootstrappingFilter.php new file mode 100644 index 000000000..17deffef9 --- /dev/null +++ b/application/hub/main/filter/bootstrap/cruncher/class_CruncherBootstrapExtraBootstrappingFilter.php @@ -0,0 +1,66 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 Cruncher 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 . + */ +class CruncherBootstrapExtraBootstrappingFilter extends BaseFilter implements Filterable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this filter class + * + * @return $filterInstance An instance of this filter class + */ + public static final function createCruncherBootstrapExtraBootstrappingFilter () { + // Get a new instance + $filterInstance = new CruncherBootstrapExtraBootstrappingFilter(); + + // Return the instance + return $filterInstance; + } + + /** + * Executes the filter with given request and response objects + * + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface + * @return void + * @throws FilterChainException If $cruncherInstance is null (no NullPointerException here) + */ + public function execute (Requestable $requestInstance, Responseable $responseInstance) { + // Get cruncher instance + $cruncherInstance = Registry::getRegistry()->getInstance('cruncher'); + + // Do some extra bootstrapping steps + $cruncherInstance->doBootstrapping(); + } +} + +// [EOF] +?> diff --git a/application/hub/main/filter/bootstrap/node/.htaccess b/application/hub/main/filter/bootstrap/node/.htaccess new file mode 100644 index 000000000..3a4288278 --- /dev/null +++ b/application/hub/main/filter/bootstrap/node/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/hub/main/filter/bootstrap/node/class_NodeBootstrap b/application/hub/main/filter/bootstrap/node/class_NodeBootstrap new file mode 100644 index 000000000..7dc551f97 --- /dev/null +++ b/application/hub/main/filter/bootstrap/node/class_NodeBootstrap @@ -0,0 +1,66 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 Node 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 . + */ +class NodeBootstrap???Filter extends BaseFilter implements Filterable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this filter class + * + * @return $filterInstance An instance of this filter class + */ + public final static function createNodeBootstrap???Filter () { + // Get a new instance + $filterInstance = new NodeBootstrap???Filter(); + + // Return the instance + return $filterInstance; + } + + /** + * Executes the filter with given request and response objects + * + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface + * @return void + * @todo 0% done + */ + public function execute (Requestable $requestInstance, Responseable $responseInstance) { + // Get node instance + $nodeInstance = Registry::getRegistry()->getInstance('node'); + + // Now do something + $this->partialStub('Please implement this step.'); + } +} + +// [EOF] +?> diff --git a/application/hub/main/filter/bootstrap/node/class_NodeBootstrapExtraBootstrappingFilter.php b/application/hub/main/filter/bootstrap/node/class_NodeBootstrapExtraBootstrappingFilter.php new file mode 100644 index 000000000..c4361542c --- /dev/null +++ b/application/hub/main/filter/bootstrap/node/class_NodeBootstrapExtraBootstrappingFilter.php @@ -0,0 +1,66 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 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 . + */ +class NodeBootstrapExtraBootstrappingFilter extends BaseFilter implements Filterable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this filter class + * + * @return $filterInstance An instance of this filter class + */ + public static final function createNodeBootstrapExtraBootstrappingFilter () { + // Get a new instance + $filterInstance = new NodeBootstrapExtraBootstrappingFilter(); + + // Return the instance + return $filterInstance; + } + + /** + * Executes the filter with given request and response objects + * + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface + * @return void + * @throws FilterChainException If $nodeInstance is null (no NullPointerException here) + */ + public function execute (Requestable $requestInstance, Responseable $responseInstance) { + // Get node instance + $nodeInstance = Registry::getRegistry()->getInstance('node'); + + // Do some extra bootstrapping steps + $nodeInstance->doBootstrapping(); + } +} + +// [EOF] +?> diff --git a/application/hub/main/filter/bootstrap/node/class_NodeBootstrapGenerateNodeIdFilter.php b/application/hub/main/filter/bootstrap/node/class_NodeBootstrapGenerateNodeIdFilter.php new file mode 100644 index 000000000..f7ccb6de0 --- /dev/null +++ b/application/hub/main/filter/bootstrap/node/class_NodeBootstrapGenerateNodeIdFilter.php @@ -0,0 +1,70 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 Node 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 . + */ +class NodeBootstrapGenerateNodeIdFilter extends BaseFilter implements Filterable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this filter class + * + * @return $filterInstance An instance of this filter class + */ + public static final function createNodeBootstrapGenerateNodeIdFilter () { + // Get a new instance + $filterInstance = new NodeBootstrapGenerateNodeIdFilter(); + + // Return the instance + return $filterInstance; + } + + /** + * Executes the filter with given request and response objects + * + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface + * @return void + * @throws FilterChainException If $nodeInstance is null (no NullPointerException here) + */ + public function execute (Requestable $requestInstance, Responseable $responseInstance) { + // Get node instance + $nodeInstance = Registry::getRegistry()->getInstance('node'); + + // --------------------- Node-id acquirement phase --------------------- + // Acquire a hub-id. This step generates on first launch a new one and + // on any later launches it will restore the hub-id from the database. + // A passed 'nickname=xxx' argument will be used to add some + // 'personality' to the hub. + $nodeInstance->bootstrapAcquireNodeId($requestInstance, $responseInstance); + } +} + +// [EOF] +?> diff --git a/application/hub/main/filter/bootstrap/node/class_NodeBootstrapGenerateSessionIdFilter.php b/application/hub/main/filter/bootstrap/node/class_NodeBootstrapGenerateSessionIdFilter.php new file mode 100644 index 000000000..47d5742c7 --- /dev/null +++ b/application/hub/main/filter/bootstrap/node/class_NodeBootstrapGenerateSessionIdFilter.php @@ -0,0 +1,68 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 Node 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 . + */ +class NodeBootstrapGenerateSessionIdFilter extends BaseFilter implements Filterable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this filter class + * + * @return $filterInstance An instance of this filter class + */ + public static final function createNodeBootstrapGenerateSessionIdFilter () { + // Get a new instance + $filterInstance = new NodeBootstrapGenerateSessionIdFilter(); + + // Return the instance + return $filterInstance; + } + + /** + * Executes the filter with given request and response objects + * + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface + * @return void + * @throws FilterChainException If $nodeInstance is null (no NullPointerException here) + */ + public function execute (Requestable $requestInstance, Responseable $responseInstance) { + // Get node instance + $nodeInstance = Registry::getRegistry()->getInstance('node'); + + // ------------------- More generic bootstrap steps ------------------- + // Generate the session id which will only be stored in RAM and kept for + // the whole "session". + $nodeInstance->bootstrapGenerateSessionId(); + } +} + +// [EOF] +?> diff --git a/application/hub/main/filter/bootstrap/node/class_NodeBootstrapInitQueuesFilter.php b/application/hub/main/filter/bootstrap/node/class_NodeBootstrapInitQueuesFilter.php new file mode 100644 index 000000000..45da1e283 --- /dev/null +++ b/application/hub/main/filter/bootstrap/node/class_NodeBootstrapInitQueuesFilter.php @@ -0,0 +1,66 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 Node 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 . + */ +class NodeBootstrapInitQueuesFilter extends BaseFilter implements Filterable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this filter class + * + * @return $filterInstance An instance of this filter class + */ + public static final function createNodeBootstrapInitQueuesFilter () { + // Get a new instance + $filterInstance = new NodeBootstrapInitQueuesFilter(); + + // Return the instance + return $filterInstance; + } + + /** + * Executes the filter with given request and response objects + * + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface + * @return void + * @throws FilterChainException If $nodeInstance is null (no NullPointerException here) + */ + public function execute (Requestable $requestInstance, Responseable $responseInstance) { + // Get node instance + $nodeInstance = Registry::getRegistry()->getInstance('node'); + + // Now init the queues + $nodeInstance->initQueues(); + } +} + +// [EOF] +?> diff --git a/application/hub/main/filter/bootstrap/node/class_NodeBootstrapListenerPoolFilter.php b/application/hub/main/filter/bootstrap/node/class_NodeBootstrapListenerPoolFilter.php new file mode 100644 index 000000000..ec6a8c1c1 --- /dev/null +++ b/application/hub/main/filter/bootstrap/node/class_NodeBootstrapListenerPoolFilter.php @@ -0,0 +1,66 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 Node 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 . + */ +class NodeBootstrapListenerPoolFilter extends BaseFilter implements Filterable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this filter class + * + * @return $filterInstance An instance of this filter class + */ + public static final function createNodeBootstrapListenerPoolFilter () { + // Get a new instance + $filterInstance = new NodeBootstrapListenerPoolFilter(); + + // Return the instance + return $filterInstance; + } + + /** + * Executes the filter with given request and response objects + * + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface + * @return void + * @throws FilterChainException If $nodeInstance is null (no NullPointerException here) + */ + public function execute (Requestable $requestInstance, Responseable $responseInstance) { + // Get node instance + $nodeInstance = Registry::getRegistry()->getInstance('node'); + + // Now do something + $nodeInstance->initializeListenerPool(); + } +} + +// [EOF] +?> diff --git a/application/hub/main/filter/bootstrap/node/class_NodeBootstrapRestoreNodeListFilter.php b/application/hub/main/filter/bootstrap/node/class_NodeBootstrapRestoreNodeListFilter.php new file mode 100644 index 000000000..8c806954b --- /dev/null +++ b/application/hub/main/filter/bootstrap/node/class_NodeBootstrapRestoreNodeListFilter.php @@ -0,0 +1,66 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 Node 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 . + */ +class NodeBootstrapRestoreNodeListFilter extends BaseFilter implements Filterable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this filter class + * + * @return $filterInstance An instance of this filter class + */ + public static final function createNodeBootstrapRestoreNodeListFilter () { + // Get a new instance + $filterInstance = new NodeBootstrapRestoreNodeListFilter(); + + // Return the instance + return $filterInstance; + } + + /** + * Executes the filter with given request and response objects + * + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface + * @return void + * @throws FilterChainException If $nodeInstance is null (no NullPointerException here) + */ + public function execute (Requestable $requestInstance, Responseable $responseInstance) { + // Get node instance + $nodeInstance = Registry::getRegistry()->getInstance('node'); + + // Restore a previously downloaded bootstrap-node list. + $nodeInstance->bootstrapRestoreNodeList(); + } +} + +// [EOF] +?> diff --git a/application/hub/main/filter/shutdown/class_HubShutdown b/application/hub/main/filter/shutdown/class_HubShutdown index 4612f446d..f551ef47b 100644 --- a/application/hub/main/filter/shutdown/class_HubShutdown +++ b/application/hub/main/filter/shutdown/class_HubShutdown @@ -1,67 +1,3 @@ - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 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 . - */ -class HubShutdown???Filter extends BaseFilter implements Filterable { - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this filter class - * - * @return $filterInstance An instance of this filter class - */ - public final static function createHubShutdown???Filter () { - // Get a new instance - $filterInstance = new HubShutdown???Filter(); - - // Return the instance - return $filterInstance; - } - - /** - * Executes the filter with given request and response objects - * - * @param $requestInstance An instance of a class with an Requestable interface - * @param $responseInstance An instance of a class with an Responseable interface - * @return void - * @throws FilterChainException If $nodeInstance is null (no NullPointerException here) - * @todo 0% done - */ - public function execute (Requestable $requestInstance, Responseable $responseInstance) { - // Get node instance - $nodeInstance = Registry::getRegistry()->getInstance('node'); - - // Now do something - $this->partialStub('Please implement this step.'); - } -} - -// [EOF] +// @DEPRECATED ?> diff --git a/application/hub/main/filter/shutdown/class_HubShutdownCruncherFilter.php b/application/hub/main/filter/shutdown/class_HubShutdownCruncherFilter.php index 0d8905f5a..f551ef47b 100644 --- a/application/hub/main/filter/shutdown/class_HubShutdownCruncherFilter.php +++ b/application/hub/main/filter/shutdown/class_HubShutdownCruncherFilter.php @@ -1,68 +1,3 @@ - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 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 . - */ -class HubShutdownCruncherFilter extends BaseFilter implements Filterable { - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this filter class - * - * @return $filterInstance An instance of this filter class - */ - public static final function createHubShutdownCruncherFilter () { - // Get a new instance - $filterInstance = new HubShutdownCruncherFilter(); - - // Return the instance - return $filterInstance; - } - - /** - * Executes the filter with given request and response objects - * - * @param $requestInstance An instance of a class with an Requestable interface - * @param $responseInstance An instance of a class with an Responseable interface - * @return void - * @throws FilterChainException If $nodeInstance is null (no NullPointerException please) - */ - public function execute (Requestable $requestInstance, Responseable $responseInstance) { - // Get node instance - $cruncherInstance = Registry::getRegistry()->getInstance('cruncher'); - - // Shutdown the cruncher. This should be the last line - $cruncherInstance->doShutdown(); - } -} - -// [EOF] +// @DEPRECATED ?> diff --git a/application/hub/main/filter/shutdown/class_HubShutdownDeinitQueuesFilter.php b/application/hub/main/filter/shutdown/class_HubShutdownDeinitQueuesFilter.php index fd6b96e5d..f551ef47b 100644 --- a/application/hub/main/filter/shutdown/class_HubShutdownDeinitQueuesFilter.php +++ b/application/hub/main/filter/shutdown/class_HubShutdownDeinitQueuesFilter.php @@ -1,76 +1,3 @@ - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 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 . - */ -class HubShutdownDeinitQueuesFilter extends BaseFilter implements Filterable { - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this filter class - * - * @return $filterInstance An instance of this filter class - */ - public static final function createHubShutdownDeinitQueuesFilter () { - // Get a new instance - $filterInstance = new HubShutdownDeinitQueuesFilter(); - - // Return the instance - return $filterInstance; - } - - /** - * Executes the filter with given request and response objects - * - * @param $requestInstance An instance of a class with an Requestable interface - * @param $responseInstance An instance of a class with an Responseable interface - * @return void - * @throws FilterChainException If $nodeInstance is null (no NullPointerException here) - * @todo 0% done - */ - public function execute (Requestable $requestInstance, Responseable $responseInstance) { - // Get node instance - $nodeInstance = Registry::getRegistry()->getInstance('node'); - - // Get query instance - $connectorInstance = $nodeInstance->getQueryConnectorInstance(); - - // Sanity-check on it - if (is_null($connectorInstance)) { - // Throws a FilterChainException to stop further processing - throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED); - } // END - if - - // Now shutdown this one done - $connectorInstance->doShutdown(); - } -} - -// [EOF] +// @DEPRECATED ?> diff --git a/application/hub/main/filter/shutdown/class_HubShutdownFlushNodeListFilter.php b/application/hub/main/filter/shutdown/class_HubShutdownFlushNodeListFilter.php index 10125c803..f551ef47b 100644 --- a/application/hub/main/filter/shutdown/class_HubShutdownFlushNodeListFilter.php +++ b/application/hub/main/filter/shutdown/class_HubShutdownFlushNodeListFilter.php @@ -1,67 +1,3 @@ - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 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 . - */ -class HubShutdownFlushNodeListFilter extends BaseFilter implements Filterable { - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this filter class - * - * @return $filterInstance An instance of this filter class - */ - public static final function createHubShutdownFlushNodeListFilter () { - // Get a new instance - $filterInstance = new HubShutdownFlushNodeListFilter(); - - // Return the instance - return $filterInstance; - } - - /** - * Executes the filter with given request and response objects - * - * @param $requestInstance An instance of a class with an Requestable interface - * @param $responseInstance An instance of a class with an Responseable interface - * @return void - * @throws FilterChainException If $nodeInstance is null (no NullPointerException please) - * @todo 0% done - */ - public function execute (Requestable $requestInstance, Responseable $responseInstance) { - // Get node instance - $nodeInstance = Registry::getRegistry()->getInstance('node'); - - // Now do something - $this->partialStub('Please implement this step.'); - } -} - -// [EOF] +// @DEPRECATED ?> diff --git a/application/hub/main/filter/shutdown/class_HubShutdownNodeFilter.php b/application/hub/main/filter/shutdown/class_HubShutdownNodeFilter.php index 56fff83c1..f551ef47b 100644 --- a/application/hub/main/filter/shutdown/class_HubShutdownNodeFilter.php +++ b/application/hub/main/filter/shutdown/class_HubShutdownNodeFilter.php @@ -1,68 +1,3 @@ - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 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 . - */ -class HubShutdownNodeFilter extends BaseFilter implements Filterable { - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this filter class - * - * @return $filterInstance An instance of this filter class - */ - public static final function createHubShutdownNodeFilter () { - // Get a new instance - $filterInstance = new HubShutdownNodeFilter(); - - // Return the instance - return $filterInstance; - } - - /** - * Executes the filter with given request and response objects - * - * @param $requestInstance An instance of a class with an Requestable interface - * @param $responseInstance An instance of a class with an Responseable interface - * @return void - * @throws FilterChainException If $nodeInstance is null (no NullPointerException please) - */ - public function execute (Requestable $requestInstance, Responseable $responseInstance) { - // Get node instance - $nodeInstance = Registry::getRegistry()->getInstance('node'); - - // Shutdown the node. This should be the last line - $nodeInstance->doShutdown(); - } -} - -// [EOF] +// @DEPRECATED ?> diff --git a/application/hub/main/filter/shutdown/class_HubShutdownTaskHandlerFilter.php b/application/hub/main/filter/shutdown/class_HubShutdownTaskHandlerFilter.php index f377c82d9..f551ef47b 100644 --- a/application/hub/main/filter/shutdown/class_HubShutdownTaskHandlerFilter.php +++ b/application/hub/main/filter/shutdown/class_HubShutdownTaskHandlerFilter.php @@ -1,67 +1,3 @@ - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 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 . - */ -class HubShutdownTaskHandlerFilter extends BaseFilter implements Filterable { - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this filter class - * - * @return $filterInstance An instance of this filter class - */ - public static final function createHubShutdownTaskHandlerFilter () { - // Get a new instance - $filterInstance = new HubShutdownTaskHandlerFilter(); - - // Return the instance - return $filterInstance; - } - - /** - * Executes the filter with given request and response objects - * - * @param $requestInstance An instance of a class with an Requestable interface - * @param $responseInstance An instance of a class with an Responseable interface - * @return void - * @throws FilterChainException If $nodeInstance is null (no NullPointerException here) - * @todo 0% done - */ - public function execute (Requestable $requestInstance, Responseable $responseInstance) { - // Get task handler instance - $handlerInstance = Registry::getRegistry()->getInstance('task'); - - // Shutdown the task manager and all its registered tasks - $handlerInstance->doShutdown(); - } -} - -// [EOF] +// @DEPRECATED ?> diff --git a/application/hub/main/filter/shutdown/cruncher/.htaccess b/application/hub/main/filter/shutdown/cruncher/.htaccess new file mode 100644 index 000000000..3a4288278 --- /dev/null +++ b/application/hub/main/filter/shutdown/cruncher/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/hub/main/filter/shutdown/cruncher/class_CruncherShutdownCruncherFilter.php b/application/hub/main/filter/shutdown/cruncher/class_CruncherShutdownCruncherFilter.php new file mode 100644 index 000000000..14022f818 --- /dev/null +++ b/application/hub/main/filter/shutdown/cruncher/class_CruncherShutdownCruncherFilter.php @@ -0,0 +1,68 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 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 . + */ +class CruncherShutdownCruncherFilter extends BaseFilter implements Filterable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this filter class + * + * @return $filterInstance An instance of this filter class + */ + public static final function createCruncherShutdownCruncherFilter () { + // Get a new instance + $filterInstance = new CruncherShutdownCruncherFilter(); + + // Return the instance + return $filterInstance; + } + + /** + * Executes the filter with given request and response objects + * + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface + * @return void + * @throws FilterChainException If $nodeInstance is null (no NullPointerException please) + */ + public function execute (Requestable $requestInstance, Responseable $responseInstance) { + // Get node instance + $cruncherInstance = Registry::getRegistry()->getInstance('cruncher'); + + // Shutdown the cruncher. This should be the last line + $cruncherInstance->doShutdown(); + } +} + +// [EOF] +?> diff --git a/application/hub/main/filter/shutdown/node/.htaccess b/application/hub/main/filter/shutdown/node/.htaccess new file mode 100644 index 000000000..3a4288278 --- /dev/null +++ b/application/hub/main/filter/shutdown/node/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/hub/main/filter/shutdown/node/class_NodeShutdown b/application/hub/main/filter/shutdown/node/class_NodeShutdown new file mode 100644 index 000000000..4612f446d --- /dev/null +++ b/application/hub/main/filter/shutdown/node/class_NodeShutdown @@ -0,0 +1,67 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 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 . + */ +class HubShutdown???Filter extends BaseFilter implements Filterable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this filter class + * + * @return $filterInstance An instance of this filter class + */ + public final static function createHubShutdown???Filter () { + // Get a new instance + $filterInstance = new HubShutdown???Filter(); + + // Return the instance + return $filterInstance; + } + + /** + * Executes the filter with given request and response objects + * + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface + * @return void + * @throws FilterChainException If $nodeInstance is null (no NullPointerException here) + * @todo 0% done + */ + public function execute (Requestable $requestInstance, Responseable $responseInstance) { + // Get node instance + $nodeInstance = Registry::getRegistry()->getInstance('node'); + + // Now do something + $this->partialStub('Please implement this step.'); + } +} + +// [EOF] +?> diff --git a/application/hub/main/filter/shutdown/node/class_NodeShutdownDeinitQueuesFilter.php b/application/hub/main/filter/shutdown/node/class_NodeShutdownDeinitQueuesFilter.php new file mode 100644 index 000000000..e09533f9c --- /dev/null +++ b/application/hub/main/filter/shutdown/node/class_NodeShutdownDeinitQueuesFilter.php @@ -0,0 +1,76 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 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 . + */ +class NodeShutdownDeinitQueuesFilter extends BaseFilter implements Filterable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this filter class + * + * @return $filterInstance An instance of this filter class + */ + public static final function createNodeShutdownDeinitQueuesFilter () { + // Get a new instance + $filterInstance = new NodeShutdownDeinitQueuesFilter(); + + // Return the instance + return $filterInstance; + } + + /** + * Executes the filter with given request and response objects + * + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface + * @return void + * @throws FilterChainException If $nodeInstance is null (no NullPointerException here) + * @todo 0% done + */ + public function execute (Requestable $requestInstance, Responseable $responseInstance) { + // Get node instance + $nodeInstance = Registry::getRegistry()->getInstance('node'); + + // Get query instance + $connectorInstance = $nodeInstance->getQueryConnectorInstance(); + + // Sanity-check on it + if (is_null($connectorInstance)) { + // Throws a FilterChainException to stop further processing + throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED); + } // END - if + + // Now shutdown this one done + $connectorInstance->doShutdown(); + } +} + +// [EOF] +?> diff --git a/application/hub/main/filter/shutdown/node/class_NodeShutdownFlushNodeListFilter.php b/application/hub/main/filter/shutdown/node/class_NodeShutdownFlushNodeListFilter.php new file mode 100644 index 000000000..320bfbd69 --- /dev/null +++ b/application/hub/main/filter/shutdown/node/class_NodeShutdownFlushNodeListFilter.php @@ -0,0 +1,67 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 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 . + */ +class NodeShutdownFlushNodeListFilter extends BaseFilter implements Filterable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this filter class + * + * @return $filterInstance An instance of this filter class + */ + public static final function createNodeShutdownFlushNodeListFilter () { + // Get a new instance + $filterInstance = new NodeShutdownFlushNodeListFilter(); + + // Return the instance + return $filterInstance; + } + + /** + * Executes the filter with given request and response objects + * + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface + * @return void + * @throws FilterChainException If $nodeInstance is null (no NullPointerException please) + * @todo 0% done + */ + public function execute (Requestable $requestInstance, Responseable $responseInstance) { + // Get node instance + $nodeInstance = Registry::getRegistry()->getInstance('node'); + + // Now do something + $this->partialStub('Please implement this step.'); + } +} + +// [EOF] +?> diff --git a/application/hub/main/filter/shutdown/node/class_NodeShutdownNodeFilter.php b/application/hub/main/filter/shutdown/node/class_NodeShutdownNodeFilter.php new file mode 100644 index 000000000..92e714e2e --- /dev/null +++ b/application/hub/main/filter/shutdown/node/class_NodeShutdownNodeFilter.php @@ -0,0 +1,68 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 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 . + */ +class NodeShutdownNodeFilter extends BaseFilter implements Filterable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this filter class + * + * @return $filterInstance An instance of this filter class + */ + public static final function createNodeShutdownNodeFilter () { + // Get a new instance + $filterInstance = new NodeShutdownNodeFilter(); + + // Return the instance + return $filterInstance; + } + + /** + * Executes the filter with given request and response objects + * + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface + * @return void + * @throws FilterChainException If $nodeInstance is null (no NullPointerException please) + */ + public function execute (Requestable $requestInstance, Responseable $responseInstance) { + // Get node instance + $nodeInstance = Registry::getRegistry()->getInstance('node'); + + // Shutdown the node. This should be the last line + $nodeInstance->doShutdown(); + } +} + +// [EOF] +?> diff --git a/application/hub/main/filter/shutdown/node/class_NodeShutdownTaskHandlerFilter.php b/application/hub/main/filter/shutdown/node/class_NodeShutdownTaskHandlerFilter.php new file mode 100644 index 000000000..4951752cb --- /dev/null +++ b/application/hub/main/filter/shutdown/node/class_NodeShutdownTaskHandlerFilter.php @@ -0,0 +1,67 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 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 . + */ +class NodeShutdownTaskHandlerFilter extends BaseFilter implements Filterable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this filter class + * + * @return $filterInstance An instance of this filter class + */ + public static final function createNodeShutdownTaskHandlerFilter () { + // Get a new instance + $filterInstance = new NodeShutdownTaskHandlerFilter(); + + // Return the instance + return $filterInstance; + } + + /** + * Executes the filter with given request and response objects + * + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface + * @return void + * @throws FilterChainException If $nodeInstance is null (no NullPointerException here) + * @todo 0% done + */ + public function execute (Requestable $requestInstance, Responseable $responseInstance) { + // Get task handler instance + $handlerInstance = Registry::getRegistry()->getInstance('task'); + + // Shutdown the task manager and all its registered tasks + $handlerInstance->doShutdown(); + } +} + +// [EOF] +?> diff --git a/application/hub/main/filter/task/class_CruncherTaskHandlerInitializerFilter.php b/application/hub/main/filter/task/class_CruncherTaskHandlerInitializerFilter.php index 895223257..f551ef47b 100644 --- a/application/hub/main/filter/task/class_CruncherTaskHandlerInitializerFilter.php +++ b/application/hub/main/filter/task/class_CruncherTaskHandlerInitializerFilter.php @@ -1,70 +1,3 @@ - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 Cruncher 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 . - */ -class CruncherTaskHandlerInitializerFilter extends BaseFilter implements Filterable { - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this filter class - * - * @return $filterInstance An instance of this filter class - */ - public static final function createCruncherTaskHandlerInitializerFilter () { - // Get a new instance - $filterInstance = new CruncherTaskHandlerInitializerFilter(); - - // Return the instance - return $filterInstance; - } - - /** - * Executes the filter with given request and response objects - * - * @param $requestInstance An instance of a class with an Requestable interface - * @param $responseInstance An instance of a class with an Responseable interface - * @return void - * @throws FilterChainException If we need to interrupt the filter chain - * @todo 0% done - */ - public function execute (Requestable $requestInstance, Responseable $responseInstance) { - // Get cruncher instance - //$cruncherInstance = Registry::getRegistry()->getInstance('cruncher'); - - // Get a new task handler instance - $handlerInstance = ObjectFactory::createObjectByConfiguredName('task_handler_class'); - - // Put the task handler in registry - Registry::getRegistry()->addInstance('task', $handlerInstance); - } -} - -// [EOF] +// @DEPRECATED ?> diff --git a/application/hub/main/filter/task/class_HubTaskHandlerInitializerFilter.php b/application/hub/main/filter/task/class_HubTaskHandlerInitializerFilter.php index dd60c8333..f551ef47b 100644 --- a/application/hub/main/filter/task/class_HubTaskHandlerInitializerFilter.php +++ b/application/hub/main/filter/task/class_HubTaskHandlerInitializerFilter.php @@ -1,112 +1,3 @@ - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 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 . - */ -class HubTaskHandlerInitializerFilter extends BaseFilter implements Filterable { - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this filter class - * - * @return $filterInstance An instance of this filter class - */ - public static final function createHubTaskHandlerInitializerFilter () { - // Get a new instance - $filterInstance = new HubTaskHandlerInitializerFilter(); - - // Return the instance - return $filterInstance; - } - - /** - * Executes the filter with given request and response objects - * - * @param $requestInstance An instance of a class with an Requestable interface - * @param $responseInstance An instance of a class with an Responseable interface - * @return void - * @throws FilterChainException If we need to interrupt the filter chain - * @todo 0% done - */ - public function execute (Requestable $requestInstance, Responseable $responseInstance) { - // Get node instance - $nodeInstance = Registry::getRegistry()->getInstance('node'); - - // Get a new task handler instance - $handlerInstance = ObjectFactory::createObjectByConfiguredName('task_handler_class'); - - // Generate idle task - $taskInstance = ObjectFactory::createObjectByConfiguredName('idle_task_class'); - - // Register it as well - $handlerInstance->registerTask('idle_loop', $taskInstance); - - // Network package reader, needs to be delayed a little - $handlerInstance->registerTask('network_package_reader', $nodeInstance->getListenerPoolInstance()); - - // Generate package writer task - $taskInstance = ObjectFactory::createObjectByConfiguredName('hub_package_writer_task_class'); - - // Register it as well - $handlerInstance->registerTask('network_package_writer', $taskInstance); - - // Query handler instance - $handlerInstance->registerTask('query_handler', $nodeInstance->getQueryConnectorInstance()); - - // Queue handler instance - $handlerInstance->registerTask('queue_handler', $nodeInstance->getQueueConnectorInstance()); - - // Prepare a self-test task for the listeners - $taskInstance = ObjectFactory::createObjectByConfiguredName('hub_selfconnect_task_class'); - - // Register it - $handlerInstance->registerTask('self_connect', $taskInstance); - - // Prepare a update-check task - $taskInstance = ObjectFactory::createObjectByConfiguredName('hub_update_check_task_class'); - - // Register it - $handlerInstance->registerTask('update_check', $taskInstance); - - // Get the list instance here - $listInstance = $nodeInstance->getListenerPoolInstance()->getPoolEntriesInstance(); - - // Prepare a ping task - $taskInstance = ObjectFactory::createObjectByConfiguredName('hub_ping_task_class', array($listInstance)); - - // Register it - $handlerInstance->registerTask('ping', $taskInstance); - - // Put the task handler in registry - Registry::getRegistry()->addInstance('task', $handlerInstance); - } -} - -// [EOF] +// @DEPRECATED ?> diff --git a/application/hub/main/filter/task/cruncher/.htaccess b/application/hub/main/filter/task/cruncher/.htaccess new file mode 100644 index 000000000..3a4288278 --- /dev/null +++ b/application/hub/main/filter/task/cruncher/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/hub/main/filter/task/cruncher/class_CruncherTaskHandlerInitializerFilter.php b/application/hub/main/filter/task/cruncher/class_CruncherTaskHandlerInitializerFilter.php new file mode 100644 index 000000000..895223257 --- /dev/null +++ b/application/hub/main/filter/task/cruncher/class_CruncherTaskHandlerInitializerFilter.php @@ -0,0 +1,70 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 Cruncher 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 . + */ +class CruncherTaskHandlerInitializerFilter extends BaseFilter implements Filterable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this filter class + * + * @return $filterInstance An instance of this filter class + */ + public static final function createCruncherTaskHandlerInitializerFilter () { + // Get a new instance + $filterInstance = new CruncherTaskHandlerInitializerFilter(); + + // Return the instance + return $filterInstance; + } + + /** + * Executes the filter with given request and response objects + * + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface + * @return void + * @throws FilterChainException If we need to interrupt the filter chain + * @todo 0% done + */ + public function execute (Requestable $requestInstance, Responseable $responseInstance) { + // Get cruncher instance + //$cruncherInstance = Registry::getRegistry()->getInstance('cruncher'); + + // Get a new task handler instance + $handlerInstance = ObjectFactory::createObjectByConfiguredName('task_handler_class'); + + // Put the task handler in registry + Registry::getRegistry()->addInstance('task', $handlerInstance); + } +} + +// [EOF] +?> diff --git a/application/hub/main/filter/task/node/.htaccess b/application/hub/main/filter/task/node/.htaccess new file mode 100644 index 000000000..3a4288278 --- /dev/null +++ b/application/hub/main/filter/task/node/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/hub/main/filter/task/node/class_NodeTaskHandlerInitializerFilter.php b/application/hub/main/filter/task/node/class_NodeTaskHandlerInitializerFilter.php new file mode 100644 index 000000000..0d0a24989 --- /dev/null +++ b/application/hub/main/filter/task/node/class_NodeTaskHandlerInitializerFilter.php @@ -0,0 +1,112 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 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 . + */ +class NodeTaskHandlerInitializerFilter extends BaseFilter implements Filterable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this filter class + * + * @return $filterInstance An instance of this filter class + */ + public static final function createNodeTaskHandlerInitializerFilter () { + // Get a new instance + $filterInstance = new NodeTaskHandlerInitializerFilter(); + + // Return the instance + return $filterInstance; + } + + /** + * Executes the filter with given request and response objects + * + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface + * @return void + * @throws FilterChainException If we need to interrupt the filter chain + * @todo 0% done + */ + public function execute (Requestable $requestInstance, Responseable $responseInstance) { + // Get node instance + $nodeInstance = Registry::getRegistry()->getInstance('node'); + + // Get a new task handler instance + $handlerInstance = ObjectFactory::createObjectByConfiguredName('task_handler_class'); + + // Generate idle task + $taskInstance = ObjectFactory::createObjectByConfiguredName('idle_task_class'); + + // Register it as well + $handlerInstance->registerTask('idle_loop', $taskInstance); + + // Network package reader, needs to be delayed a little + $handlerInstance->registerTask('network_package_reader', $nodeInstance->getListenerPoolInstance()); + + // Generate package writer task + $taskInstance = ObjectFactory::createObjectByConfiguredName('hub_package_writer_task_class'); + + // Register it as well + $handlerInstance->registerTask('network_package_writer', $taskInstance); + + // Query handler instance + $handlerInstance->registerTask('query_handler', $nodeInstance->getQueryConnectorInstance()); + + // Queue handler instance + $handlerInstance->registerTask('queue_handler', $nodeInstance->getQueueConnectorInstance()); + + // Prepare a self-test task for the listeners + $taskInstance = ObjectFactory::createObjectByConfiguredName('hub_selfconnect_task_class'); + + // Register it + $handlerInstance->registerTask('self_connect', $taskInstance); + + // Prepare a update-check task + $taskInstance = ObjectFactory::createObjectByConfiguredName('hub_update_check_task_class'); + + // Register it + $handlerInstance->registerTask('update_check', $taskInstance); + + // Get the list instance here + $listInstance = $nodeInstance->getListenerPoolInstance()->getPoolEntriesInstance(); + + // Prepare a ping task + $taskInstance = ObjectFactory::createObjectByConfiguredName('hub_ping_task_class', array($listInstance)); + + // Register it + $handlerInstance->registerTask('ping', $taskInstance); + + // Put the task handler in registry + Registry::getRegistry()->addInstance('task', $handlerInstance); + } +} + +// [EOF] +?> diff --git a/application/hub/main/nodes/class_BaseHubNode.php b/application/hub/main/nodes/class_BaseHubNode.php index 086e1da59..58161f01a 100644 --- a/application/hub/main/nodes/class_BaseHubNode.php +++ b/application/hub/main/nodes/class_BaseHubNode.php @@ -311,7 +311,7 @@ class BaseHubNode extends BaseHubSystem implements Updateable { * @param $responseInstance A Responseable class * @return void */ - public function bootstrapAcquireHubId (Requestable $requestInstance, Responseable $responseInstance) { + public function bootstrapAcquireNodeId (Requestable $requestInstance, Responseable $responseInstance) { // Get a wrapper instance $wrapperInstance = ObjectFactory::createObjectByConfiguredName('node_info_db_wrapper_class'); @@ -346,7 +346,7 @@ class BaseHubNode extends BaseHubSystem implements Updateable { // Get a crypto instance $cryptoInstance = ObjectFactory::createObjectByConfiguredName('crypto_class'); - // Hash and encrypt the string so we become a "node id" aka Hub-Id + // Hash and encrypt the string so we become a node id (also documented as "hub id") $this->setNodeId($cryptoInstance->hashString($cryptoInstance->encryptString($randomString))); // Register the node id with our wrapper diff --git a/application/hub/main/nodes/list/class_HubListNode.php b/application/hub/main/nodes/list/class_HubListNode.php index 572d7f954..81306f4b5 100644 --- a/application/hub/main/nodes/list/class_HubListNode.php +++ b/application/hub/main/nodes/list/class_HubListNode.php @@ -86,7 +86,7 @@ class HubListNode extends BaseHubNode implements NodeHelper, Registerable { $controllerInstance = $applicationInstance->getControllerInstance(); // Self-announcement task - $controllerInstance->addActivationFilter(ObjectFactory::createObjectByConfiguredName('hub_activation_self_announcement_task_filter')); + $controllerInstance->addActivationFilter(ObjectFactory::createObjectByConfiguredName('node_activation_self_announcement_task_filter')); // @TODO Add some filters here $this->partialStub('Add some filters here.'); diff --git a/application/hub/main/nodes/master/class_HubMasterNode.php b/application/hub/main/nodes/master/class_HubMasterNode.php index 4cca8217b..5d75473f5 100644 --- a/application/hub/main/nodes/master/class_HubMasterNode.php +++ b/application/hub/main/nodes/master/class_HubMasterNode.php @@ -86,7 +86,7 @@ class HubMasterNode extends BaseHubNode implements NodeHelper, Registerable { $controllerInstance = $applicationInstance->getControllerInstance(); // Self-announcement task - $controllerInstance->addActivationFilter(ObjectFactory::createObjectByConfiguredName('hub_activation_self_announcement_task_filter')); + $controllerInstance->addActivationFilter(ObjectFactory::createObjectByConfiguredName('node_activation_self_announcement_task_filter')); // @TODO Add some filters here $this->partialStub('Add some filters here.'); diff --git a/application/hub/main/nodes/regular/class_HubRegularNode.php b/application/hub/main/nodes/regular/class_HubRegularNode.php index e6db87565..37ae2f518 100644 --- a/application/hub/main/nodes/regular/class_HubRegularNode.php +++ b/application/hub/main/nodes/regular/class_HubRegularNode.php @@ -86,7 +86,7 @@ class HubRegularNode extends BaseHubNode implements NodeHelper, Registerable { $controllerInstance = $applicationInstance->getControllerInstance(); // Self-announcement task - $controllerInstance->addActivationFilter(ObjectFactory::createObjectByConfiguredName('hub_activation_self_announcement_task_filter')); + $controllerInstance->addActivationFilter(ObjectFactory::createObjectByConfiguredName('node_activation_self_announcement_task_filter')); // @TODO Add some filters here $this->partialStub('Add some filters here.'); -- 2.39.2