]> git.mxchange.org Git - hub.git/commitdiff
State pattern classes for node states added, factory added, copyright updated
authorRoland Häder <roland@mxchange.org>
Wed, 27 Jan 2010 01:47:08 +0000 (01:47 +0000)
committerRoland Häder <roland@mxchange.org>
Wed, 27 Jan 2010 01:47:08 +0000 (01:47 +0000)
171 files changed:
.gitattributes
application/hub/class_ApplicationHelper.php
application/hub/config.php
application/hub/data.php
application/hub/debug.php
application/hub/exceptions.php
application/hub/exceptions/hub/class_HubAlreadyAnnouncedException.php
application/hub/exceptions/lists/class_InvalidListHashException.php
application/hub/exceptions/lists/class_ListGroupAlreadyAddedException.php
application/hub/exceptions/lists/class_NoListGroupException.php
application/hub/exceptions/tasks/class_InvalidTaskException.php
application/hub/init.php
application/hub/interfaces/connectors/class_Connectable.php
application/hub/interfaces/handler/class_Handleable.php
application/hub/interfaces/handler/network/class_Networkable.php
application/hub/interfaces/handler/task/class_HandleableTask.php
application/hub/interfaces/listener/class_Listenable.php
application/hub/interfaces/lists/class_Listable.php
application/hub/interfaces/nodes/class_NodeHelper.php
application/hub/interfaces/pool/class_Poolable.php
application/hub/interfaces/pool/client/class_PoolableClient.php
application/hub/interfaces/pool/listener/class_PoolableListener.php
application/hub/interfaces/query/class_Queryable.php
application/hub/interfaces/queues/class_Queueable.php
application/hub/interfaces/states/class_
application/hub/interfaces/states/class_Stateable.php
application/hub/interfaces/states/client/class_ClientStateable.php
application/hub/interfaces/states/hub/class_HubStateable.php
application/hub/interfaces/states/node/.htaccess [new file with mode: 0644]
application/hub/interfaces/states/node/class_NodeStateable.php [new file with mode: 0644]
application/hub/interfaces/tasks/class_Taskable.php
application/hub/interfaces/visitor/class_Visitable.php
application/hub/interfaces/visitor/class_Visitor.php
application/hub/interfaces/visitor/connector/class_QueryConnectorVisitor.php
application/hub/interfaces/visitor/decorator/class_DecoratorVisitor.php
application/hub/interfaces/visitor/listener/class_ListenerVisitor.php
application/hub/interfaces/visitor/pool/class_PoolVisitor.php
application/hub/interfaces/visitor/pool/listener/class_ListenerPoolVisitor.php
application/hub/interfaces/visitor/query/class_QueryVisitor.php
application/hub/interfaces/visitor/tasks/class_TaskVisitor.php
application/hub/loader.php
application/hub/main/class_
application/hub/main/class_Base
application/hub/main/class_BaseHubSystem.php
application/hub/main/commands/console/class_HubConsoleMainCommand.php
application/hub/main/connectors/class_BaseConnector.php
application/hub/main/connectors/query/class_
application/hub/main/connectors/query/class_BaseQueryConnector.php
application/hub/main/connectors/query/local/class_LocalQueryConnector.php
application/hub/main/connectors/queues/class_
application/hub/main/connectors/queues/class_BaseQueueConnector.php
application/hub/main/connectors/queues/local/class_LocalQueueConnector.php
application/hub/main/controller/console/class_HubConsoleDefaultNewsController.php
application/hub/main/database/wrapper/class_NodeInformationDatabaseWrapper.php
application/hub/main/database/wrapper/class_NodeListDatabaseWrapper.php
application/hub/main/decorators/class_BaseDecorator.php
application/hub/main/factories/.htaccess [new file with mode: 0644]
application/hub/main/factories/states/.htaccess [new file with mode: 0644]
application/hub/main/factories/states/class_NodeStateFactory.php [new file with mode: 0644]
application/hub/main/filter/activation/class_HubActivation
application/hub/main/filter/activation/class_HubActivationSelfAnnouncementFilter.php
application/hub/main/filter/bootstrap/class_HubBootstrap
application/hub/main/filter/bootstrap/class_HubBootstrapAquireHubIdFilter.php
application/hub/main/filter/bootstrap/class_HubBootstrapExtraBootstrappingFilter.php
application/hub/main/filter/bootstrap/class_HubBootstrapGenSessionIdFilter.php
application/hub/main/filter/bootstrap/class_HubBootstrapGenerateHubIdFilter.php
application/hub/main/filter/bootstrap/class_HubBootstrapGenerateSessionIdFilter.php
application/hub/main/filter/bootstrap/class_HubBootstrapInitQueuesFilter.php
application/hub/main/filter/bootstrap/class_HubBootstrapListenerPoolFilter.php
application/hub/main/filter/bootstrap/class_HubBootstrapRestoreNodeListFilter.php
application/hub/main/filter/class_
application/hub/main/filter/console/class_Console
application/hub/main/filter/console/class_ConsoleWelcomeTeaserFilter.php
application/hub/main/filter/node/class_Node
application/hub/main/filter/node/class_NodeInitializationFilter.php
application/hub/main/filter/node/class_NodePhpRequirementsFilter.php
application/hub/main/filter/shutdown/class_HubShutdown
application/hub/main/filter/shutdown/class_HubShutdownDeinitQueuesFilter.php
application/hub/main/filter/shutdown/class_HubShutdownFlushNodeListFilter.php
application/hub/main/filter/shutdown/class_HubShutdownListenerPoolFilter.php
application/hub/main/filter/shutdown/class_HubShutdownNodeFilter.php
application/hub/main/filter/shutdown/class_HubShutdownTaskHandlerFilter.php [new file with mode: 0644]
application/hub/main/filter/task/class_TaskHandlerInitializerFilter.php
application/hub/main/handler/class_
application/hub/main/handler/class_BaseHandler.php
application/hub/main/handler/network/class_
application/hub/main/handler/network/class_BaseNetworkPackageHandler.php
application/hub/main/handler/network/tcp/class_
application/hub/main/handler/network/tcp/class_TcpNetworkPackageHandler.php
application/hub/main/handler/network/udp/class_UdpNetworkPackageHandler.php
application/hub/main/handler/tasks/class_TaskHandler.php
application/hub/main/helper/hub/announcement/class_HubDescriptorHelper.php
application/hub/main/helper/hub/class_
application/hub/main/helper/hub/class_BaseHubHelper.php
application/hub/main/iterator/class_
application/hub/main/iterator/class_BaseIterator.php
application/hub/main/iterator/hub/class_HubPingIterator.php
application/hub/main/iterator/network/class_NetworkListenIterator.php
application/hub/main/iterator/pool/class_DefaultIterator.php
application/hub/main/iterator/pool/handler/class_Handler
application/hub/main/iterator/pool/handler/class_HandlerPoolIterator.php
application/hub/main/iterator/pool/shutdown/class_Shutdown
application/hub/main/iterator/pool/shutdown/class_ShutdownPoolIterator.php
application/hub/main/iterator/pool/tasks/class_TaskPoolIterator.php
application/hub/main/listener/class_
application/hub/main/listener/class_BaseListener.php
application/hub/main/listener/class_BaseListenerDecorator.php
application/hub/main/listener/tcp/class_
application/hub/main/listener/tcp/class_TcpListener.php
application/hub/main/listener/tcp/decorators/class_ClientTcpListenerDecorator.php
application/hub/main/listener/tcp/decorators/class_HubTcpListenerDecorator.php
application/hub/main/listener/udp/class_
application/hub/main/listener/udp/class_UdpListener.php
application/hub/main/listener/udp/decorators/class_ClientUdpListenerDecorator.php
application/hub/main/listener/udp/decorators/class_HubUdpListenerDecorator.php
application/hub/main/lists/class_
application/hub/main/lists/class_BaseList.php
application/hub/main/lists/groups/class_ListGroupList.php
application/hub/main/lists/pool/class_PoolEntriesList.php
application/hub/main/lists/query/local/class_LocalQueryList.php
application/hub/main/lists/tasks/class_TaskList.php
application/hub/main/nodes/boot/class_HubBootNode.php
application/hub/main/nodes/class_
application/hub/main/nodes/class_BaseHubNode.php
application/hub/main/nodes/list/class_HubListNode.php
application/hub/main/nodes/master/class_HubMasterNode.php
application/hub/main/nodes/regular/class_HubRegularNode.php
application/hub/main/pools/class_
application/hub/main/pools/class_BasePool.php
application/hub/main/pools/client/class_DefaultClientPool.php
application/hub/main/pools/listener/class_DefaultListenerPool.php
application/hub/main/queries/class_
application/hub/main/queries/class_BaseQuery.php
application/hub/main/queries/local/class_LocalQuery.php
application/hub/main/queues/class_
application/hub/main/queues/class_BaseQueue.php
application/hub/main/queues/client/class_LocalClientQueue.php
application/hub/main/resolver/command/console/class_HubConsoleCommandResolver.php
application/hub/main/resolver/controller/console/class_HubConsoleControllerResolver.php
application/hub/main/resolver/state/class_BaseStateResolver.php
application/hub/main/resolver/state/network/class_NetworkStateResolver.php
application/hub/main/states/class_
application/hub/main/states/class_BaseState.php
application/hub/main/states/client/class_BaseClientState.php
application/hub/main/states/hub/class_BaseHubState.php
application/hub/main/states/node/.htaccess [new file with mode: 0644]
application/hub/main/states/node/active/.htaccess [new file with mode: 0644]
application/hub/main/states/node/active/class_NodeActiveState.php [new file with mode: 0644]
application/hub/main/states/node/class_ [new file with mode: 0644]
application/hub/main/states/node/class_BaseNodeState.php [new file with mode: 0644]
application/hub/main/states/node/init/.htaccess [new file with mode: 0644]
application/hub/main/states/node/init/class_NodeInitState.php [new file with mode: 0644]
application/hub/main/states/node/virgin/.htaccess [new file with mode: 0644]
application/hub/main/states/node/virgin/class_NodeVirginState.php [new file with mode: 0644]
application/hub/main/tasks/class_
application/hub/main/tasks/class_BaseTask.php
application/hub/main/tasks/hub/announcement/class_HubSelfAnnouncementTask.php
application/hub/main/tasks/hub/class_HubSelfConnectTask.php
application/hub/main/tasks/hub/ping/class_HubPingTask.php
application/hub/main/tasks/hub/update/class_HubUpdateCheckTask.php
application/hub/main/tasks/idle/class_IdleLoopTask.php
application/hub/main/template/announcement/class_AnnouncementTemplateEngine.php
application/hub/main/visitor/class_
application/hub/main/visitor/class_BaseVisitor.php
application/hub/main/visitor/pool/class_
application/hub/main/visitor/pool/handler/class_Handler
application/hub/main/visitor/pool/shutdown/class_Shutdown
application/hub/main/visitor/pool/shutdown/class_ShutdownListenerPoolVisitor.php
application/hub/main/visitor/tasks/class_ActiveTaskVisitor.php
application/hub/starter.php
application/hub/templates/xml/announcement/self_announcement.xml

index 840120e22c03c1a63b0a73b78a4e97bf35d46079..9682bd40110a3d6135fa43b4609c34ae0170c1bd 100644 (file)
@@ -49,6 +49,8 @@ application/hub/interfaces/states/client/.htaccess -text
 application/hub/interfaces/states/client/class_ClientStateable.php -text
 application/hub/interfaces/states/hub/.htaccess -text
 application/hub/interfaces/states/hub/class_HubStateable.php -text
+application/hub/interfaces/states/node/.htaccess -text
+application/hub/interfaces/states/node/class_NodeStateable.php -text
 application/hub/interfaces/tasks/.htaccess -text
 application/hub/interfaces/tasks/class_Taskable.php -text
 application/hub/interfaces/visitor/.htaccess -text
@@ -97,6 +99,9 @@ application/hub/main/database/wrapper/class_NodeInformationDatabaseWrapper.php -
 application/hub/main/database/wrapper/class_NodeListDatabaseWrapper.php -text
 application/hub/main/decorators/.htaccess -text
 application/hub/main/decorators/class_BaseDecorator.php -text
+application/hub/main/factories/.htaccess -text
+application/hub/main/factories/states/.htaccess -text
+application/hub/main/factories/states/class_NodeStateFactory.php -text
 application/hub/main/filter/.htaccess -text
 application/hub/main/filter/activation/.htaccess -text
 application/hub/main/filter/activation/class_HubActivation -text
@@ -125,6 +130,7 @@ application/hub/main/filter/shutdown/class_HubShutdownDeinitQueuesFilter.php -te
 application/hub/main/filter/shutdown/class_HubShutdownFlushNodeListFilter.php -text
 application/hub/main/filter/shutdown/class_HubShutdownListenerPoolFilter.php -text
 application/hub/main/filter/shutdown/class_HubShutdownNodeFilter.php -text
+application/hub/main/filter/shutdown/class_HubShutdownTaskHandlerFilter.php -text
 application/hub/main/filter/task/.htaccess -text
 application/hub/main/filter/task/class_TaskHandlerInitializerFilter.php -text
 application/hub/main/handler/.htaccess -text
@@ -239,6 +245,15 @@ application/hub/main/states/client/class_BaseClientState.php -text
 application/hub/main/states/generic/.htaccess -text
 application/hub/main/states/hub/.htaccess -text
 application/hub/main/states/hub/class_BaseHubState.php -text
+application/hub/main/states/node/.htaccess -text
+application/hub/main/states/node/active/.htaccess -text
+application/hub/main/states/node/active/class_NodeActiveState.php -text
+application/hub/main/states/node/class_ -text
+application/hub/main/states/node/class_BaseNodeState.php -text
+application/hub/main/states/node/init/.htaccess -text
+application/hub/main/states/node/init/class_NodeInitState.php -text
+application/hub/main/states/node/virgin/.htaccess -text
+application/hub/main/states/node/virgin/class_NodeVirginState.php -text
 application/hub/main/tasks/.htaccess -text
 application/hub/main/tasks/class_ -text
 application/hub/main/tasks/class_BaseTask.php -text
index 3e62874fdf7eab5c0c79e3984769ec3b67a99f8e..053a4b1113452576ea58b9fe55040df4de6215b9 100644 (file)
@@ -22,7 +22,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0
- * @copyright  Copyright (c) 2007 - 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007 - 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  *
  * This program is free software: you can redistribute it and/or modify
index 9da6c2bfdb70ea13489468b16a91f3b8cdfa0ff4..623c27776beb420dd57e899889648a0cb8e208bb 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0
- * @copyright  Copyright (c) 2007 - 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007 - 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  *
  * This program is free software: you can redistribute it and/or modify
@@ -168,8 +168,8 @@ $cfg->setConfigEntry('hub_shutdown_flush_node_list_filter', 'HubShutdownFlushNod
 // CFG: HUB-SHUTDOWN-DEINIT-QUEUES-FILTER
 $cfg->setConfigEntry('hub_shutdown_deinit_queues_filter', 'HubShutdownDeinitQueuesFilter');
 
-// CFG: HUB-SHUTDOWN-LISTENER-POOL-FILTER
-$cfg->setConfigEntry('hub_shutdown_listener_pool_filter', 'HubShutdownListenerPoolFilter');
+// CFG: HUB-SHUTDOWN-TASK-HANDLER-FILTER
+$cfg->setConfigEntry('hub_shutdown_task_handler_filter', 'HubShutdownTaskHandlerFilter');
 
 // CFG: HUB-SHUTDOWN-NODE-FILTER
 $cfg->setConfigEntry('hub_shutdown_node_filter', 'HubShutdownNodeFilter');
@@ -189,6 +189,9 @@ $cfg->setConfigEntry('announcement_template_type', 'xml/announcement');
 // CFG: ANNOUNCEMENT-STACKER-CLASS
 $cfg->setConfigEntry('announcement_stacker_class', 'FiLoStacker');
 
+// CFG: STACKER-ANNOUNCEMENT-MAX-SIZE
+$cfg->setConfigEntry('stacker_announcement_max_size', 20);
+
 // CFG: NEWS-MAIN-LIMIT
 $cfg->setConfigEntry('news_main_limit', 5);
 
@@ -294,5 +297,17 @@ $cfg->setConfigEntry('local_query_list_class', 'LocalQueryList');
 // CFG: LOCAL-QUERY-CLASS
 $cfg->setConfigEntry('local_query_class', 'LocalQuery');
 
+// CFG: WEB-TEMPLATE-CLASS @OVERRIDE
+$cfg->setConfigEntry('web_template_class', 'ConsoleTemplateEngine');
+
+// CFG: NODE-INIT-STATE-CLASS
+$cfg->setConfigEntry('node_init_state_class', 'NodeInitState');
+
+// CFG: NODE-VIRGIN-STATE-CLASS
+$cfg->setConfigEntry('node_virgin_state_class', 'NodeVirginState');
+
+// CFG: NODE-ACTIVE-STATE-CLASS
+$cfg->setConfigEntry('node_active_state_class', 'NodeActiveState');
+
 // [EOF]
 ?>
index d68aca4828ac4d2d301d509bf6ece0b0746e1ab1..e469cca62216e84ecf82e982524e02e02e1a6d04 100644 (file)
@@ -15,7 +15,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 5f222924a04d1fc7906d74133e6ec6ecf18c3221..06b28e27e5ab2b87ba391508f5963a6776e58b1f 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0
- * @copyright  Copyright (c) 2007 - 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007 - 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  *
  * This program is free software: you can redistribute it and/or modify
index 11116ed318fd3d6e3d7c5e28e48533592e2031ab..b9daf47d1ddca8066fdd5f1247e63c8351b0e9c2 100644 (file)
@@ -5,7 +5,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0
- * @copyright  Copyright (c) 2007 - 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007 - 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  *
  * This program is free software: you can redistribute it and/or modify
index 34b5a2142f124989a47f3f424577fc2a3e4d5b07..5324192962e57f143e81038bf69a50e10bece959 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 19f1b60f0b8fd33893b243a80576bd856bede9f9..4affa7dcd4bdbf495e61fe56fb2e7b0481f3068b 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index fc7098ed7f8c8bdefb805d2eb8e179676517defa..1bbc2c178abd119edb4fc6112cb99a86ae5bb83c 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 6348edf2b61d716f72922bc3e197347db5717737..00da4d9bdeae8676de8678b2076854b1b76e8fca 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index e1b1c3e5708c8e44ffaf1a6c3f4592b9f793390e..0879bf76c07bae1a3a83b04c780747f785c9a33c 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 32d4ab3bc4e9c75cec21e43f9f6477990f3194bd..96eecc4943198446a2c6a68ae205441421c29e2c 100644 (file)
@@ -15,7 +15,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0
- * @copyright  Copyright (c) 2007 - 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007 - 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  *
  * This program is free software: you can redistribute it and/or modify
index 6299ff0c809968db5ddb5f2b031a229aa7122d4e..e4270e03621122a806a3c5df183b496c33b7bf29 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index e7775272ae1e83b02a80b9d0b7c751d4d4135ade..2c95227dca490bd78cd2d57c22e927d45e9250bc 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index fb4302141e00ff77f263d1234c0190fe01f6262a..6598e87430cf3fddbf19201f005de7da077ec646 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 45781cc44622ac8bbd6171deb291cb80e04c21d9..ba2d58e46ebc9b7f7d3ec0bcaeb26ed93241f592 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 2f7bfe858ace62248264747217b598eb28f750e1..9b6e4e5e3cc0bfdecd4291bfa13799f44a185721 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 60712ed18d9eba469efdb8468bfcedf05e8dd6cc..25d2bf3d7916c0934bf7f62335b4f3cbcbe9af7b 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 0d712d9c799a34a9d3037ab8242ce7656d4c555c..b76bb29b82af146aceb915ff20e17637003a5618 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  * @todo               We need to find a better name for this interface
@@ -52,9 +52,11 @@ interface NodeHelper extends FrameworkInterface {
         * based on many pseudo-random data. On any later run, unless the id
         * got not removed from database, it will be restored from the database.
         *
+        * @param       $requestInstance        A Requestable class
+        * @param       $responseInstance       A Responseable class
         * @return      void
         */
-       function bootstrapAcquireHubId ();
+       function bootstrapAcquireHubId (Requestable $requestInstance, Responseable $responseInstance);
 
        /**
         * Activates the hub by doing some final preparation and setting
@@ -107,3 +109,4 @@ interface NodeHelper extends FrameworkInterface {
 
 //
 ?>
+
index 8a95117481f697373ee5571adf9f7fbbfec5a802..a63b2a4d8eb6e221532145027bc096dc20d0dfb0 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 73a97e409c06030994498ad5efcee6cb30e16cec..1bb948572c3e36b903b541072687d8ac2b1d72eb 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 162d8a6c7dc9cab5b2da6b92364531eb76f2bb94..597dc2ba59406449f24e0881da01cbe14c48180b 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 0d40f05730fd86fdd65d682a6b9fd5022952e2c8..1cb1eff6192ddd8d5c77945066c70c6c7f3dc0eb 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 5bb2b9668e056cd91643432e75371adf72a625cb..9e3fe30a9ed3ec4bf663b3b7c6382b53649be31f 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 8d73e2b8c12b5e4b1b45c79e78d0b50ba6647543..b9f6e5be9b322761cc6e71d73b00405271ca7ddf 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 3c205ba2c61b4aeceda305c4c7565c0268428183..9b0755c95241036bb7a28dd2555d93fa3c0af669 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index de99678755fc30a13544f7faf09c4107cce9f139..9ec1c39b7bbe5ebda03d74f1aad0b4bc1fb76b8c 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 47d9a785cc2744c15f5b94cd014116c330b5f799..d1ff9feec6f190bd1fc16eabb23c7ad3e76919ef 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
diff --git a/application/hub/interfaces/states/node/.htaccess b/application/hub/interfaces/states/node/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/hub/interfaces/states/node/class_NodeStateable.php b/application/hub/interfaces/states/node/class_NodeStateable.php
new file mode 100644 (file)
index 0000000..96039ba
--- /dev/null
@@ -0,0 +1,28 @@
+<?php
+/**
+ * An interface for node states
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface NodeStateable extends Stateable {
+}
+
+//
+?>
index a32e0af5ef8b6e439a85369534bdaaf23180583f..abd12cd7cc61a5fb3d5cb1a6f191754f937810bb 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 6211f0548d8afb63283a92b398d5bd529befc875..159bcc5170820e8f6eeef763a838337acce016f6 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -23,7 +23,7 @@
  */
 interface Visitable extends FrameworkInterface {
        /**
-        * Accepts the visitor to rpocess the visit "request"
+        * Accepts the visitor to process the visit "request"
         *
         * @param       $visitorInstance        An instance of a Visitor class
         * @return      void
index b098a70e6259864148186a8b5028892493afd1f9..328babd94a48db21f536a61d1b4ad97bb16e294d 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index baf86edcc3719ce074499d07a5e6a6949d6cdccc..78fcc2ef95f64b8017e7f3066f7b16b64d6f2cfd 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index ef962715c063aaf2f8dad22f4cb7bc853a8520ac..69041868e62fe71ee1477c25772a08abdc70c2d5 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index fa2da2c53c1a504463d825f7bd9e889aa2114ed9..fdd27bb944d1c6d6e42272c5587ecb807932b92f 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 6a9b6c8e0f9116af2a52277ddd70a51404b71de8..970d3fd7555b80ddee62991ba8610cac3162edd2 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 109b75d3ab8b2f06c2d92b4daaf70e0c10713dfb..5f17c97b852779be8c8b10da4242fce12027a237 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 4e59d8fe77ddeeecd74fc86551df41d046e2b214..d88106b0bbdc8d99738314de31072987bc59976a 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 40093324eeae62369fc739d422efcb0a122290fd..cb3523c729bb4037cbd3e30dfba7d9f09eaa9b38 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 5b1f37c69195123bb2f575acb55d9a49be1a9719..3fa42e466bf360e4457888b524e89b66027b4bed 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0
- * @copyright  Copyright (c) 2007 - 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007 - 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  *
  * This program is free software: you can redistribute it and/or modify
index ea4538679e37fa0cf26e93d3258a6b8a62846733..698f097afa1c9e39219f099aeca9e9ed957dc39d 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index d0122d6156f2964ebf73bca81d9f3d988ae52a2f..5e48c51be23dbf0a212d408ec5a5e68e900e5dc5 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index c741aad5616bd9ab026871a9acdfefcb0284e63d..6a4608d536dee8c12a4edb7ffa07f14ec3c35ba1 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 424717577e9eb2506806e02ef969940b61ca22d9..c2c4a65a72a8481d0d726ef01917ac803283df90 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -55,6 +55,7 @@ class HubConsoleMainCommand extends BaseCommand implements Commandable {
         * @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        Try to create a HubActivationTask or so
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
                // Get a registry and the application instance from it
@@ -88,8 +89,8 @@ class HubConsoleMainCommand extends BaseCommand implements Commandable {
                // ----------------------------- Main loop ----------------------------
                // This is the main loop. Queried calls should come back here very fast
                // so the whole application runs on nice speed. This while-loop goes
-               // until the hub is no longer active.
-               while (($nodeInstance->isHubActive()) && ($handlerInstance->hasTasksLeft())) {
+               // until the hub is no longer active or all tasks are killed.
+               while (($nodeInstance->determineIfHubIsActive()) && ($handlerInstance->hasTasksLeft())) {
                        // Handle all tasks here
                        $handlerInstance->handleTasks();
                } // END - while
@@ -126,7 +127,7 @@ class HubConsoleMainCommand extends BaseCommand implements Commandable {
                // 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_listener_pool_filter'));
+               $controllerInstance->addShutdownFilter(ObjectFactory::createObjectByConfiguredName('hub_shutdown_task_handler_filter'));
 
                // This is the last generic filter
                $controllerInstance->addShutdownFilter(ObjectFactory::createObjectByConfiguredName('hub_shutdown_node_filter'));
index edcda15ea7747888a97ebefe92e3b8d68f835ae1..304a1e37f803b40f9360f59e758b6eefdc77bf13 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 363fcc1d951566a56cd1edff9f9eb8eaec1821c6..c0bb530ebb84408e91c1c47394cd5542b18bdf4b 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  * @todo               Find an interface for: handleAllQueries()
@@ -57,7 +57,7 @@ class ???QueryConnector extends BaseQueryConnector implements Connectable, Visit
        }
 
        /**
-        * Accepts the visitor to rpocess the visit "request"
+        * Accepts the visitor to process the visit "request"
         *
         * @param       $visitorInstance        An instance of a Visitor class
         * @return      void
index f84666857a03774256053459b40eaaf02277b44a..e7ff1cac3da593a060de72e378d5ead74abd78e7 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index d818abaf42a3588aff2100b57c0b6802cff3fc41..2d35cae8a60b223dad1ed4b025685955e4e773be 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  * @todo               Find an interface for: handleAllQueries()
@@ -71,7 +71,7 @@ class LocalQueryConnector extends BaseQueryConnector implements Connectable, Vis
        }
 
        /**
-        * Accepts the visitor to rpocess the visit "request"
+        * Accepts the visitor to process the visit "request"
         *
         * @param       $visitorInstance        An instance of a Visitor class
         * @return      void
index 066db0bda0939897fc0958ff29d6c6ca66ae7834..216eaa69551d969cd95b45ff5ed79720c81d29f8 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 6ea83de0c5b8d4df534289bcea0f31770f73e14a..bb1177c46b92e50930a9ec4320f4df64b6178a9c 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 95abad132e66e4954fc47cd94523df459a37363b..30f4f91e9d011ba544e200ae7a7346277829ad49 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 842bd2606d1c20756144b994e7e968cb30933d09..55bb98d5616750af6cb2dcff8e9818336377dd71 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -32,7 +32,7 @@ class HubConsoleDefaultNewsController extends BaseController implements Controll
                parent::__construct(__CLASS__);
 
                // Init additional filter chains
-               foreach (array('bootstrap', 'activation', 'shutdown') as $filterChain) {
+               foreach (array('bootstrap', 'activation','shutdown') as $filterChain) {
                        $this->initFilterChain($filterChain);
                } // END - foreach
        }
index e8550f28152917397de10c1452b402bf562e5cbb..6a736d04081afa5f6cb31d8eef5d48a4974edae5 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 7d4acea49ae95ede34d964acd3e851b3388d3ef2..676ad0a5b526d213f86f2832c3df0869663073e8 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 43b6e5d05e3c1c2ab638bd3e16a40eb39970e443..c83722916d625289f88febdabfa28dbd18dc56cf 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
diff --git a/application/hub/main/factories/.htaccess b/application/hub/main/factories/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/hub/main/factories/states/.htaccess b/application/hub/main/factories/states/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/hub/main/factories/states/class_NodeStateFactory.php b/application/hub/main/factories/states/class_NodeStateFactory.php
new file mode 100644 (file)
index 0000000..1cb5c96
--- /dev/null
@@ -0,0 +1,57 @@
+<?php
+/**
+ * A factory class for ??? states
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class NodeStateFactory extends ObjectFactory {
+       /**
+        * Creates an instance of a configurable node state and sets it in the
+        * given node instance.
+        *
+        * @param       $stateName              Name of the node state
+        * @param       $nodeInstance   A NodeHelper class instance
+        * @return      $stateInstance  A Stateable class instance
+        */
+       public static final function createNodeStateInstanceByName($stateName, NodeHelper $nodeInstance) {
+               // Then construct the class' configuraton entry
+               $className = 'node_' . $stateName . '_state_class';
+
+               // Get a class from that configuration entry
+               $stateInstance = self::createObjectByConfiguredName($className, array($nodeInstance));
+
+               // Once we have that state, set it in the node instance
+               $nodeInstance->setNodeStateInstance($stateInstance);
+
+               // For any purposes, return the state instance
+               return $stateInstance;
+       }
+
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+}
+?>
index babe0647026d0323e9af67a8fbbdbf0f9c88b7f7..67db3954c0f2709620733cb0e44bc483f47f54f7 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 8fbcced236981aabffd50b59de00c9a20b54f0e5..47509105e0d2f34b9067c3bbfde38f707f490cb3 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 37520419c403af5bfacf9b082fdb9d84b0e2b805..5290fe48e83a4d407f06e2e397a54c61b2413431 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 0836c04b4ae05ae9b632ec7e4ae69606ca8a108a..f551ef47b7591c74e7b59193e56a1fa6505a87ab 100755 (executable)
@@ -1,76 +1,3 @@
 <?php
-/**
- * A ??? filter for bootstrapping
- *
- * @author             Roland Haeder <webmaster@ship-simu.org>
- * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
- * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.ship-simu.org
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-class HubBootstrapAquireHubIdFilter 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 createHubBootstrapAquireHubIdFilter () {
-               // Get a new instance
-               $filterInstance = new HubBootstrapAquireHubIdFilter();
-
-               // 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');
-
-               // Sanity-check on it
-               if (is_null($nodeInstance)) {
-                       // Throws a FilterChainException to stop further processing
-                       throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
-               } // END - if
-
-               // --------------------- 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();
-       }
-}
-
-// [EOF]
+// @DEPRECATED
 ?>
index cb7474687925fc46efa4955ccd12dce367da54f8..d4a4d4eea64ab1e189bc591bd21b82d86a60ac9d 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 70fddac66319a892828f844b3a87fc2acdf58ca4..f551ef47b7591c74e7b59193e56a1fa6505a87ab 100755 (executable)
@@ -1,74 +1,3 @@
 <?php
-/**
- * A GenSessionId filter for bootstrapping
- *
- * @author             Roland Haeder <webmaster@ship-simu.org>
- * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
- * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.ship-simu.org
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-class HubBootstrapGenSessionIdFilter 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 createHubBootstrapGenSessionIdFilter () {
-               // Get a new instance
-               $filterInstance = new HubBootstrapGenSessionIdFilter();
-
-               // 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');
-
-               // Sanity-check on it
-               if (is_null($nodeInstance)) {
-                       // Throws a FilterChainException to stop further processing
-                       throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
-               } // END - if
-
-               // ------------------- 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
 ?>
index e922b5798b3fdf78e5fa6b2e1bf8c7dc80d7a2d2..82a828c1a6dc2dbd2b5d7e6b82fc65a218d66a6e 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -62,7 +62,7 @@ class HubBootstrapGenerateHubIdFilter extends BaseFilter implements Filterable {
                // 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();
+               $nodeInstance->bootstrapAcquireHubId($requestInstance, $responseInstance);
        }
 }
 
index e8ae454ae02d1774bb3ff5349c9e4d09b9d423a5..a37020d90fa61b3fc2ba25ee33e10ea8f006ab5e 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 5bb4f15729290d18b264d1dabdf3eded450494fa..702b18f5f0f5e57699f0bad6fc98051daffcf9e1 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 7fdcd3adafb81c17222a62b80010c87427051eaa..91b268762bd3b7ffc5e7201bbeb1982b0365a4d4 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 6def96e30b361bce7e39664fb50189cc6c70b7e4..0232388928132cb5869b4c80aebcb9554454b7dd 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index f432f10795e97c99d29a1c1c9e8ba52415123218..1c71f95b46131cb04c59ed7fa760bdb43fa9c9be 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 52f584f362e59ad65b3a38753b044abbf2a0061c..632d3280a8907b26ff67a47d33d17644ff3cbb3e 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 29e7282c47b548763a9b18ba0d904fb47f1e93a7..d348d4b7c91557729e799cd8496a17897f3ce0bf 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 969e7cad9a3840ec1e7871df4ff573442b97956e..32521e4563fe9db8aa27f82319434e0d0ce3db81 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 55471b16125c228d02b41addddef447d6c1b0f4d..097e693c77b5ee389705d3530426f1f91ac9007a 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 2012ca5d47322d9cb7193d2c4c7b8cf3b9e171a8..e88e5e377a8d2e0b27b71f8396ab167d53af9a51 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -51,11 +51,26 @@ class NodePhpRequirementsFilter extends BaseFilter implements Filterable {
         * @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
+        * @throws      FilterChainException    If a required PHP function is not available
+        * @todo        Add more test and try to add an extra message to the thrown exception
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
-               // Implement this!
-               $this->partialStub('Please implement this method.');
+               // By default, the requirement check is passed and zero checks are failed
+               $checkPassed = true;
+               $checksFailed = 0;
+
+               // Socket support is essential...
+               if (!function_exists('socket_create')) {
+                       // Test failed
+                       $checkPassed = false;
+                       $checksFailed++;
+               } // END -if
+
+               // Are all tests passed?
+               if ($checkPassed === false) {
+                       // Throw an exception
+                       throw new FilterChainException($this, self::FILTER_CHAIN_INTERCEPTED);
+               } // END - if
        }
 }
 
index aeefaf44f9096b138f90e5118f9122dc91f39ea6..caf1a8e6518da9e9c3b01e5e0aa6defbcd6701c3 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index dea5619e3f220a71dbe4aa0025b99110b3d15b08..35129feaafb9fa5eb0efa903f6b0004c0884ca10 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 28c169e771ae58c4f59b676ac096d36a5553f51b..22b0d2f99149570eb50a899fac52568e6509080a 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index f9e725df560fcfb7741a7b6a562e04fbc52daa8f..f551ef47b7591c74e7b59193e56a1fa6505a87ab 100644 (file)
@@ -1,76 +1,3 @@
 <?php
-/**
- * A ListenerPool filter for shutting down the node.
- *
- * @author             Roland Haeder <webmaster@ship-simu.org>
- * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
- * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.ship-simu.org
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-class HubShutdownListenerPoolFilter 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 createHubShutdownListenerPoolFilter () {
-               // Get a new instance
-               $filterInstance = new HubShutdownListenerPoolFilter();
-
-               // 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 listener pool instance
-               $listenerPoolInstance = $nodeInstance->getListenerPoolInstance();
-
-               // Sanity-check on it
-               if (is_null($listenerPoolInstance)) {
-                       // Throws a FilterChainException to stop further processing
-                       throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
-               } // END - if
-
-               // Now shutdown this one done
-               $listenerPoolInstance->doShutdown();
-       }
-}
-
-// [EOF]
+// @DEPRECATED
 ?>
index 56919564ef8554e7fc1dbaa230f48ee18feab801..8d3807f32e1f949cb82cd82abc6fc07146df7a3c 100644 (file)
@@ -6,7 +6,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
diff --git a/application/hub/main/filter/shutdown/class_HubShutdownTaskHandlerFilter.php b/application/hub/main/filter/shutdown/class_HubShutdownTaskHandlerFilter.php
new file mode 100644 (file)
index 0000000..dd99c7b
--- /dev/null
@@ -0,0 +1,67 @@
+<?php
+/**
+ * A TaskHandler filter for shutting down the node.
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class 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 final static 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]
+?>
index b3fb45146ee775f79f90e7150b9118a328aac575..dae02e0443591ca67b69c2444d4ac819197afcbe 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index e8c9d36d5ac01fbdd54810dc70aad1810411ea13..bb33e383a98b07af345be579f9ac7afbfe49ea80 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index ca4023419cf885786bd55781d6a16de9a4372fc5..7c02b75e59aebeb8735f2724032a3073303fb2ad 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index b130b4662905ea54df957a7298ff2006f4f20f20..4f7c3214109c3faef29b2e75580b301cc3087222 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 816b836398ac6f958d33dbd521a8455531b88264..8b3e847dd17ae42cc80739ee53e0c8d21fa4dfc5 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 9681823326a5932faa2402ce5dee0fd13411f322..2f6eab4682431d66adcf7ba7a73960978940b541 100644 (file)
@@ -138,7 +138,7 @@ socket_close($mainSocket);
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index c42684b1fd5d8e476a677f3cadfb6b6910809aae..d2622d47734b77911ee5f226d6a9b88d0ea8e85d 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index c62e7fca85099bc54e786f149c3be1509fc27a04..edf93218d0484e93fbe98a81eaa32115909c9fd8 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index a53edd931ffb72fdad297b0a2d7751a735c8f6df..9799fb06dd3f7d72430d7dff668583a1662a5f14 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -161,6 +161,17 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask {
                $this->listInstance->updateCurrentEntryByHash($hash, $taskEntry);
        }
 
+       /**
+        * Unregisters the given task
+        *
+        * @param       $taskName       Name of the task
+        * @return      void
+        */
+        private function unregisterTask ($taskName) {
+               // Remove the entry
+               $this->listInstance->removeEntry('tasks', $taskName);
+        }
+
        /**
         * Registers a task with a task handler.
         *
@@ -241,6 +252,53 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask {
                // Go to next entry
                $this->iteratorInstance->next();
        }
+
+       /**
+        * Shuts down all tasks and the task handler itself. This method should be
+        * called from a corresponding filter class.
+        * 
+        * @return      void
+        */
+       public function doShutdown () {
+               // Should we rewind?
+               if (!$this->iteratorInstance->valid()) {
+                       // Rewind to the beginning for next loop
+                       $this->iteratorInstance->rewind();
+               } // END - if
+
+               // Debug message
+               $this->debugOutput('TASK-HANDLER: Shutting down all ' . $this->listInstance->count() . ' tasks...');
+
+               // Remember all tasks that has been shutdown for removal
+               $tasks = array();
+
+               // Shutdown all tasks in once go
+               while ($this->iteratorInstance->valid()) {
+                       // Get current entry
+                       $current = $this->iteratorInstance->current();
+
+                       // Output debug message
+                       $this->debugOutput('TASK-HANDLER: Shutting down task ' . $current['id'] . ' (taskInstance=' . $current['task_instance']->__toString() . ') ...');
+
+                       // Shutdown the task
+                       $current['task_instance']->doShutdown();
+
+                       // Remember this task
+                       $tasks[] = $current;
+
+                       // Advance to next one
+                       $this->iteratorInstance->next();
+               } // END - while
+
+
+               // Debug message
+               $this->debugOutput('TASK-HANDLER: Shutdown of all tasks completed.');
+
+               // Remove all tasks
+               foreach ($tasks as $entry) {
+                       $this->unregisterTask($entry);
+               } // END - foreach
+       }
 }
 
 // [EOF]
index da244d40553e7b5e8b89427ea30f60556eb90173..3ff692aa37379445fef2b7ce6d61af3b2b7bd841 100644 (file)
@@ -4,9 +4,10 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
+ * @todo               Find an interface for hub helper
  *
  * 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
@@ -53,8 +54,12 @@ class HubDescriptorHelper extends BaseHubHelper {
         * Loads the announcement descriptor for parsing
         *
         * @return      void
+        * @todo        Rewrite the ->renderXmlContent() call to no arguments
         */
        public function loadAnnouncementDescriptor () {
+               // Debug message
+               $this->debugOutput('HELPER: Starting with announcement to upper hubs...');
+
                // Get the application instance
                $appInstance = Registry::getRegistry()->getInstance('app');
 
@@ -78,7 +83,6 @@ class HubDescriptorHelper extends BaseHubHelper {
 
                // Render it here
                $this->getTemplateInstance()->renderXmlContent($announcementContent);
-               die(__METHOD__."\n");
        }
 }
 
index 46a974e53ac08cbe9ce07ea0954ae8f6bcc11bed..b47de1f53c724c9199e200191467e2fcf0130eb8 100644 (file)
@@ -7,6 +7,7 @@
  * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
+ * @todo               Find an interface for hub helper
  *
  * 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
index ffec8f3b6ed345b2dfd4d8bd7999417b57e88ce7..54f8157a96c087d7508d8461e9dfcb6115739e3c 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 0a44b5d6e2dd14067c72f176db716e7cbf0ed944..0c43c5dedf56bafd710e5fac3de984aef76e9984 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 82745deccb938ce559b42d6d554c96c746361596..ed842d1f9e7e107cb187aa5df8bcf2b5795caa2c 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 4c21ee7ccce3d98f10e01f9a8b95d5dba17a07ad..7003757972664a14ac0cf6307b8fa3b35bd3b543 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index e08bf97518ad321462fbf20627696163a42ea4c6..82aae67231be0f014267c9be13e06c5fd754e70a 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  * @todo               This current implementation is not recommended, use a
index 230d0568ee39a55722280cc975658fe3a033a5c0..949c6c1882c99adc9fc814d4a8307c5645f282b2 100755 (executable)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index febcac4451919b7bfb8027cb246365296a4e5153..a356fc0ac23aa4cba326b6715c3eea0bdc33eb38 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 46ae930060b8dc64bb0fea1f5003f77643bb93d8..2a7b124b5ef8634d2c06ba677b69e34ae56a7f95 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  * @todo               This current implementation is not recommended, use a
index 758ab9b9b4a81781c6865d917b7a9e22fbae3904..5aad3b5269d536797886d5e6992db6a3c7007612 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index b307ce46b1efd88231286683c8352c06c04f9edd..39d4041eabd906aaa200411ad9b54105eceafdd5 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 25c79b69a4ba3904228c6b1d6bcaf00cd42a28ed..f037f26ea95bacd58a7328e9280aaa9531f701b2 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  * @todo               This current implementation is not recommended, use a
index 199e8c7fc598cf7fe86f9a6d7b779020f36f30a1..546266a21bec9559d552deb2891fb6eec71c248d 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 8b28acd0c16b4fc2c252463792c0b093c7c57de5..6c921f5bb2d2697bae3cfaa0d92eb5077f2a260f 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -225,7 +225,7 @@ class BaseListener extends BaseHubSystem implements Visitable {
        }
 
        /**
-        * Accepts the visitor to rpocess the visit "request"
+        * Accepts the visitor to process the visit "request"
         *
         * @param       $visitorInstance        An instance of a Visitor class
         * @return      void
index dcf284649d2e9e649cd9a7e6ff25197e28769c1d..5b9889e202c4d663c5d8003fd21f2dd0d5325444 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -61,7 +61,7 @@ class BaseListenerDecorator extends BaseDecorator implements Visitable {
        }
 
        /**
-        * Accepts the visitor to rpocess the visit "request"
+        * Accepts the visitor to process the visit "request"
         *
         * @param       $visitorInstance        An instance of a Visitor class
         * @return      void
@@ -71,7 +71,7 @@ class BaseListenerDecorator extends BaseDecorator implements Visitable {
                $visitorInstance->visitDecorator($this);
 
                // Visit the covered class
-               $visitorInstance->visitListener($this);
+               $visitorInstance->visitListener($this->getListenerInstance());
        }
 }
 
index 9681823326a5932faa2402ce5dee0fd13411f322..2f6eab4682431d66adcf7ba7a73960978940b541 100644 (file)
@@ -138,7 +138,7 @@ socket_close($mainSocket);
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 4881e4f2f3d2443420f52ce09a93210ffc151329..2bfc9ce9334bad2cbea74d801f01cdb68da949d8 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 7dfb77868c74d23db333232d09f1ca32b352950f..a55e2d4130ae0ce173a84cf56fa42a130caeebed 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Client Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 0335e98ce17c598bf2321ebb784c3d1edf21e315..b3a6013c77986c5bee14c86f4373596977ecd778 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index c066c086e9049b5e83e2f7b2daa469423fca1e5b..4dda18d8cf3df64442eec4322d5b9d73e409806d 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 1c770c63f1c1102ebf5044da894bb9ac1bec5be4..764b6bac28601a70a6c00d51d2823fb914f949bc 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index fc9c40cb29b71ec19735d84d0a45494f93b27c80..b6d2fdaf15191ce5270acd2f7aff450981312f16 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Client Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 09a6c4462169abbc9a64c21349c529306b618623..4595ab6b3bc35a3366b34783800405ab619bbabb 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index fa85737877e9cd2fabab8ee5805ffa61b77890b3..453cb0df06b46382a8bdb5327d6666898bdf216a 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index fe416e104c88838004e626fd0070986ac05c9586..3755b2605d28b83deaa87499b014097aad1f4afc 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -190,7 +190,7 @@ class BaseList extends BaseHubSystem implements IteratorAggregate, Countable {
 
                // Generate hash
                $hash = $this->generateHash($groupName, $groupName, $entry);
-               //* DEBUG: */ $this->debugOutput(__METHOD__.'('.$this->__toString().'): hash='.$hash.'');
+               //* DEBUG: */ $this->debugOutput(__METHOD__ . ': groupName=' . $groupName . ', entry=' . $entry . ', hash=' . $hash);
 
                // Add the hash to the index
                $this->listIndex[] = $hash;
@@ -202,6 +202,34 @@ class BaseList extends BaseHubSystem implements IteratorAggregate, Countable {
                //* DEBUG: */ $this->debugOutput(__METHOD__.'('.$this->__toString().'): '.$groupName . ' - FINISHED');
        }
 
+       /**
+        * Removes given entry from the list group
+        *
+        * @param       $groupName      Group where we should remove the entry from
+        * @param       $entry          The entry we should remove
+        * @return      void
+        * @throws      NoListGroupException    If the given group is not found
+        */
+       public function removeEntry ($groupName, $entry) {
+               //* DEBUG: */ $this->debugOutput(__METHOD__.'('.$this->__toString().'): '.$groupName . ' - START');
+               // Is the group already added?
+               if (!$this->isGroupSet($groupName)) {
+                       // Throw the exception here
+                       throw new NoListGroupException(array($this, $groupName), self::EXCEPTION_GROUP_NOT_FOUND);
+               } // END - if
+
+               // Generate hash
+               $hash = $this->generateHash($groupName, $groupName, $entry);
+               //* DEBUG: */ $this->debugOutput(__METHOD__ . ': groupName=' . $groupName . ', entry=' . $entry . ', hash=' . $hash);
+
+               // Remove it from the list ...
+               unset($this->listEntries[$hash]);
+
+               // ... and hash list as well
+               unset($this->listIndex[array_search($hash, $this->listIndex)]);
+               //* DEBUG: */ $this->debugOutput(__METHOD__.'('.$this->__toString().'): '.$groupName . ' - FINISHED');
+       }
+
        /**
         * Generates a hash from given group, sub group and entry
         *
index 19bae27436494d804652772c64289000c906ada7..8fabaf62e93e56b7cd1dbcf02a063839d8e7cd48 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 8fce67eebf7396b3f0fe0d9058ad7464fec31eea..802820a260acb76a52a2857262a591ed2cd8bc56 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 83475e098fbcc5b696111bb2be1fcb191a7374cf..82b3141131f10dac27ae178025a8c6ea93e5ebcb 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 80746499cf43bf8b4172bd0b670ec32a81cf7d12..170fd7a9f4ee62397ffd9be5e2fa7787ba69b499 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 7ba79688958a5093430354fe95cf41fed7db43cf..e4cf363dccc6e43bc9eb6b2773059393bdd2edd0 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index b7a73281c970a2ec3c312be162fd691f5a109213..02a4cbd631bfc3a79f449d572604a759edfc81c1 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 6236d7be800f9c8fd396289253f728c3eee97727..b6ec9d84ed9e802e8a6f34061f2fdd1cadc5d15d 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -25,16 +25,6 @@ class BaseHubNode extends BaseHubSystem implements Updateable {
        // Exception constants
        const EXCEPTION_HUB_ALREADY_ANNOUNCED = 0xe00;
 
-       /**
-        * Node id
-        */
-       private $nodeId = '';
-
-       /**
-        * Session id
-        */
-       private $sessionId = '';
-
        /**
         * IP/port number of bootstrapping node
         */
@@ -51,14 +41,15 @@ class BaseHubNode extends BaseHubSystem implements Updateable {
        private $listenerPoolInstance = null;
 
        /**
-        * Wether the hub is active (true/false)
+        * Wether this node is anncounced (KEEP ON false!)
+        * @deprecated
         */
-       private $hubIsActive = false;
+       private $hubIsAnnounced = false;
 
        /**
-        * Wether this node is anncounced (KEEP ON false!)
+        * Node state instance
         */
-       private $hubIsAnnounced = false;
+       private $nodeStateInstance = null;
 
        /**
         * Protected constructor
@@ -69,6 +60,20 @@ class BaseHubNode extends BaseHubSystem implements Updateable {
        protected function __construct ($className) {
                // Call parent constructor
                parent::__construct($className);
+
+               // Init node state which sets the state to 'init'
+               $this->initNodeState();
+       }
+
+       /**
+        * Initializes the node's state which sets it to 'init'
+        *
+        * @return      void
+        */
+       private function initNodeState() {
+               // Get the state factory and create the initial state, we don't need
+               // the state instance here
+               NodeStateFactory::createNodeStateInstanceByName('init', $this);
        }
 
        /**
@@ -78,16 +83,18 @@ class BaseHubNode extends BaseHubSystem implements Updateable {
         * @return      void
         */
        private final function setNodeId ($nodeId) {
-               $this->nodeId = (string) $nodeId;
+               // Set it config now
+               $this->getConfigInstance()->setConfigEntry('node_id', (string) $nodeId);
        }
 
        /**
         * Getter for node id
         *
-        * @return      $nodeId         Our new node id
+        * @return      $nodeId         Current node id
         */
        private final function getNodeId () {
-               return $this->nodeId;
+               // Get it from config
+               return $this->getConfigInstance()->getConfigEntry('node_id');
        }
 
        /**
@@ -109,6 +116,25 @@ class BaseHubNode extends BaseHubSystem implements Updateable {
                return $this->listenerPoolInstance;
        }
 
+       /**
+        * Setter for node state instance
+        *
+        * @param       $nodeStateInstance      Node's current state instance
+        * @return      void
+        */
+       public final function setNodeStateInstance (NodeStateable $nodeStateInstance) {
+               $this->nodeStateInstance = $nodeStateInstance;
+       }
+
+       /**
+        * Getter for node state instance
+        *
+        * @return      $nodeStateInstance      Node's current state instance
+        */
+       public final function getNodeStateInstance () {
+               return $this->nodeStateInstance;
+       }
+
        /**
         * Setter for session id
         *
@@ -116,16 +142,16 @@ class BaseHubNode extends BaseHubSystem implements Updateable {
         * @return      void
         */
        private final function setSessionId ($sessionId) {
-               $this->sessionId = (string) $sessionId;
+               $this->getConfigInstance()->setConfigEntry('session_id', (string) $sessionId);
        }
 
        /**
         * Getter for session id
         *
-        * @return      $sessionId              Our new session id
+        * @return      $sessionId              Current session id
         */
        public final function getSessionId () {
-               return $this->sessionId;
+               return $this->getConfigInstance()->getConfigEntry('session_id');
        }
 
        /**
@@ -156,6 +182,26 @@ class BaseHubNode extends BaseHubSystem implements Updateable {
                return $this->bootIpPort;
        }
 
+       /**
+        * "Getter" for a printable state name
+        */
+       public final function getPrintableState () {
+               // Default is 'null'
+               $stateName = 'null';
+
+               // Get the state instance
+               $stateInstance = $this->getNodeStateInstance();
+
+               // Is it an instance of NodeStateable?
+               if ($stateInstance instanceof NodeStateable) {
+                       // Then use that state name
+                       $stateName = $stateInstance->getStateName();
+               } // END - if
+
+               // Return result
+               return $stateName;
+       }
+
        /**
         * Checks wether the given IP address matches one of the bootstrapping nodes
         *
@@ -217,7 +263,7 @@ class BaseHubNode extends BaseHubSystem implements Updateable {
                // Output all lines
                $this->debugOutput(' ');
                $this->debugOutput($app->getAppName() . ' v' . $app->getAppVersion() . ' - ' . $this->getRequestInstance()->getRequestElement('mode') . ' mode active');
-               $this->debugOutput('Copyright (c) 2007 - 2008 Roland Haeder, 2009 Hub Developer Team');
+               $this->debugOutput('Copyright (c) 2007 - 2008 Roland Haeder, 2009, 2010 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');
@@ -230,9 +276,11 @@ class BaseHubNode extends BaseHubSystem implements Updateable {
         * based on many pseudo-random data. On any later run, unless the id
         * got not removed from database, it will be restored from the database.
         *
+        * @param       $requestInstance        A Requestable class
+        * @param       $responseInstance       A Responseable class
         * @return      void
         */
-       public function bootstrapAcquireHubId () {
+       public function bootstrapAcquireHubId (Requestable $requestInstance, Responseable $responseInstance) {
                // Get a wrapper instance
                $wrapperInstance = ObjectFactory::createObjectByConfiguredName('node_info_db_wrapper_class');
 
@@ -304,6 +352,9 @@ class BaseHubNode extends BaseHubSystem implements Updateable {
 
                // Output message
                $this->debugOutput('BOOTSTRAP: Created new session-id: ' . $this->getSessionId() . '');
+
+               // Change the state because the node has auired a hub id
+               $this->getNodeStateInstance()->nodeGeneratedSessionId();
        }
 
        /**
@@ -383,24 +434,6 @@ class BaseHubNode extends BaseHubSystem implements Updateable {
                $this->getResultInstance()->add2UpdateQueue($updateInstance);
        }
 
-       /**
-        * Getter for $hubIsActive attribute
-        *
-        * @return      $hubIsActive    Wether the hub is activer
-        */
-       public final function isHubActive () {
-               return $this->hubIsActive;
-       }
-
-       /**
-        * Setter for $hubIsActive attribute
-        *
-        * @param       $hubIsActive    Wether the hub is activer
-        */
-       public final function enableHubIsActive ($hubIsActive = true) {
-               $this->hubIsActive = $hubIsActive;
-       }
-
        /**
         * Announces this hub to the upper (bootstrap or list) hubs. After this is
         * successfully done the given task is unregistered from the handler.
@@ -408,6 +441,7 @@ class BaseHubNode extends BaseHubSystem implements Updateable {
         * @param       $taskInstance   The task instance running this announcement
         * @return      void
         * @throws      HubAlreadyAnnouncedException    If this hub is already announced
+        * @todo        Change the first if() block to check for a specific state
         */
        public function announceSelfToUpperNodes (Taskable $taskInstance) {
                // Is this hub node announced?
@@ -416,12 +450,30 @@ class BaseHubNode extends BaseHubSystem implements Updateable {
                        throw new HubAlreadyAnnouncedException($this, self::EXCEPTION_HUB_ALREADY_ANNOUNCED);
                } // END - if
 
+               // Debug output
+               $this->debugOutput('HUB: Self-announcement: START (taskInstance=' . $taskInstance->__toString(). ')');
+
                // Get a helper instance
                $helperInstance = ObjectFactory::createObjectByConfiguredName('hub_descriptor_class', array($this));
 
                // Load the announcement descriptor
                $helperInstance->loadAnnouncementDescriptor();
-               die("\n");
+
+               // Set some dummy configuration entries, e.g. node_status
+               $this->getConfigInstance()->setConfigEntry('node_status', $this->getNodeStateInstance()->getStateName());
+
+               // Compile all variables
+               $helperInstance->getTemplateInstance()->compileConfigInVariables();
+
+               // "Publish" the descriptor by sending it to the bootstrap/list nodes
+               $helperInstance->publishAnnouncementDescriptor();
+
+               // Change the state, this should be the last line except debug output
+               $this->getNodeStateInstance()->nodeAnnouncedToUpperHubs();
+               die("OK!\n");
+
+               // Debug output
+               $this->debugOutput('HUB: Self-announcement: FINISHED');
        }
 
        /**
@@ -434,8 +486,8 @@ class BaseHubNode extends BaseHubSystem implements Updateable {
         */
        public function activateHub (Requestable $requestInstance, Responseable $responseInstance) {
                // Checks wether a listener is still active and shuts it down if one
-               // is still listening
-               if (($this->determineIfListenerIsActive()) && ($this->isHubActive())) {
+               // is still listening.
+               if (($this->determineIfListenerIsActive()) && ($this->determineIfHubIsActive())) {
                        // Shutdown them down before they can hurt anything
                        $this->shutdownListenerPool();
                } // END - if
@@ -448,7 +500,7 @@ class BaseHubNode extends BaseHubSystem implements Updateable {
 
                // ----------------------- Last step from here ------------------------
                // Activate the hub. This is ALWAYS the last step in this method
-               $this->enableHubIsActive();
+               $this->getNodeStateInstance()->nodeIsActivated();
                // ---------------------- Last step until here ------------------------
        }
 
@@ -549,6 +601,20 @@ class BaseHubNode extends BaseHubSystem implements Updateable {
                // Debug output
                $this->debugOutput('HUB: Restore node list: FINISHED.');
        }
+
+       /**
+        * Determines wether the hub is active by checking its current state
+        *
+        * @return      $isActive       Wether the hub is active
+        */
+       public function determineIfHubIsActive () {
+               // Check the state
+               // @TODO Add more states e.g. 'firewalled', 'senior'
+               $isActive = ($this->getNodeStateInstance() instanceof NodeActiveState);
+
+               // Return value
+               return $isActive;
+       }
 }
 
 // [EOF]
index 7b6f59cc8f0ae213a9a5e06c2c54df23ed4fd542..2390e9d653490b0dbc7f69017cb389cd8570c623 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index e00cab0c33f4536ebdf159609a09e9c31c1d07d2..036b24f00b7fa8616913f8e9bb8b9a8c0a963c8c 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 23b1be87f8c2db36151c87308edf1758abcbadf3..260d4a329215e7e7b3c8f253a96729a8cbbedfda 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 716176243e529d2358e0af7c315e2977cd1e0877..cf78a8c3404e868355713bf971c81b09bcec70b8 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 5908ad52de1c59f91e3c7a9f9f5efd62df1761e9..72454042568bf1c8b557302a2797364a877d866b 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -80,7 +80,7 @@ class BasePool extends BaseHubSystem implements Visitable {
        }
 
        /**
-        * Accepts the visitor to rpocess the visit "request"
+        * Accepts the visitor to process the visit "request"
         *
         * @param       $visitorInstance        An instance of a Visitor class
         * @return      void
index dd4c6c2d1a1c3cb477fa2b34ac5dbe30abab690b..a0ceb977c71301f1177486d4d8d080c61045099b 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index dccbfcc347c3a5ae5b9795f7286bb2fa62f947e3..f828fb549088f3a3bbe9f3aba7fd1f9aed6c1c23 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 9c113c025fb4ae9176c5e479685529cda759526e..22f13e8d31e2ea894c28ca87c0c05439b2aab5d8 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index e85325e426abf31e14eeaedcece9d8b52f3b4c12..e7a7a9441faa086d403b79fe34711bc6bd2e65a7 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 3848075b8ee1382d6d43eb33b6707c29c5e2206b..9815604f3d7b6c798fae65a5e87735b3f40341c1 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -46,7 +46,7 @@ class LocalQuery extends BaseQuery implements Queryable, Visitable {
        }
 
        /**
-        * Accepts the visitor to rpocess the visit "request"
+        * Accepts the visitor to process the visit "request"
         *
         * @param       $visitorInstance        An instance of a Visitor class
         * @return      void
index 9a39e85a2ee980392e86e111416ecebe0284d712..683076dec171a420d89821ca15b9ba9102d6bf6d 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 1a34610f713e78d6ca810e0b649344e62d480247..e8de605caaba48f84cdeb99bf893214d0c88e606 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 76f9d1ce8e92dc868a4d0265105b99b8d019c745..07ffe19b0ef6bd131b6734f67f6e5f66d1a7411a 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 54d2304f2091828a455f4548fe9cb6a0a1d74a91..a3c1978d9c9230baf3e2af01d93e2202a98a87ef 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index c8f291c7a971cbb5a9996c2c954c69bafbef848c..774a6934102984b43fd86e215a543acbfc9a42c4 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index a7dbc979cdf2a3566f1dd1952a7b4464393f5b0f..c74170509458d4492af36ec82679fc03c91059d9 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index ddba4be42c0d61c4bfed94794b2b3fdee547f933..e37e8380ffbe9ddc31cf6bad1e9db37fc746f2a5 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 1b30ac4bcc9435e1bd8de1da716e2e5b084ed098..f83cbf34fe2111e03b249d87865f41e8e2fe5cfa 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -30,6 +30,9 @@ class ???State extends BaseState implements ??Stateable {
        protected function __construct () {
                // Call parent constructor
                parent::__construct(__CLASS__);
+
+               // Set state name
+               $this->setStateName('!!!');
        }
 }
 
index 0117115a063089451e5adceec76d1e59eacca03c..4511f3e1013db3e722457ac3ef467d5d71470dc5 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 class BaseState extends BaseHubSystem implements Stateable {
+       /**
+        * State name for printing out (except debug output where you want to use
+        * $stateInstance->__toString() instead of this).
+        */
+       private $stateName = '';
+
        /**
         * Protected constructor
         *
@@ -32,6 +38,25 @@ class BaseState extends BaseHubSystem implements Stateable {
                // Call parent constructor
                parent::__construct($className);
        }
+
+       /**
+        * Getter for state name
+        *
+        * @return      $stateName      Name of this state in a printable maner
+        */
+       public final function getStateName () {
+               return $this->stateName;
+       }
+
+       /**
+        * Setter for state name
+        *
+        * @param       $stateName      Name of this state in a printable maner
+        * @return      void
+        */
+       protected final function setStateName ($stateName) {
+               $this->stateName = $stateName;
+       }
 }
 
 // [EOF]
index ec1916b8ec32c3c62ce21109c3022187a93ce675..627b5db706096297b46582831d9d2b41f839c881 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 8e52c1f32a943a3c6a5a897b972035f4e6bf1ddd..e49d6a32637493f3e478c4a96e548e4c402fa0df 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
diff --git a/application/hub/main/states/node/.htaccess b/application/hub/main/states/node/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/hub/main/states/node/active/.htaccess b/application/hub/main/states/node/active/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/hub/main/states/node/active/class_NodeActiveState.php b/application/hub/main/states/node/active/class_NodeActiveState.php
new file mode 100644 (file)
index 0000000..6dd80ce
--- /dev/null
@@ -0,0 +1,60 @@
+<?php
+/**
+ * A Active node state class
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+class NodeActiveState extends BaseState implements NodeStateable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+
+               // Set state name
+               $this->setStateName('active');
+       }
+
+       /**
+        * Creates an instance of this class
+        *
+        * @param       $nodeInstance   An instance of a NodeHelper class
+        * @return      $stateInstance  An instance of a NodeStateable class
+        */
+       public final static function createNodeActiveState (NodeHelper $nodeInstance) {
+               // Get new instance
+               $stateInstance = new NodeActiveState();
+
+               // Debug message
+               $stateInstance->debugOutput("NODE-STATE: Has changed from " . $nodeInstance->getPrintableState() . " to " . $stateInstance->getStateName() . ".");
+
+               // Set the node instance
+               $stateInstance->setNodeInstance($nodeInstance);
+
+               // Return the prepared instance
+               return $stateInstance;
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/hub/main/states/node/class_ b/application/hub/main/states/node/class_
new file mode 100644 (file)
index 0000000..7d73f8d
--- /dev/null
@@ -0,0 +1,60 @@
+<?php
+/**
+ * A ??? node state class
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+class Node???State extends BaseState implements NodeStateable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+
+               // Set state name
+               $this->setStateName('!!!');
+       }
+
+       /**
+        * Creates an instance of this class
+        *
+        * @param       $nodeInstance   An instance of a NodeHelper class
+        * @return      $stateInstance  An instance of a NodeStateable class
+        */
+       public final static function createNode???State (NodeHelper $nodeInstance) {
+               // Get new instance
+               $stateInstance = new Node???State();
+
+               // Debug message
+               $stateInstance->debugOutput("NODE-STATE: Has changed from " . $nodeInstance->getPrintableState() . " to " . $stateInstance->getStateName() . ".");
+
+               // Set the node instance
+               $stateInstance->setNodeInstance($nodeInstance);
+
+               // Return the prepared instance
+               return $stateInstance;
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/hub/main/states/node/class_BaseNodeState.php b/application/hub/main/states/node/class_BaseNodeState.php
new file mode 100644 (file)
index 0000000..5e87659
--- /dev/null
@@ -0,0 +1,38 @@
+<?php
+/**
+ * A general Node state class
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+class BaseNodeState extends BaseState {
+       /**
+        * Protected constructor
+        *
+        * @param       $className      Name of the class
+        * @return      void
+        */
+       protected function __construct ($className) {
+               // Call parent constructor
+               parent::__construct($className);
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/hub/main/states/node/init/.htaccess b/application/hub/main/states/node/init/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/hub/main/states/node/init/class_NodeInitState.php b/application/hub/main/states/node/init/class_NodeInitState.php
new file mode 100644 (file)
index 0000000..4d64f2e
--- /dev/null
@@ -0,0 +1,70 @@
+<?php
+/**
+ * A Init node state class
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+class NodeInitState extends BaseState implements NodeStateable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructo
+               parent::__construct(__CLASS__);
+
+               // Set state name
+               $this->setStateName('init');
+       }
+
+       /**
+        * Creates an instance of this class
+        *
+        * @param       $nodeInstance   An instance of a NodeHelper class
+        * @return      $stateInstance  An instance of a NodeStateable class
+        */
+       public final static function createNodeInitState (NodeHelper $nodeInstance) {
+               // Get new instance
+               $stateInstance = new NodeInitState();
+
+               // Debug message
+               $stateInstance->debugOutput("NODE-STATE: Has changed from " . $nodeInstance->getPrintableState() . " to " . $stateInstance->getStateName() . ".");
+
+               // Set the node instance
+               $stateInstance->setNodeInstance($nodeInstance);
+
+               // Return the prepared instance
+               return $stateInstance;
+       }
+
+       /**
+        * State change for if the node has just generated a session id. This makes
+        * nodes with current state 'init' now 'virgin'.
+        */
+       public function nodeGeneratedSessionId () {
+               // Create the new state instance
+               NodeStateFactory::createNodeStateInstanceByName('virgin', $this->getNodeInstance());
+       }
+
+}
+
+// [EOF]
+?>
diff --git a/application/hub/main/states/node/virgin/.htaccess b/application/hub/main/states/node/virgin/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/hub/main/states/node/virgin/class_NodeVirginState.php b/application/hub/main/states/node/virgin/class_NodeVirginState.php
new file mode 100644 (file)
index 0000000..aeb1223
--- /dev/null
@@ -0,0 +1,74 @@
+<?php
+/**
+ * A Virgin node state class
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+class NodeVirginState extends BaseState implements NodeStateable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+
+               // Set state name
+               $this->setStateName('virgin');
+       }
+
+       /**
+        * Creates an instance of this class
+        *
+        * @param       $nodeInstance   An instance of a NodeHelper class
+        * @return      $stateInstance  An instance of a NodeStateable class
+        */
+       public final static function createNodeVirginState (NodeHelper $nodeInstance) {
+               // Get new instance
+               $stateInstance = new NodeVirginState();
+
+               // Debug message
+               $stateInstance->debugOutput("NODE-STATE: Has changed from " . $nodeInstance->getPrintableState() . " to " . $stateInstance->getStateName() . ".");
+
+               // Set the node instance
+               $stateInstance->setNodeInstance($nodeInstance);
+
+               // Return the prepared instance
+               return $stateInstance;
+       }
+
+       /**
+        * Change the state to 'activate' when the hub has initialized all
+        * listeners, tasks, queues, etc. An active hub does not imply that it
+        * can be reached from outside so we have to deal with that state with
+        * yet another state class.
+        * 
+        * @return      void
+        */
+       public function nodeIsActivated () {
+               // Create the new state instance
+               NodeStateFactory::createNodeStateInstanceByName('active', $this->getNodeInstance());
+       }
+
+}
+
+// [EOF]
+?>
index b0b42b375d88998a54be87a3354a5933f7d19bce..cae03fc15664c75a0b7bd54e1ffc9979f1b0918a 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -46,7 +46,7 @@ class ???Task extends BaseTask implements Taskable, Visitable {
        }
 
        /**
-        * Accepts the visitor to rpocess the visit "request"
+        * Accepts the visitor to process the visit "request"
         *
         * @param       $visitorInstance        An instance of a Visitor class
         * @return      void
index 5334b727d0e09b51d43ba2927f67ae6f09495e4f..c85f47fffad55659dbd7697650947ce3ab2e072f 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 38617ec1769c11914e678d501423cc71cfe3eed9..13218ea7f2efc364ac2e93dceee73dd5dbb8cee1 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -46,7 +46,7 @@ class HubSelfAnnouncementTask extends BaseTask implements Taskable, Visitable {
        }
 
        /**
-        * Accepts the visitor to rpocess the visit "request"
+        * Accepts the visitor to process the visit "request"
         *
         * @param       $visitorInstance        An instance of a Visitor class
         * @return      void
index 59d02ecb8d74385a83c12244ae023bca4d88e8bf..97cb9d4f345a1f1d0aedc7f4237cf8d7359c5c15 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -46,7 +46,7 @@ class HubSelfConnectTask extends BaseTask implements Taskable, Visitable {
        }
 
        /**
-        * Accepts the visitor to rpocess the visit "request"
+        * Accepts the visitor to process the visit "request"
         *
         * @param       $visitorInstance        An instance of a Visitor class
         * @return      void
index ba3d37dd2e284a65a381e481be6cb36b79d807a7..6df69fb6095d50857742c55dbbd6de0f71e7bf79 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -56,7 +56,7 @@ class HubPingTask extends BaseTask implements Visitable, Taskable {
        }
 
        /**
-        * Accepts the visitor to rpocess the visit "request"
+        * Accepts the visitor to process the visit "request"
         *
         * @param       $visitorInstance        An instance of a Visitor class
         * @return      void
index 5cc4b9a8b6f0897dd7568b7d5082d1a3773097c1..5d7c810dacbfd9520e1f68c706fb6d28ac9970f3 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -46,7 +46,7 @@ class HubUpdateCheckTask extends BaseTask implements Visitable, Taskable {
        }
 
        /**
-        * Accepts the visitor to rpocess the visit "request"
+        * Accepts the visitor to process the visit "request"
         *
         * @param       $visitorInstance        An instance of a Visitor class
         * @return      void
index f8299a6c0bb3065ea3bcf1e471db529f2b26ac34..500dcf837f949d643bd5d838af1f7310c204b070 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -46,7 +46,7 @@ class IdleLoopTask extends BaseTask implements Visitable, Taskable {
        }
 
        /**
-        * Accepts the visitor to rpocess the visit "request"
+        * Accepts the visitor to process the visit "request"
         *
         * @param       $visitorInstance        An instance of a Visitor class
         * @return      void
@@ -65,6 +65,16 @@ class IdleLoopTask extends BaseTask implements Visitable, Taskable {
                // Idle here a little (2 milliseconds)
                $this->idle(2);
        }
+
+       /**
+        * Shutdown this task, this does nothing here, just supply the method.
+        *
+        * @return      void
+        */
+       public function doShutdown () {
+               // Debug message
+               $this->debugOutput('IDLE-TASK: Shutting down...');
+       }
 }
 
 // [EOF]
index f8b1e43d3be41c20ffe50ddab9a96fdb9648ee10..7a6dbcc0c45d6ce2cc759a2c5e7d0e1bbcbeea0f 100644 (file)
@@ -27,14 +27,22 @@ class AnnouncementTemplateEngine extends BaseTemplateEngine implements Compileab
         */
        private $mainNodes = array(
                'announcement',
-               'annoucement-data'
        );
 
        /**
         * Sub nodes in the XML tree
         */
        private $subNodes = array(
+               'announcement-data',
+               'listener',
+               'hub-listener',
+               'client-listener',
                'node-id',
+               'node-status',
+               'tcp-port',
+               'udp-port',
+               'session-id',
+               'object-type-list',
        );
 
        /**
@@ -258,7 +266,7 @@ class AnnouncementTemplateEngine extends BaseTemplateEngine implements Compileab
 
                // Assign the found characters to variable and use the last entry from
                // stack as the name
-               parent::assignVariable($this->getStackerInstance()->getNamed('current_node'), $characters);
+               parent::assignVariable($this->getStackerInstance()->getNamed('announcement'), $characters);
        }
 
        /**
@@ -272,10 +280,10 @@ class AnnouncementTemplateEngine extends BaseTemplateEngine implements Compileab
                // Is the template dependency set?
                if ((!empty($templateDependency)) && (!isset($this->dependencyContent[$node]))) {
                        // Get a temporay menu template instance
-                       $templateInstance = ObjectFactory::createObjectByConfiguredName('menu_template_class', array($this->getApplicationInstance(), $this->getMenuInstance()));
+                       $templateInstance = ObjectFactory::createObjectByConfiguredName('announcement_template_class', array($this->getApplicationInstance()));
 
                        // Then load it
-                       $templateInstance->loadMenuTemplate($templateDependency);
+                       $templateInstance->loadAnnouncementTemplate($templateDependency);
 
                        // Get an XmlParser instance
                        $templateInstance->renderXmlContent();
@@ -286,7 +294,7 @@ class AnnouncementTemplateEngine extends BaseTemplateEngine implements Compileab
        }
 
        /**
-        * Getter for menu cache file (FQFN)
+        * Getter for cache file (FQFN)
         *
         * @return      $fqfn   Full-qualified file name of the menu cache
         */
@@ -307,6 +315,246 @@ class AnnouncementTemplateEngine extends BaseTemplateEngine implements Compileab
                // Return it
                return $fqfn;
        }
+
+       /**
+        * Starts the announcement
+        *
+        * @return      void
+        */
+       private function startAnnouncement () {
+               // Push the node name on the stacker
+               $this->getStackerInstance()->pushNamed('announcement', 'announcement');
+       }
+
+       /**
+        * Starts the announcement data
+        *
+        * @return      void
+        */
+       private function startAnnouncementData () {
+               // Push the node name on the stacker
+               $this->getStackerInstance()->pushNamed('announcement', 'announcement-data');
+       }
+
+       /**
+        * Starts the node id
+        *
+        * @return      void
+        */
+       private function startNodeId () {
+               // Push the node name on the stacker
+               $this->getStackerInstance()->pushNamed('announcement', 'node-id');
+       }
+
+       /**
+        * Starts the node status
+        *
+        * @return      void
+        */
+       private function startNodeStatus () {
+               // Push the node name on the stacker
+               $this->getStackerInstance()->pushNamed('announcement', 'node-status');
+       }
+
+       /**
+        * Starts the listener
+        *
+        * @return      void
+        */
+       private function startListener () {
+               // Push the node name on the stacker
+               $this->getStackerInstance()->pushNamed('announcement', 'listener');
+       }
+
+       /**
+        * Starts the client listener
+        *
+        * @return      void
+        */
+       private function startClientListener () {
+               // Push the node name on the stacker
+               $this->getStackerInstance()->pushNamed('announcement', 'client-listener');
+       }
+
+       /**
+        * Starts the hub listener
+        *
+        * @return      void
+        */
+       private function startHubListener () {
+               // Push the node name on the stacker
+               $this->getStackerInstance()->pushNamed('announcement', 'hub-listener');
+       }
+
+       /**
+        * Starts the TCP port
+        *
+        * @return      void
+        */
+       private function startTcpPort () {
+               // Push the node name on the stacker
+               $this->getStackerInstance()->pushNamed('announcement', 'tcp-port');
+       }
+
+       /**
+        * Starts the UDP port
+        *
+        * @return      void
+        */
+       private function startUdpPort () {
+               // Push the node name on the stacker
+               $this->getStackerInstance()->pushNamed('announcement', 'udp-port');
+       }
+
+       /**
+        * Starts the session id
+        *
+        * @return      void
+        */
+       private function startSessionId () {
+               // Push the node name on the stacker
+               $this->getStackerInstance()->pushNamed('announcement', 'session-id');
+       }
+
+       /**
+        * Starts the object type list
+        *
+        * @return      void
+        */
+       private function startObjectTypeList () {
+               // Push the node name on the stacker
+               $this->getStackerInstance()->pushNamed('announcement', 'object-type-list');
+       }
+
+       /**
+        * Starts the object type
+        *
+        * @return      void
+        */
+       private function startObjectType () {
+               // Push the node name on the stacker
+               $this->getStackerInstance()->pushNamed('announcement', 'object-type');
+       }
+
+       /**
+        * Finishes the object type
+        *
+        * @return      void
+        */
+       private function finishObjectType () {
+               // Pop the last entry
+               $this->getStackerInstance()->popNamed('announcement');
+       }
+
+       /**
+        * Finishes the object type list
+        *
+        * @return      void
+        */
+       private function finishObjectTypeList () {
+               // Pop the last entry
+               $this->getStackerInstance()->popNamed('announcement');
+       }
+
+       /**
+        * Finishes the session id
+        *
+        * @return      void
+        */
+       private function finishSessionId () {
+               // Pop the last entry
+               $this->getStackerInstance()->popNamed('announcement');
+       }
+
+       /**
+        * Finishes the UDP port
+        *
+        * @return      void
+        */
+       private function finishUdpPort () {
+               // Pop the last entry
+               $this->getStackerInstance()->popNamed('announcement');
+       }
+
+       /**
+        * Finishes the TCP port
+        *
+        * @return      void
+        */
+       private function finishTcpPort () {
+               // Pop the last entry
+               $this->getStackerInstance()->popNamed('announcement');
+       }
+
+       /**
+        * Finishes the hub listener
+        *
+        * @return      void
+        */
+       private function finishHubListener () {
+               // Pop the last entry
+               $this->getStackerInstance()->popNamed('announcement');
+       }
+
+       /**
+        * Finishes the client listener
+        *
+        * @return      void
+        */
+       private function finishClientListener () {
+               // Pop the last entry
+               $this->getStackerInstance()->popNamed('announcement');
+       }
+
+       /**
+        * Finishes the listener
+        *
+        * @return      void
+        */
+       private function finishListener () {
+               // Pop the last entry
+               $this->getStackerInstance()->popNamed('announcement');
+       }
+
+       /**
+        * Finishes the node status
+        *
+        * @return      void
+        */
+       private function finishNodeStatus () {
+               // Pop the last entry
+               $this->getStackerInstance()->popNamed('announcement');
+       }
+
+       /**
+        * Finishes the node id
+        *
+        * @return      void
+        */
+       private function finishNodeId () {
+               // Pop the last entry
+               $this->getStackerInstance()->popNamed('announcement');
+       }
+
+       /**
+        * Finishes the announcement data
+        *
+        * @return      void
+        */
+       private function finishAnnouncementData () {
+               // Pop the last entry
+               $this->getStackerInstance()->popNamed('announcement');
+       }
+
+       /**
+        * Finishes the announcement
+        *
+        * @return      void
+        */
+       private function finishAnnouncement () {
+               // Pop the last entry
+               $this->getStackerInstance()->popNamed('announcement');
+       }
 }
 
 // [EOF]
index d64d546e67eebc220f621c805ab452f31da0f6e1..6442569ad29aaba9fd26c2bd79226557856ea876 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 3c9050f96a96e139ce45b2ceadbe9d349cee6a05..13e253b62fd378770e101e8a2f700c9f19281123 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 2174af55458a04edd3c094ebb494c77e10c46b28..bd3bd35541d8d7120fac2242e06cda1d6c480eed 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 54b3463d2bc56d9b40b126fe92f2b0bc528dd23f..b640baae00ae5356727c8e632a1dc86a9f3ee8b2 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 04f7e6c36b4e018afffe7eecdf8add2e37553101..5d697f19f67b3e332f69728a914558149410e2c5 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub; Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 8d48dbd0a934c93c1363182ec9a20599532c5c4f..6c622e400217b05d9b69d58eeb87601fd1c378ef 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -64,6 +64,40 @@ class ShutdownListenerPoolVisitor extends BaseVisitor implements PoolVisitor {
                // Debug message
                $this->debugOutput('VISITOR: Visit of ' . $poolInstance->__toString() . ' - FINISHED');
        }
+
+       /**
+        * Visits the given decorator instance
+        *
+        * @param       $decoratorInstance      A Listenable decorator instance
+        * @return      void
+        */
+       public function visitDecorator (Listenable $decoratorInstance) {
+               // Debug message
+               $this->debugOutput('VISITOR: Visit of ' . $decoratorInstance->__toString() . ' - START');
+
+               // Pre-shutdown the pool
+               $decoratorInstance->doShutdown();
+
+               // Debug message
+               $this->debugOutput('VISITOR: Visit of ' . $decoratorInstance->__toString() . ' - FINISHED');
+       }
+
+       /**
+        * Visits the given listener instance
+        *
+        * @param       $listenerInstance       A Listenable class instance
+        * @return      void
+        */
+       public function visitListener (Listenable $listenerInstance) {
+               // Debug message
+               $this->debugOutput('VISITOR: Visit of ' . $listenerInstance->__toString() . ' - START');
+
+               // Pre-shutdown the pool
+               $listenerInstance->doShutdown();
+
+               // Debug message
+               $this->debugOutput('VISITOR: Visit of ' . $listenerInstance->__toString() . ' - FINISHED');
+       }
 }
 
 //
index ecfe21bef227622c8c117ab587ba81cf39bc8dcf..e352a9a6eb2f608a95798ff0ee6e3fc1e38ee3fc 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -101,7 +101,9 @@ class ActiveTaskVisitor extends BaseVisitor implements TaskVisitor, QueryConnect
         */
        public function visitListener (Listenable $listenerInstance) {
                // Do "listen" here
+               //* DEBUG: */ $this->debugOutput('VISITOR: Visiting ' . $listenerInstance->__toString() . ' - START');
                $listenerInstance->doListen();
+               //* DEBUG: */ $this->debugOutput('VISITOR: Visiting ' . $listenerInstance->__toString() . ' - FINISH');
        }
 
        /**
index 39633a9fad4a7689c0300535fa26b5c2e7d2de81..d7524678c46129af2c1b5a4c473acec67082e048 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 825a2caa87058961741b9c1969d0e50ed33cd0c2..8d740d1b7e6feb94540095819604ca8cf305de77 100644 (file)
@@ -24,7 +24,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
 //-->
 <announcement>
        <!-- Announcement data like, node id, session id and object types. //-->
-       <annoucement-data>
+       <announcement-data>
                <!-- Our node id. This should be announced only to upper hubs. //-->
                <node-id>{?node_id?}</node-id>
                <!-- Status of this node, see node_status.xml for details. //-->
@@ -33,21 +33,19 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
                <listener>
                        <!-- Listener ports for hub connections //-->
                        <hub-listener>
-                               <tcp-port>{?hub_tcp_port?}</tcp-port>
-                               <udp-port>{?hub_udp_port?}</udp-port>
+                               <tcp-port>{?node_tcp_listen_port?}</tcp-port>
+                               <udp-port>{?node_udp_listen_port?}</udp-port>
                        </hub-listener>
                        <!-- Listener ports for client connections //-->
                        <client-listener>
-                               <tcp-port>{?client_tcp_port?}</tcp-port>
-                               <udp-port>{?client_udp_port?}</udp-port>
+                               <tcp-port>{?node_tcp_listen_port?}</tcp-port>
+                               <udp-port>{?node_udp_listen_port?}</udp-port>
                        </client-listener>
                </listener>
                <!-- The session id. This should be announced to all other hubs. //-->
                <session-id>{?session_id?}</session-id>
                <!-- A list of shared object types. //-->
                <object-type-list>
-                       <!-- A single object type this hub shares. //-->
-                       <object-type>{?object_type?}</object-type>
                </object-type-list>
-       </annoucement-data>
+       </announcement-data>
 </announcement>