Cruncher continued and rewritten to use states:
authorRoland Häder <roland@mxchange.org>
Tue, 5 Apr 2011 23:33:13 +0000 (23:33 +0000)
committerRoland Häder <roland@mxchange.org>
Tue, 5 Apr 2011 23:33:13 +0000 (23:33 +0000)
- States 'init' and 'virgin' introduced
- Needed cruncher parts refactured to use the new states
- Creation of node/cruncher states is now done in factories
- Key producer added which will produce keys if the required state 'virgin' is
  beging detected. This producer works without a loop which is recommended for
  task-based applications
- A lot other improvements
- TODOs.txt updated

43 files changed:
.gitattributes
application/hub/config.php
application/hub/interfaces/executor/.htaccess [new file with mode: 0644]
application/hub/interfaces/executor/class_Executor.php [new file with mode: 0644]
application/hub/interfaces/producer/class_ [new file with mode: 0644]
application/hub/interfaces/producer/keys/.htaccess [new file with mode: 0644]
application/hub/interfaces/producer/keys/class_KeyProducer.php [new file with mode: 0644]
application/hub/interfaces/producer/work_units/class_UnitProducer.php
application/hub/interfaces/states/class_Stateable.php
application/hub/main/class_BaseHubSystem.php
application/hub/main/cruncher/class_BaseHubCruncher.php
application/hub/main/cruncher/mcrypt/class_HubMcryptCruncher.php
application/hub/main/factories/states/class_StateFactory.php
application/hub/main/factories/states/cruncher/.htaccess [new file with mode: 0644]
application/hub/main/factories/states/cruncher/class_CruncherStateFactory.php [new file with mode: 0644]
application/hub/main/factories/states/node/.htaccess [new file with mode: 0644]
application/hub/main/factories/states/node/class_NodeStateFactory.php [new file with mode: 0644]
application/hub/main/filter/task/cruncher/class_CruncherTaskHandlerInitializerFilter.php
application/hub/main/iterator/producer/keys/class_TestUnitKeyProducerIterator.php
application/hub/main/nodes/class_BaseHubNode.php
application/hub/main/producer/class_BaseProducer.php
application/hub/main/producer/cruncher/class_BaseKeyProducer.php [new file with mode: 0644]
application/hub/main/producer/cruncher/class_BaseUnitProducer.php
application/hub/main/producer/cruncher/keys/.htaccess [new file with mode: 0644]
application/hub/main/producer/cruncher/keys/class_CruncherKeyProducer.php [new file with mode: 0644]
application/hub/main/producer/cruncher/work_units/class_CruncherTestUnitProducer.php
application/hub/main/source/units/class_TestUnitSource.php
application/hub/main/states/class_BaseState.php
application/hub/main/states/cruncher/.htaccess [new file with mode: 0644]
application/hub/main/states/cruncher/class_ [new file with mode: 0644]
application/hub/main/states/cruncher/class_BaseCruncherState.php [new file with mode: 0644]
application/hub/main/states/cruncher/init/.htaccess [new file with mode: 0644]
application/hub/main/states/cruncher/init/class_CruncherInitState.php [new file with mode: 0644]
application/hub/main/states/cruncher/virgin/.htaccess [new file with mode: 0644]
application/hub/main/states/cruncher/virgin/class_CruncherVirginState.php [new file with mode: 0644]
application/hub/main/states/node/active/class_NodeActiveState.php
application/hub/main/states/node/announced/class_NodeAnnouncedState.php
application/hub/main/states/node/class_
application/hub/main/states/node/init/class_NodeInitState.php
application/hub/main/states/node/virgin/class_NodeVirginState.php
application/hub/main/tasks/cruncher/class_CruncherKeyProducerTask.php [new file with mode: 0644]
application/hub/main/tasks/cruncher/class_CruncherTestUnitProducerTask.php
docs/TODOs.txt

index 4217c86ded1a45b374bad6ac53454bce5d7dbf64..c046a648d4f50846d3c98cf24847bef0586f6575 100644 (file)
@@ -37,6 +37,8 @@ application/hub/interfaces/cruncher/class_CruncherHelper.php svneol=native#text/
 application/hub/interfaces/discovery/.htaccess -text svneol=unset#text/plain
 application/hub/interfaces/discovery/class_DiscoverableRecipient.php svneol=native#text/plain
 application/hub/interfaces/discovery/class_DiscoverableSocket.php svneol=native#text/plain
+application/hub/interfaces/executor/.htaccess svneol=native#text/plain
+application/hub/interfaces/executor/class_Executor.php svneol=native#text/plain
 application/hub/interfaces/handler/.htaccess -text svneol=unset#text/plain
 application/hub/interfaces/handler/class_Handleable.php -text svneol=unset#text/plain
 application/hub/interfaces/handler/network/.htaccess -text svneol=unset#text/plain
@@ -71,7 +73,10 @@ application/hub/interfaces/pool/listener/class_PoolableListener.php -text svneol
 application/hub/interfaces/pool/peer/.htaccess -text svneol=unset#text/plain
 application/hub/interfaces/pool/peer/class_PoolablePeer.php -text svneol=unset#text/plain
 application/hub/interfaces/producer/.htaccess svneol=native#text/plain
+application/hub/interfaces/producer/class_ -text
 application/hub/interfaces/producer/class_Producer.php svneol=native#text/plain
+application/hub/interfaces/producer/keys/.htaccess svneol=native#text/plain
+application/hub/interfaces/producer/keys/class_KeyProducer.php svneol=native#text/plain
 application/hub/interfaces/producer/work_units/.htaccess svneol=native#text/plain
 application/hub/interfaces/producer/work_units/class_UnitProducer.php svneol=native#text/plain
 application/hub/interfaces/protocol/.htaccess -text svneol=unset#text/plain
@@ -189,6 +194,10 @@ application/hub/main/factories/source/units/.htaccess svneol=native#text/plain
 application/hub/main/factories/source/units/class_UnitSourceFactory.php svneol=native#text/plain
 application/hub/main/factories/states/.htaccess -text svneol=unset#text/plain
 application/hub/main/factories/states/class_StateFactory.php -text svneol=unset#text/plain
+application/hub/main/factories/states/cruncher/.htaccess svneol=native#text/plain
+application/hub/main/factories/states/cruncher/class_CruncherStateFactory.php svneol=native#text/plain
+application/hub/main/factories/states/node/.htaccess svneol=native#text/plain
+application/hub/main/factories/states/node/class_NodeStateFactory.php svneol=native#text/plain
 application/hub/main/factories/states/peer/.htaccess -text svneol=unset#text/plain
 application/hub/main/factories/states/peer/class_PeerStateFactory.php svneol=native#text/plain
 application/hub/main/factories/tags/.htaccess -text svneol=unset#text/plain
@@ -384,7 +393,10 @@ application/hub/main/producer/.htaccess svneol=native#text/plain
 application/hub/main/producer/class_ -text
 application/hub/main/producer/class_BaseProducer.php svneol=native#text/plain
 application/hub/main/producer/cruncher/.htaccess svneol=native#text/plain
+application/hub/main/producer/cruncher/class_BaseKeyProducer.php svneol=native#text/plain
 application/hub/main/producer/cruncher/class_BaseUnitProducer.php svneol=native#text/plain
+application/hub/main/producer/cruncher/keys/.htaccess svneol=native#text/plain
+application/hub/main/producer/cruncher/keys/class_CruncherKeyProducer.php svneol=native#text/plain
 application/hub/main/producer/cruncher/work_units/.htaccess svneol=native#text/plain
 application/hub/main/producer/cruncher/work_units/class_CruncherTestUnitProducer.php svneol=native#text/plain
 application/hub/main/queries/.htaccess -text svneol=unset#text/plain
@@ -421,6 +433,13 @@ application/hub/main/source/units/class_TestUnitSource.php svneol=native#text/pl
 application/hub/main/states/.htaccess -text svneol=unset#text/plain
 application/hub/main/states/class_ -text svneol=unset#text/plain
 application/hub/main/states/class_BaseState.php -text svneol=unset#text/plain
+application/hub/main/states/cruncher/.htaccess svneol=native#text/plain
+application/hub/main/states/cruncher/class_ -text
+application/hub/main/states/cruncher/class_BaseCruncherState.php svneol=native#text/plain
+application/hub/main/states/cruncher/init/.htaccess svneol=native#text/plain
+application/hub/main/states/cruncher/init/class_CruncherInitState.php svneol=native#text/plain
+application/hub/main/states/cruncher/virgin/.htaccess svneol=native#text/plain
+application/hub/main/states/cruncher/virgin/class_CruncherVirginState.php svneol=native#text/plain
 application/hub/main/states/generic/.htaccess -text svneol=unset#text/plain
 application/hub/main/states/hub/.htaccess -text svneol=unset#text/plain
 application/hub/main/states/hub/class_BaseHubState.php -text svneol=unset#text/plain
@@ -450,6 +469,7 @@ application/hub/main/tasks/class_ -text svneol=unset#text/plain
 application/hub/main/tasks/class_BaseTask.php -text svneol=unset#text/plain
 application/hub/main/tasks/cruncher/.htaccess svneol=native#text/plain
 application/hub/main/tasks/cruncher/class_ -text
+application/hub/main/tasks/cruncher/class_CruncherKeyProducerTask.php svneol=native#text/plain
 application/hub/main/tasks/cruncher/class_CruncherTestUnitProducerTask.php svneol=native#text/plain
 application/hub/main/tasks/cruncher/class_CruncherWorkUnitFetcherTask.php svneol=native#text/plain
 application/hub/main/tasks/hub/.htaccess -text svneol=unset#text/plain
index 4717447454e50c922e61e9a3a490d8dff5b7ef9b..de147ba7b08a01a0fc7fc1d5fe3c949c6ba66f8e 100644 (file)
@@ -273,8 +273,11 @@ $cfg->setConfigEntry('network_package_stacker_class', 'FiFoStacker');
 // CFG: CRUNCHER-BUFFER-STACKER-CLASS
 $cfg->setConfigEntry('cruncher_buffer_stacker_class', 'FiFoStacker');
 
-// CFG: PRODUCER-OUTGOING-WORK-QUEUE
-$cfg->setConfigEntry('producer_outgoing_work_queue', 'FiFoStacker');
+// CFG: PRODUCER-OUTGOING-QUEUE
+$cfg->setConfigEntry('producer_outgoing_queue', 'FiFoStacker');
+
+// CFG: PRODUCER-INCOMING-QUEUE
+$cfg->setConfigEntry('producer_incoming_queue', 'FiFoStacker');
 
 // CFG: STACKER-ANNOUNCEMENT-MAX-SIZE
 $cfg->setConfigEntry('stacker_announcement_max_size', 20);
@@ -300,8 +303,11 @@ $cfg->setConfigEntry('stacker_out_queue_max_size', 10000);
 // CFG: STACKER-OBJECT-REGISTRY-MAX-SIZE
 $cfg->setConfigEntry('stacker_object_registry_max_size', 100);
 
-// CFG: STACKER-WORK-QUEUE-MAX-SIZE
-$cfg->setConfigEntry('stacker_work_queue_max_size', 1000);
+// CFG: STACKER-OUTGOING-QUEUE-MAX-SIZE
+$cfg->setConfigEntry('stacker_outgoing_queue_max_size', 1000);
+
+// CFG: STACKER-INCOMING-QUEUE-MAX-SIZE
+$cfg->setConfigEntry('stacker_incoming_queue_max_size', 1000);
 
 // CFG: NEWS-MAIN-LIMIT
 $cfg->setConfigEntry('news_main_limit', 5);
@@ -405,6 +411,9 @@ $cfg->setConfigEntry('cruncher_work_unit_fetcher_task_class', 'CruncherWorkUnitF
 // CFG: CRUNCHER-TEST-UNIT-PRODUCER-TASK-CLASS
 $cfg->setConfigEntry('cruncher_test_unit_producer_task_class', 'CruncherTestUnitProducerTask');
 
+// CFG: CRUNCHER-KEY-PRODUCER-TASK-CLASS
+$cfg->setConfigEntry('cruncher_key_producer_task_class', 'CruncherKeyProducerTask');
+
 // CFG: TASK-NETWORK-PACKAGE-WRITER-STARTUP-DELAY
 $cfg->setConfigEntry('task_network_package_writer_startup_delay', 2500);
 
@@ -432,6 +441,15 @@ $cfg->setConfigEntry('task_cruncher_test_unit_producer_interval_delay', 1000*60*
 // CFG: TASK-CRUNCHER-TEST-UNIT-PRODUCER-MAX-RUNS
 $cfg->setConfigEntry('task_cruncher_test_unit_producer_max_runs', 0);
 
+// CFG: TASK-CRUNCHER-KEY-PRODUCER-STARTUP-DELAY
+$cfg->setConfigEntry('task_cruncher_key_producer_startup_delay', 750);
+
+// CFG: TASK-CRUNCHER-KEY-PRODUCER-INTERVAL-DELAY
+$cfg->setConfigEntry('task_cruncher_key_producer_interval_delay', 10);
+
+// CFG: TASK-CRUNCHER-KEY-PRODUCER-MAX-RUNS
+$cfg->setConfigEntry('task_cruncher_key_producer_max_runs', 0);
+
 // CFG: TASK-LIST-CLASS
 $cfg->setConfigEntry('task_list_class', 'TaskList');
 
@@ -549,6 +567,9 @@ $cfg->setConfigEntry('cruncher_max_text_unit_amount', 10);
 // CFG: CRUNCHER-TEST-UNIT-PRODUCER-CLASS
 $cfg->setConfigEntry('cruncher_test_unit_producer_class', 'CruncherTestUnitProducer');
 
+// CFG: CRUNCHER-KEY-PRODUCER-CLASS
+$cfg->setConfigEntry('cruncher_key_producer_class', 'CruncherKeyProducer');
+
 // CFG: CRUNCHER-TEST-UNIT-PRODUCER-TEMPLATE-CLASS
 $cfg->setConfigEntry('cruncher_test_unit_producer_template_class', 'XmlCruncherTestUnitTemplateEngine');
 
@@ -573,8 +594,8 @@ $cfg->setConfigEntry('cruncher_unit_db_wrapper_class', 'CruncherUnitDatabaseWrap
 // CFG: CRUNCHER-RANDOM-SECRET-MESSAGE-LENGTH
 $cfg->setConfigEntry('random_secret_message_length', 100);
 
-// CFG: CRUNCHER-RANDOM-SECRET-KEY-LENGTH
-$cfg->setConfigEntry('random_secret_key_length', 8);
+// CFG: TEST-UNIT-RANDOM-SECRET-KEY-LENGTH
+$cfg->setConfigEntry('test_unit_random_secret_key_length', 8*4);
 
 // CFG: TEST-UNIT-SOURCE-CLASS
 $cfg->setConfigEntry('test_unit_source_class', 'TestUnitSource');
@@ -582,5 +603,11 @@ $cfg->setConfigEntry('test_unit_source_class', 'TestUnitSource');
 // CFG: CRYPTO-RANDOM-MESSAGE-HELPER-CLASS
 $cfg->setConfigEntry('crypto_random_message_helper_class', 'CryptoRandomUnitMessageHelper');
 
+// CFG: CRUNCHER-INIT-STATE-CLASS
+$cfg->setConfigEntry('cruncher_init_state_class', 'CruncherInitState');
+
+// CFG: CRUNCHER-VIRGIN-STATE-CLASS
+$cfg->setConfigEntry('cruncher_virgin_state_class', 'CruncherVirginState');
+
 // [EOF]
 ?>
diff --git a/application/hub/interfaces/executor/.htaccess b/application/hub/interfaces/executor/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/hub/interfaces/executor/class_Executor.php b/application/hub/interfaces/executor/class_Executor.php
new file mode 100644 (file)
index 0000000..18f20db
--- /dev/null
@@ -0,0 +1,28 @@
+<?php
+/**
+ * A Executor interface
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 Hub Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface Executor extends FrameworkInterface {
+}
+
+// [EOF]
+?>
diff --git a/application/hub/interfaces/producer/class_ b/application/hub/interfaces/producer/class_
new file mode 100644 (file)
index 0000000..0a4f8ad
--- /dev/null
@@ -0,0 +1,28 @@
+<?php
+/**
+ * An interface for a ??? producer of the producer/consumer implementation
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 Hub Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface ???Producer extends Producer {
+}
+
+// [EOF]
+?>
diff --git a/application/hub/interfaces/producer/keys/.htaccess b/application/hub/interfaces/producer/keys/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/hub/interfaces/producer/keys/class_KeyProducer.php b/application/hub/interfaces/producer/keys/class_KeyProducer.php
new file mode 100644 (file)
index 0000000..7434319
--- /dev/null
@@ -0,0 +1,36 @@
+<?php
+/**
+ * An interface for the producer/consumer implementation, especially for key
+ * producers.
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 Hub Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface KeyProducer extends Producer, Executor {
+       /**
+        * Produces some keys and pushes them onto the queue
+        *
+        * @param       $stateInstance  An instance of a Stateable instance
+        * @return      void
+        */
+       function produceKeys (Stateable $stateInstance);
+}
+
+// [EOF]
+?>
index 31f8bcc226e64702dde911fdfcc83438f1e4e2ca..a5e1b67678c49e0ec5257b65ce39c324ca4870a4 100644 (file)
  * 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 UnitProducer extends Producer {
+interface UnitProducer extends Producer, Executor {
        /**
-        * Produces some work/test units and pushes them onto the queue
+        * Prepares the produces of some work/test units and pushes them onto the queue
         *
+        * @param       $stateInstance  An instance of a Stateable instance
         * @return      void
         */
-       function produceUnits ();
+       function prepareUnitProduction (Stateable $stateInstance);
 }
 
 // [EOF]
index 7347e605be89803f93e4586775adc499a0cf9029..336550629b24dcc0c5220d898214480568a29095 100644 (file)
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 interface Stateable extends FrameworkInterface {
+       /**
+        * Executes the state with given Executor instance
+        *
+        * @param       $executorInstance       An instance of a Executor class
+        * @return      void
+        */
+       function executeState (Executor $executorInstance);
 }
 
 // [EOF]
index 62eb1304b7f998636d3a0ce21bc8562c1dc72227..bb5df64688ba06a950efd2bbacc5dde81603b7b9 100644 (file)
@@ -27,6 +27,11 @@ class BaseHubSystem extends BaseFrameworkSystem {
         */
        private $nodeInstance = null;
 
+       /**
+        * An instance of a cruncher
+        */
+       private $cruncherInstance = null;
+
        /**
         * Listener instance
         */
@@ -37,6 +42,11 @@ class BaseHubSystem extends BaseFrameworkSystem {
         */
        private $packageInstance = null;
 
+       /**
+        * State instance
+        */
+       private $stateInstance = null;
+
        /**
         * Protected constructor
         *
@@ -49,41 +59,60 @@ class BaseHubSystem extends BaseFrameworkSystem {
        }
 
        /**
-        * Setter for listener instance
+        * Getter for node instance
         *
-        * @param       $listenerInstance       A Listenable instance
+        * @return      $nodeInstance   An instance of a node node
+        */
+       public final function getNodeInstance () {
+               return $this->nodeInstance;
+       }
+
+       /**
+        * Setter for node instance
+        *
+        * @param       $nodeInstance   An instance of a node node
         * @return      void
         */
-       protected final function setListenerInstance (Listenable $listenerInstance) {
-               $this->listenerInstance = $listenerInstance;
+       protected final function setNodeInstance (NodeHelper $nodeInstance) {
+               $this->nodeInstance = $nodeInstance;
        }
 
        /**
-        * Getter for listener instance
+        * Getter for cruncher instance
         *
-        * @return      $listenerInstance       A Listenable instance
+        * @return      $cruncherInstance       An instance of a cruncher cruncher
         */
-       protected final function getListenerInstance () {
-               return $this->listenerInstance;
+       public final function getCruncherInstance () {
+               return $this->cruncherInstance;
        }
 
        /**
-        * Setter for node instance
+        * Setter for cruncher instance
         *
-        * @param       $nodeInstance   An instance of a node node
+        * @param       $cruncherInstance       An instance of a cruncher cruncher
         * @return      void
         */
-       protected final function setNodeInstance (NodeHelper $nodeInstance) {
-               $this->nodeInstance = $nodeInstance;
+       protected final function setCruncherInstance (CruncherHelper $cruncherInstance) {
+               $this->cruncherInstance = $cruncherInstance;
        }
 
        /**
-        * Getter for node instance
+        * Setter for listener instance
         *
-        * @return      $nodeInstance   An instance of a node node
+        * @param       $listenerInstance       A Listenable instance
+        * @return      void
         */
-       public final function getNodeInstance () {
-               return $this->nodeInstance;
+       protected final function setListenerInstance (Listenable $listenerInstance) {
+               $this->listenerInstance = $listenerInstance;
+       }
+
+       /**
+        * Getter for listener instance
+        *
+        * @return      $listenerInstance       A Listenable instance
+        */
+       protected final function getListenerInstance () {
+               return $this->listenerInstance;
        }
 
        /**
@@ -105,6 +134,25 @@ class BaseHubSystem extends BaseFrameworkSystem {
                return $this->packageInstance;
        }
 
+       /**
+        * Setter for state instance
+        *
+        * @param       $stateInstance  A Stateable instance
+        * @return      void
+        */
+       public final function setStateInstance (Stateable $stateInstance) {
+               $this->stateInstance = $stateInstance;
+       }
+
+       /**
+        * Getter for state instance
+        *
+        * @return      $stateInstance  A Stateable instance
+        */
+       public final function getStateInstance () {
+               return $this->stateInstance;
+       }
+
        /**
         * Shuts down a given socket resource. This method does only ease calling
         * the right visitor.
@@ -125,6 +173,28 @@ class BaseHubSystem extends BaseFrameworkSystem {
                // Call the visitor
                $this->accept($visitorInstance);
        }
+
+       /**
+        * "Getter" for a printable state name
+        *
+        * @return      $stateName      Name of the node's state in a printable format
+        */
+       public final function getPrintableState () {
+               // Default is 'null'
+               $stateName = 'null';
+
+               // Get the state instance
+               $stateInstance = $this->getStateInstance();
+
+               // Is it an instance of Stateable?
+               if ($stateInstance instanceof Stateable) {
+                       // Then use that state name
+                       $stateName = $stateInstance->getStateName();
+               } // END - if
+
+               // Return result
+               return $stateName;
+       }
 }
 
 // [EOF]
index cbaa0e3ad861cf9da09991d6132a1a24ce960d51..39471d34dca5da6286f48f774c76a96d2714c8ed 100644 (file)
@@ -46,6 +46,19 @@ abstract class BaseHubCruncher extends BaseHubSystem implements Updateable {
        protected function __construct ($className) {
                // Call parent constructor
                parent::__construct($className);
+
+               // Init this cruncher
+               $this->initCruncher();
+       }
+
+       /**
+        * Initialize the cruncher generically
+        *
+        * @return      void
+        */
+       private function initCruncher () {
+               // Init the state
+               CruncherStateFactory::createCruncherStateInstanceByName('init', $this);
        }
 
        /**
index ca4567b7187d6b84a2e4f1ab63de9014fb524a92..65fb3ca9e06da1589a96bdf01360df172cf07d70 100644 (file)
@@ -64,7 +64,10 @@ class HubMcryptCruncher extends BaseHubCruncher implements CruncherHelper, Regis
                if ($this->getConfigInstance()->getConfigEntry('cruncher_test_units_enabled') == 'N') {
                        // They are disabled, so skip any further steps
                        return;
-               } // END - if
+               } elseif ($this->getStateInstance()->isCruncherStateVirgin()) {
+                       // No virgin crunchers please, because they usually have no test units ready for crunching
+                       return;
+               }
 
                // Get a test-unit generator instance
                $generatorInstance = ObjectFactory::createObjectByConfiguredName('cruncher_test_unit_generator_class');
@@ -86,6 +89,13 @@ class HubMcryptCruncher extends BaseHubCruncher implements CruncherHelper, Regis
         * @return      void
         */
        protected function fillInBufferQueueWithWorkUnits () {
+               // This cruncher's state must not be one of these: 'virgin'
+               if ($this->getStateInstance()->isCruncherStateVirgin()) {
+                       // We can silently skip here, until the generation is finished
+                       return;
+               } // END - if
+
+               // @TODO Implement this method
                $this->partialStub('Please implement this method.');
        }
 
index 66825162bdb7d39b328f90508b7f5895caea80f5..f551ef47b7591c74e7b59193e56a1fa6505a87ab 100644 (file)
@@ -1,59 +1,3 @@
 <?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 - 2011 Hub Developer Team
- * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.ship-simu.org
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-class StateFactory extends ObjectFactory {
-       /**
-        * Protected constructor
-        *
-        * @return      void
-        */
-       protected function __construct () {
-               // Call parent constructor
-               parent::__construct(__CLASS__);
-       }
-
-       /**
-        * Creates an instance of a configurable node state and sets it in the
-        * given node instance.
-        *
-        * @param       $stateName              Name of the state
-        * @param       $nodeInstance   A NodeHelper class instance
-        * @return      $stateInstance  A Stateable class instance
-        */
-       public static final function createStateInstanceByName ($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->setStateInstance($stateInstance);
-
-               // For any purposes, return the state instance
-               return $stateInstance;
-       }
-}
-
-// [EOF]
+// @DEPRECATED
 ?>
diff --git a/application/hub/main/factories/states/cruncher/.htaccess b/application/hub/main/factories/states/cruncher/.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/cruncher/class_CruncherStateFactory.php b/application/hub/main/factories/states/cruncher/class_CruncherStateFactory.php
new file mode 100644 (file)
index 0000000..7a326e5
--- /dev/null
@@ -0,0 +1,59 @@
+<?php
+/**
+ * A factory class for cruncher states
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 Hub Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class CruncherStateFactory extends ObjectFactory {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of a configurable cruncher state and sets it in the
+        * given cruncher instance.
+        *
+        * @param       $stateName              Name of the state
+        * @param       $cruncherInstance       A CruncherHelper class instance
+        * @return      $stateInstance  A Stateable class instance
+        */
+       public static final function createCruncherStateInstanceByName ($stateName, CruncherHelper $cruncherInstance) {
+               // Then construct the class' configuraton entry
+               $className = 'cruncher_' . $stateName . '_state_class';
+
+               // Get a class from that configuration entry
+               $stateInstance = self::createObjectByConfiguredName($className, array($cruncherInstance));
+
+               // Once we have that state, set it in the cruncher instance
+               $cruncherInstance->setStateInstance($stateInstance);
+
+               // For any purposes, return the state instance
+               return $stateInstance;
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/hub/main/factories/states/node/.htaccess b/application/hub/main/factories/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/factories/states/node/class_NodeStateFactory.php b/application/hub/main/factories/states/node/class_NodeStateFactory.php
new file mode 100644 (file)
index 0000000..d1e8f42
--- /dev/null
@@ -0,0 +1,59 @@
+<?php
+/**
+ * A factory class for node states
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 Hub Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class NodeStateFactory extends ObjectFactory {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of a configurable node state and sets it in the
+        * given node instance.
+        *
+        * @param       $stateName              Name of the 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->setStateInstance($stateInstance);
+
+               // For any purposes, return the state instance
+               return $stateInstance;
+       }
+}
+
+// [EOF]
+?>
index 813d9d5841848b9e66b59d832344333db0955b74..2122572069b38fa6e551b16ac62afb24abd7c530 100644 (file)
@@ -75,6 +75,14 @@ class CruncherTaskHandlerInitializerFilter extends BaseFilter implements Filtera
                $taskInstance = ObjectFactory::createObjectByConfiguredName('cruncher_test_unit_producer_task_class');
                $handlerInstance->registerTask('cruncher_test_unit_producer', $taskInstance);
 
+               /*
+                * 3) A task for generating keys based on the generated test unit. This
+                *    task will only be executed if the state of the cruncher is one of
+                *    these: 'virgin'.
+                */
+               $taskInstance = ObjectFactory::createObjectByConfiguredName('cruncher_key_producer_task_class');
+               $handlerInstance->registerTask('cruncher_key_producer', $taskInstance);
+
                // Put the task handler in registry
                Registry::getRegistry()->addInstance('task', $handlerInstance);
        }
index 189eb0ee8277189e076417567f1ff6094c7f50cb..5feea77bafc7cf6af9c09c8c9158d5e0b7e14d6d 100644 (file)
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 class TestUnitKeyProducerIterator extends BaseIterator implements Iterator {
+       /**
+        * Maximum different bit combinations
+        */
+       private $maxBits = 0;
+
+       /**
+        * Key length
+        */
+       private $keyLength = 0;
+
+       /**
+        * Current iteration
+        */
+       private $currentIteration = 0;
+
        /**
         * Protected constructor
         *
@@ -30,6 +45,18 @@ class TestUnitKeyProducerIterator extends BaseIterator implements Iterator {
        protected function __construct () {
                // Call parent constructor
                parent::__construct(__CLASS__);
+
+               // Get key length
+               $this->keyLength = $this->getConfigInstance()->getConfigEntry('test_unit_random_secret_key_length');
+
+               // Make sure the key length isn't getting to big (32 byte = 256 bit is really a lot)
+               assert($this->keyLength <= (8 * 32));
+
+               // Set max bits entry
+               $this->maxBits = pow(2, $this->keyLength);
+
+               // Debug message
+               $this->debugOutput('ITERATOR: maxBits=' . $this->maxBits . ',keyLength=' . $this->keyLength);
        }
 
        /**
@@ -46,15 +73,16 @@ class TestUnitKeyProducerIterator extends BaseIterator implements Iterator {
        }
 
        /**
-        * Getter for current value from group or generic
+        * Getter for current value
         *
         * @return      $current        Current value in iteration
         */
        public function current () {
-               // Default is null
-               $current = null;
+               // Calculate ASCII string representation of the key number
+               $current = $this->dec2asc($this->currentIteration);
 
-               $this->partialStub('Please implement this method.');
+               // Prepend more zeros
+               $current = $this->prependStringToString($current, chr(0), ($this->keyLength / 8));
 
                // Return it
                return $current;
@@ -76,7 +104,13 @@ class TestUnitKeyProducerIterator extends BaseIterator implements Iterator {
         * @return      void
         */
        public function next () {
-               $this->partialStub('Please implement this method.');
+               /*
+                * This is of course a very ineffective key generation iterator because
+                * it will create a lot of keys that will never decode an encrypted
+                * message. If you know a better algorithm which is freely available and
+                * can be implemented as an itertator please contact me.
+                */
+               $this->currentIteration++;
        }
 
        /**
@@ -95,7 +129,7 @@ class TestUnitKeyProducerIterator extends BaseIterator implements Iterator {
         * @return      void
         */
        public function valid () {
-               $this->partialStub('Please implement this method.');
+               return ($this->currentIteration <= $this->maxBits);
        }
 }
 
index 0b95a0a357c66c1fe99e4e8fbe1d0d9f2a6572d0..9b89aee8458c666e4a21d44241ea61a8438fb996 100644 (file)
@@ -59,11 +59,6 @@ class BaseHubNode extends BaseHubSystem implements Updateable {
         */
        private $hubIsAnnounced = false;
 
-       /**
-        * State instance
-        */
-       private $stateInstance = null;
-
        /**
         * Wether this hub is active
         */
@@ -91,7 +86,7 @@ class BaseHubNode extends BaseHubSystem implements Updateable {
        private function initState() {
                // Get the state factory and create the initial state, we don't need
                // the state instance here
-               StateFactory::createStateInstanceByName('init', $this);
+               NodeStateFactory::createNodeStateInstanceByName('init', $this);
        }
 
        /**
@@ -134,25 +129,6 @@ class BaseHubNode extends BaseHubSystem implements Updateable {
                return $this->listenerPoolInstance;
        }
 
-       /**
-        * Setter for state instance
-        *
-        * @param       $stateInstance  Node's current state instance
-        * @return      void
-        */
-       public final function setStateInstance (Stateable $stateInstance) {
-               $this->stateInstance = $stateInstance;
-       }
-
-       /**
-        * Getter for state instance
-        *
-        * @return      $stateInstance  Node's current state instance
-        */
-       public final function getStateInstance () {
-               return $this->stateInstance;
-       }
-
        /**
         * Setter for session id
         *
@@ -222,7 +198,7 @@ class BaseHubNode extends BaseHubSystem implements Updateable {
        /**
         * "Getter" for a printable state name
         *
-        * @return      $stateName      Name of the node's state in a printable format
+        * @return      $stateName      Name of the node's state in a printable format
         */
        public final function getPrintableState () {
                // Default is 'null'
index 920c38b66f71b0fbad4a938fa7fba34dbdf50e00..af8cc7318a3116f8cd9cf68bbdf165f1fe7423ba 100644 (file)
  */
 abstract class BaseProducer extends BaseFrameworkSystem {
        /**
-        * Out-going work-queue
+        * Outgoing work-queue
         */
        private $outgoingQueueInstance = null;
 
+       /**
+        * Incoming raw data/items queue
+        */
+       private $incomingQueueInstance = null;
+
        /**
         * Protected constructor
         *
@@ -45,9 +50,18 @@ abstract class BaseProducer extends BaseFrameworkSystem {
        }
 
        /**
-        * Setter for out-going work queue
+        * Getter for outgoing work queue
         *
-        * @param       $outgoingQueueInstance  The out-going work queue instance
+        * @param       $outgoingQueueInstance  The outgoing work queue instance
+        */
+       protected final function getOutgoingQueueInstance () {
+               return $this->outgoingQueueInstance;
+       }
+
+       /**
+        * Setter for outgoing work queue
+        *
+        * @param       $outgoingQueueInstance  The outgoing work queue instance
         * @return      void
         */
        private final function setOutgoingQueueInstance (Stackable $outgoingQueueInstance) {
@@ -55,12 +69,22 @@ abstract class BaseProducer extends BaseFrameworkSystem {
        }
 
        /**
-        * Getter for out-going work queue
+        * Getter for incoming raw data/items queue
         *
-        * @param       $outgoingQueueInstance  The out-going work queue instance
+        * @param       $incomingQueueInstance  The incoming raw data/items queue instance
         */
-       protected final function getOutgoingQueueInstance () {
-               return $this->outgoingQueueInstance;
+       protected final function getIncomingQueueInstance () {
+               return $this->incomingQueueInstance;
+       }
+
+       /**
+        * Setter for incoming raw data/items queue
+        *
+        * @param       $incomingQueueInstance  The incoming raw data/items queue instance
+        * @return      void
+        */
+       private final function setIncomingQueueInstance (Stackable $incomingQueueInstance) {
+               $this->incomingQueueInstance = $incomingQueueInstance;
        }
 
        /**
@@ -71,20 +95,26 @@ abstract class BaseProducer extends BaseFrameworkSystem {
        abstract protected function initProducer();
 
        /**
-        * Initializes the work queue which is being used for out-going, produced
+        * Initializes the work queue which is being used for outgoing, produced
         * items.
         *
         * @return      void
         */
        protected function initWorkQueue () {
                // Get an instance and set it in this producer
-               $this->setOutgoingQueueInstance(ObjectFactory::createObjectByConfiguredName('producer_outgoing_work_queue'));
+               $this->setOutgoingQueueInstance(ObjectFactory::createObjectByConfiguredName('producer_outgoing_queue'));
+
+               // Init the queue
+               $this->getOutgoingQueueInstance()->initStacker('outgoing_queue');
+
+               // Get an instance and set it in this producer
+               $this->setOutgoingQueueInstance(ObjectFactory::createObjectByConfiguredName('producer_incoming_queue'));
 
                // Init the queue
-               $this->getOutgoingQueueInstance()->initStacker('work_queue');
+               $this->getOutgoingQueueInstance()->initStacker('incoming_queue');
 
                // Debug message
-               $this->debugOutput('PRODUCER: Out-going work queue initialized.');
+               $this->debugOutput('PRODUCER: All queues have been initialized.');
        }
 }
 
diff --git a/application/hub/main/producer/cruncher/class_BaseKeyProducer.php b/application/hub/main/producer/cruncher/class_BaseKeyProducer.php
new file mode 100644 (file)
index 0000000..bd3fcc2
--- /dev/null
@@ -0,0 +1,38 @@
+<?php
+/**
+ * A general KeyProducer class
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 Hub Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+abstract class BaseKeyProducer extends BaseProducer {
+       /**
+        * Protected constructor
+        *
+        * @param       $className      Name of the class
+        * @return      void
+        */
+       protected function __construct ($className) {
+               // Call parent constructor
+               parent::__construct($className);
+       }
+}
+
+// [EOF]
+?>
index 328334fa1966d911bfaaf8b71db0c35451b10612..6c1c4bc2053e3f8015728867286b03ca434fe8d1 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * A general Producer class
+ * A general UnitProducer class
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
diff --git a/application/hub/main/producer/cruncher/keys/.htaccess b/application/hub/main/producer/cruncher/keys/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/hub/main/producer/cruncher/keys/class_CruncherKeyProducer.php b/application/hub/main/producer/cruncher/keys/class_CruncherKeyProducer.php
new file mode 100644 (file)
index 0000000..3b14f8e
--- /dev/null
@@ -0,0 +1,108 @@
+<?php
+/**
+ * A CruncherKey producer class
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 Hub Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+class CruncherKeyProducer extends BaseKeyProducer implements KeyProducer, Registerable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this class
+        *
+        * @return      $producerInstance       An instance of a Producer class
+        */
+       public final static function createCruncherKeyProducer () {
+               // Get new instance
+               $producerInstance = new CruncherKeyProducer();
+
+               // Get a helper instance, we now only need this for the key iterator
+               $helperInstance = ObjectFactory::createObjectByConfiguredName('crypto_random_message_helper_class', array('test'));
+
+               // Next get an iterator, again the helper will do that for us
+               $iteratorInstance = $helperInstance->getKeyIterator();
+
+               // Set it in the producer
+               $producerInstance->setIteratorInstance($iteratorInstance);
+
+               // Return the prepared instance
+               return $producerInstance;
+       }
+
+       /**
+        * Initializes the producer. This method satisfies the abstract BaseProducer
+        * class.
+        *
+        * @return      void
+        * @todo        Find something for init phase of this key producer
+        */
+       protected function initProducer () {
+       }
+
+       /**
+        * Produces some keys and pushes them onto the queue
+        *
+        * @param       $stateInstance  An instance of a Stateable instance
+        * @return      void
+        * @todo        ~30% done
+        */
+       public function produceKeys (Stateable $stateInstance) {
+               // Is this cruncher virgin?
+               if (!$stateInstance->isCruncherStateVirgin()) {
+                       // This cruncher is not virgin, so skip it
+                       $this->debugOutput('ITERATOR: The cruncher is not virgin. stateInstance=' . $stateInstance->__toString() . '.');
+                       return;
+               } elseif (!$this->getIteratorInstance()->valid()) {
+                       // This iterator has finished his assignment
+                       $this->debugOutput('ITERATOR: Finished creating keys.');
+                       return;
+               }
+
+               /*
+                * Now we need to create an iterator, just as for the work units,
+                * to create new keys from the encrypted message. The iterator will
+                * not iterate over an object nor a collection. It will instead
+                * encapsulate the "key production" into a class and not in a simple
+                * for() loop. These keys then needs to be bundled into test units
+                * and stored to database for later re-usage.
+                */
+
+               // Get current key (which is not the key of the iterator)
+               // This is always an ASCII string.
+               $currentKey = $this->getIteratorInstance()->current();
+
+               // @TODO Do something with it
+               $this->debugOutput('currentKey(b64)="' . base64_encode($currentKey) . '" needs to be processed.');
+
+               // Continue with next one
+               $this->getIteratorInstance()->next();
+       }
+}
+
+// [EOF]
+?>
index 673e9d037f47431af0ccc824fd2ab25d46ef25a9..4c88ff6f4f536632dfb64cc75d38014494d112c5 100644 (file)
@@ -72,12 +72,13 @@ class CruncherTestUnitProducer extends BaseUnitProducer implements UnitProducer,
        }
 
        /**
-        * Produces some test units and pushes them onto the queue
+        * Prepares the produces of some test units and pushes them onto the queue
         *
+        * @param       $stateInstance  An instance of a Stateable instance
         * @return      void
-        * @todo        ~30% done
+        * @todo        ~60% done
         */
-       public function produceUnits () {
+       public function prepareUnitProduction (Stateable $stateInstance) {
                // First get a database wrapper because we want to permanently store test units
                $wrapperInstance = ObjectFactory::createObjectByConfiguredName('cruncher_unit_db_wrapper_class');
 
@@ -97,6 +98,9 @@ class CruncherTestUnitProducer extends BaseUnitProducer implements UnitProducer,
                        // Entries found
                        // @TODO Unfinished work here
                        $this->debugInstance();
+
+                       // The state must be changed because ...
+                       $stateInstance->someFooStateChange();
                } else {
                        // Get an encrypted, random message from our source
                        $encryptedMessage = $this->getHelperInstance()->generateRandomMessage();
@@ -107,31 +111,8 @@ class CruncherTestUnitProducer extends BaseUnitProducer implements UnitProducer,
                        // Set the encrypted message in the template instance
                        $this->getTemplateInstance()->assignVariable('encrypted_message', $encryptedMessage);
 
-                       /*
-                        * Now we need to create an iterator, just as for the work units,
-                        * to create new keys from the encrypted message. The iterator will
-                        * not iterate over an object nor a collection. It will instead
-                        * encapsulate the "key production" into a class and not in a simple
-                        * for() loop. These keys then needs to be bundled into test units
-                        * and stored to database for later re-usage.
-                        */
-
-                       // First get an iterator, again the helper will do that for us
-                       $iteratorInstance = $this->getHelperInstance()->getKeyIterator();
-
-                       // Begin the "key production"
-                       while ($iteratorInstance->valid()) {
-                               // Get current key (which is not the key of the iterator)
-                               $currentKey = $iteratorInstance->current();
-
-                               // @TODO Do something with it
-                               $this->debugOutput('currentKey=' . $currentKey . ' needs to be processed.');
-
-                               // Continue with next one
-                               $iteratorInstance->next();
-                       } // END - while
-
-                       die(__METHOD__ . ": Ended the key production.\n");
+                       // The state must be changed because we have a new message
+                       $stateInstance->encryptedMessageGenerated();
                }
        }
 }
index 804b06c2ea262b8a0846dcfa747717484e6c5372..0de4ac22be0642109a69cc3ac7744304f9d6f07d 100644 (file)
@@ -63,7 +63,7 @@ class TestUnitSource extends BaseSource implements Sourceable {
                $secretMessage = base64_encode($this->getRngInstance()->randomString($this->getConfigInstance()->getConfigEntry('random_secret_message_length')));
 
                // Get a random, secret key
-               $secretKey = $this->getRngInstance()->randomString($this->getConfigInstance()->getConfigEntry('random_secret_key_length'));
+               $secretKey = $this->getRngInstance()->randomString($this->getConfigInstance()->getConfigEntry('test_unit_random_secret_key_length') / 8);
 
                // Now encrypt the message with our key and a good (strong) cipher
                $encryptedMessage = base64_encode($this->getCryptoInstance()->encryptString($secretMessage, $secretKey));
index bdb26830b36e4c7458bf79e9e592b2caffa866d4..3f4f17e43ed6a9ce2b55e49103450784a86514b0 100644 (file)
@@ -60,6 +60,17 @@ class BaseState extends BaseHubSystem implements Stateable {
        protected final function setStateName ($stateName) {
                $this->stateName = $stateName;
        }
+
+       /**
+        * Executes the state with given Executor instance
+        *
+        * @param       $executorInstance       An instance of a Executor class
+        * @return      void
+        * @throws      UnsupportedOperationException   This method should be overwritten
+        */
+       public function executeState (Executor $executorInstance) {
+               throw new UnsupportedOperationException(array($this, __FUNCTION__, $executorInstance), self::EXCEPTION_UNSPPORTED_OPERATION);
+       }
 }
 
 // [EOF]
diff --git a/application/hub/main/states/cruncher/.htaccess b/application/hub/main/states/cruncher/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/hub/main/states/cruncher/class_ b/application/hub/main/states/cruncher/class_
new file mode 100644 (file)
index 0000000..b3925cb
--- /dev/null
@@ -0,0 +1,70 @@
+<?php
+/**
+ * A ??? cruncher state class
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 Hub Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+class Cruncher???State extends BaseCruncherState implements Stateable {
+       /**
+        * 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       $cruncherInstance       An instance of a CruncherHelper class
+        * @return      $stateInstance  An instance of a Stateable class
+        */
+       public final static function createCruncher???State (CruncherHelper $cruncherInstance) {
+               // Get new instance
+               $stateInstance = new Cruncher???State();
+
+               // Debug message
+               $stateInstance->debugOutput('CRUNCHER-STATE: Has changed from ' . $cruncherInstance->getPrintableState() . ' to ' . $stateInstance->getStateName() . '.');
+
+               // Set the cruncher instance
+               $stateInstance->setCruncherInstance($cruncherInstance);
+
+               // Return the prepared instance
+               return $stateInstance;
+       }
+
+       /**
+        * Executes the state with given Executor instance
+        *
+        * @param       $executorInstance       An instance of a Executor class
+        * @return      void
+        */
+       public function executeState (Executor $executorInstance) {
+               $this->partialStub('This state needs implementation. executorInstance=' . $executorInstance->__toString());
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/hub/main/states/cruncher/class_BaseCruncherState.php b/application/hub/main/states/cruncher/class_BaseCruncherState.php
new file mode 100644 (file)
index 0000000..c65ef1a
--- /dev/null
@@ -0,0 +1,63 @@
+<?php
+/**
+ * A general cruncher state class
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 Hub Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+class BaseCruncherState extends BaseState {
+       /**
+        * Protected constructor
+        *
+        * @param       $className      Name of the class
+        * @return      void
+        */
+       protected function __construct ($className) {
+               // Call parent constructor
+               parent::__construct($className);
+       }
+
+       /**
+        * Validates wether the state is 'active' or throws an exception if
+        * it is every other state.
+        *
+        * @return      void
+        * @throws      InvalidStateException   If the state is not 'active'
+        */
+       public function validateCruncherStateIsActive () {
+               // Just compare it...
+               if (!$this instanceof CruncherActiveState) {
+                       // Throw the exception
+                       throw new InvalidStateException($this, self::EXCEPTION_INVALID_STATE);
+               } // END - if
+       }
+
+       /**
+        * Checks if this state is 'virgin'
+        *
+        * @return      $isVirgin       Wether this state is 'virgin'
+        */
+       public function isCruncherStateVirgin () {
+               // Just compare it...
+               return ($this instanceof CruncherVirginState);
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/hub/main/states/cruncher/init/.htaccess b/application/hub/main/states/cruncher/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/cruncher/init/class_CruncherInitState.php b/application/hub/main/states/cruncher/init/class_CruncherInitState.php
new file mode 100644 (file)
index 0000000..1caf37c
--- /dev/null
@@ -0,0 +1,82 @@
+<?php
+/**
+ * A Init cruncher state class
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 Hub Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+class CruncherInitState extends BaseCruncherState implements Stateable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+
+               // Set state name
+               $this->setStateName('init');
+       }
+
+       /**
+        * Creates an instance of this class
+        *
+        * @param       $cruncherInstance       An instance of a CruncherHelper class
+        * @return      $stateInstance  An instance of a Stateable class
+        */
+       public final static function createCruncherInitState (CruncherHelper $cruncherInstance) {
+               // Get new instance
+               $stateInstance = new CruncherInitState();
+
+               // Debug message
+               $stateInstance->debugOutput('CRUNCHER-STATE: Has changed from ' . $cruncherInstance->getPrintableState() . ' to ' . $stateInstance->getStateName() . '.');
+
+               // Set the cruncher instance
+               $stateInstance->setCruncherInstance($cruncherInstance);
+
+               // Return the prepared instance
+               return $stateInstance;
+       }
+
+       /**
+        * Executes the state with given Executor instance
+        *
+        * @param       $executorInstance       An instance of a Executor class
+        * @return      void
+        */
+       public function executeState (Executor $executorInstance) {
+               // Now prepare the unit production to maybe become 'virgin' or 'active' if work/test units are there
+               $executorInstance->prepareUnitProduction($this);
+       }
+
+       /**
+        * An encrypted message has been generated so we change the state to
+        * 'virgin'.
+        *
+        * @return      void
+        */
+       public function encryptedMessageGenerated () {
+               // Change the state now to 'virgin'
+               CruncherStateFactory::createCruncherStateInstanceByName('virgin', $this->getCruncherInstance());
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/hub/main/states/cruncher/virgin/.htaccess b/application/hub/main/states/cruncher/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/cruncher/virgin/class_CruncherVirginState.php b/application/hub/main/states/cruncher/virgin/class_CruncherVirginState.php
new file mode 100644 (file)
index 0000000..6f567f4
--- /dev/null
@@ -0,0 +1,71 @@
+<?php
+/**
+ * A Virgin cruncher state class
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 Hub Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+class CruncherVirginState extends BaseCruncherState implements Stateable {
+       /**
+        * 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       $cruncherInstance       An instance of a CruncherHelper class
+        * @return      $stateInstance  An instance of a Stateable class
+        */
+       public final static function createCruncherVirginState (CruncherHelper $cruncherInstance) {
+               // Get new instance
+               $stateInstance = new CruncherVirginState();
+
+               // Debug message
+               $stateInstance->debugOutput('CRUNCHER-STATE: Has changed from ' . $cruncherInstance->getPrintableState() . ' to ' . $stateInstance->getStateName() . '.');
+
+               // Set the cruncher instance
+               $stateInstance->setCruncherInstance($cruncherInstance);
+
+               // Return the prepared instance
+               return $stateInstance;
+       }
+
+       /**
+        * Executes the state with given Executor instance
+        *
+        * @param       $executorInstance       An instance of a Executor class
+        * @return      void
+        */
+       public function executeState (Executor $executorInstance) {
+               // Produce some keys now
+               $executorInstance->produceKeys($this);
+       }
+}
+
+// [EOF]
+?>
index 516eed987e554b92e5dd0aac0bab4199708a4478..9822dfaa855decf2f0da6073f0577d504f194f60 100644 (file)
@@ -65,7 +65,7 @@ class NodeActiveState extends BaseNodeState implements Stateable {
         */
        public function nodeAnnouncedToUpperHubs () {
                // Create the new state instance
-               StateFactory::createStateInstanceByName('announced', $this->getNodeInstance());
+               NodeStateFactory::createNodeStateInstanceByName('announced', $this->getNodeInstance());
        }
 }
 
index 263ad0dc1ea1ec7c2b768a0b7830e74899b237af..30b080f920c2d929ddaa550516d577dec6ee551c 100644 (file)
@@ -21,7 +21,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-class NodeAnnouncedState extends BaseState implements Stateable {
+class NodeAnnouncedState extends BaseNodeState implements Stateable {
        /**
         * Protected constructor
         *
index 6b6491d01c73a075ecb95bfbb8cfdc7f0c5f2268..efc807d39dfc9e536571436b7ce1bdd7e052ac88 100644 (file)
@@ -21,7 +21,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-class Node???State extends BaseState implements Stateable {
+class Node???State extends BaseNodeState implements Stateable {
        /**
         * Protected constructor
         *
index 3312c34e9a223204030720f145d2d19453cb7411..473204dce5ca556440f1613e2d0d2c9e00fc2914 100644 (file)
@@ -60,10 +60,11 @@ class NodeInitState extends BaseNodeState implements Stateable {
         * nodes with current state 'init' now 'virgin'.
         *
         * @return      void
+        * @todo        We might want to move some calls to this method to fill it with life
         */
        public function nodeGeneratedSessionId () {
                // Create the new state instance
-               StateFactory::createStateInstanceByName('virgin', $this->getNodeInstance());
+               NodeStateFactory::createNodeStateInstanceByName('virgin', $this->getNodeInstance());
        }
 
 }
index e3e8425ce69494a65684b09e79d080d762c4101c..61e2395553ecc683b357fb3ad022632e6f2d80ac 100644 (file)
@@ -65,7 +65,7 @@ class NodeVirginState extends BaseNodeState implements Stateable {
         */
        public function nodeIsActivated () {
                // Create the new state instance
-               StateFactory::createStateInstanceByName('active', $this->getNodeInstance());
+               NodeStateFactory::createNodeStateInstanceByName('active', $this->getNodeInstance());
        }
 
 }
diff --git a/application/hub/main/tasks/cruncher/class_CruncherKeyProducerTask.php b/application/hub/main/tasks/cruncher/class_CruncherKeyProducerTask.php
new file mode 100644 (file)
index 0000000..7e1c4a2
--- /dev/null
@@ -0,0 +1,90 @@
+<?php
+/**
+ * A KeyProducer task for crunchers
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 Hub Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+class CruncherKeyProducerTask extends BaseTask implements Taskable, Visitable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this class
+        *
+        * @return      $taskInstance   An instance of a Visitable class
+        */
+       public final static function createCruncherKeyProducerTask () {
+               // Get new instance
+               $taskInstance = new CruncherKeyProducerTask();
+
+               // Return the prepared instance
+               return $taskInstance;
+       }
+
+       /**
+        * Accepts the visitor to process the visit "request"
+        *
+        * @param       $visitorInstance        An instance of a Visitor class
+        * @return      void
+        * @todo        Maybe visit some sub-objects
+        */
+       public function accept (Visitor $visitorInstance) {
+               // Visit this task
+               $visitorInstance->visitTask($this);
+       }
+
+       /**
+        * Executes the task
+        *
+        * @return      void
+        */
+       public function executeTask () {
+               // First we check if we already have an instance (which will happen at any later cyclus)
+               if (!Registry::getRegistry()->instanceExists('key_producer')) {
+                       // No instance found, so we need to create a producer instance
+                       $producerInstance = ObjectFactory::createObjectByConfiguredName('cruncher_key_producer_class');
+
+                       // ... and add it to the registry
+                       Registry::getRegistry()->addInstance('key_producer', $producerInstance);
+               } else {
+                       // Get the producer instance from registry
+                       $producerInstance = Registry::getRegistry()->getInstance('key_producer');
+               }
+
+               // Get the current cruncher state from registry
+               $stateInstance = Registry::getRegistry()->getInstance('cruncher')->getStateInstance();
+
+               // Debug message
+               //* DEBUG: */ $this->debugOutput('TASK: Executing stateInstance=' . $stateInstance->__toString());
+
+               // We can now invoke that state instance and pass our producer instance for generating some test units
+               $stateInstance->executeState($producerInstance);
+       }
+}
+
+// [EOF]
+?>
index acaa55798a71fed85aa2d451e95b779317b659bc..5b62110b9ad53cd8c01b3af748d6ceefa4153405 100644 (file)
@@ -61,7 +61,6 @@ class CruncherTestUnitProducerTask extends BaseTask implements Taskable, Visitab
         * Executes the task
         *
         * @return      void
-        * @todo        0%
         */
        public function executeTask () {
                // First we check if we already have an instance (which will happen at any later cyclus)
@@ -76,8 +75,14 @@ class CruncherTestUnitProducerTask extends BaseTask implements Taskable, Visitab
                        $producerInstance = Registry::getRegistry()->getInstance('test_unit_producer');
                }
 
-               // We can now use that producer instance for generating some test units
-               $producerInstance->produceUnits();
+               // Get the current cruncher state from registry
+               $stateInstance = Registry::getRegistry()->getInstance('cruncher')->getStateInstance();
+
+               // Debug message
+               //* DEBUG: */ $this->debugOutput('TASK: Executing stateInstance=' . $stateInstance->__toString());
+
+               // We can now invoke that state instance and pass our producer instance for generating some test units
+               $stateInstance->executeState($producerInstance);
        }
 }
 
index 58dfcd9b6dbfe2f91c26cf104990516561ac4c82..14eb7f90cbaaeb213fbdc325ee2c5bae94043c2a 100644 (file)
@@ -9,9 +9,10 @@
 ./application/hub/main/connectors/query/local/class_LocalQueryConnector.php:10: * @todo                Find an interface for: handleAllQueries()
 ./application/hub/main/connectors/query/local/class_LocalQueryConnector.php:78:         * @TODO        0% done: Unfinished work here
 ./application/hub/main/connectors/queues/local/class_LocalQueueConnector.php:58:        * @TODO        0% done: Unfinished work here
-./application/hub/main/cruncher/class_BaseHubCruncher.php:175:  * @todo        Try to make this method more generic so we can move it in BaseFrameworkSystem
-./application/hub/main/cruncher/mcrypt/class_HubMcryptCruncher.php:128:         * @todo        0% done
-./application/hub/main/cruncher/mcrypt/class_HubMcryptCruncher.php:98:  * @todo        Implement this method
+./application/hub/main/cruncher/class_BaseHubCruncher.php:188:  * @todo        Try to make this method more generic so we can move it in BaseFrameworkSystem
+./application/hub/main/cruncher/mcrypt/class_HubMcryptCruncher.php:108:         * @todo        Implement this method
+./application/hub/main/cruncher/mcrypt/class_HubMcryptCruncher.php:138:         * @todo        0% done
+./application/hub/main/cruncher/mcrypt/class_HubMcryptCruncher.php:98:         // @TODO Implement this method
 ./application/hub/main/discovery/socket/class_PackageSocketDiscovery.php:102:                  // @TODO We may need some locking here
 ./application/hub/main/factories/socket/class_SocketFactory.php:10: * @todo            Find an interface for hub helper
 ./application/hub/main/filter/bootstrap/cruncher/class_CruncherBootstrapBufferQueueInitializerFilter.php:54:    * @todo        0% done
@@ -51,9 +52,9 @@
 ./application/hub/main/nodes/boot/class_HubBootNode.php:119:           // @TODO Add some filters here
 ./application/hub/main/nodes/boot/class_HubBootNode.php:58:     * @todo        add some more special bootstrap things for this boot node
 ./application/hub/main/nodes/boot/class_HubBootNode.php:99:     * @todo        Unfinished method
-./application/hub/main/nodes/class_BaseHubNode.php:452:         * @todo        Try to make this method more generic so we can move it in BaseFrameworkSystem
-./application/hub/main/nodes/class_BaseHubNode.php:492:         * @todo        Change the first if() block to check for a specific state
-./application/hub/main/nodes/class_BaseHubNode.php:667:                // @TODO Add some criteria, e.g. if the node is active or so
+./application/hub/main/nodes/class_BaseHubNode.php:428:         * @todo        Try to make this method more generic so we can move it in BaseFrameworkSystem
+./application/hub/main/nodes/class_BaseHubNode.php:468:         * @todo        Change the first if() block to check for a specific state
+./application/hub/main/nodes/class_BaseHubNode.php:643:                // @TODO Add some criteria, e.g. if the node is active or so
 ./application/hub/main/nodes/list/class_HubListNode.php:58:     * @todo        Implement more bootstrap steps
 ./application/hub/main/nodes/list/class_HubListNode.php:68:     * @todo        Unfinished method
 ./application/hub/main/nodes/list/class_HubListNode.php:91:            // @TODO Add some filters here
 ./application/hub/main/package/class_NetworkPackage.php:383:                   // @TODO Add some logging here
 ./application/hub/main/package/class_NetworkPackage.php:409:                   // @TODO Add some logging here
 ./application/hub/main/pools/peer/class_DefaultPeerPool.php:148:                       // @TODO Check for IP
-./application/hub/main/producer/cruncher/work_units/class_CruncherTestUnitProducer.php:127:                            // @TODO Do something with it
-./application/hub/main/producer/cruncher/work_units/class_CruncherTestUnitProducer.php:78:      * @todo        ~30% done
-./application/hub/main/producer/cruncher/work_units/class_CruncherTestUnitProducer.php:98:                     // @TODO Unfinished work here
+./application/hub/main/producer/cruncher/keys/class_CruncherKeyProducer.php:62:         * @todo        Find something for init phase of this key producer
+./application/hub/main/producer/cruncher/keys/class_CruncherKeyProducer.php:72:         * @todo        ~30% done
+./application/hub/main/producer/cruncher/keys/class_CruncherKeyProducer.php:99:                // @TODO Do something with it
+./application/hub/main/producer/cruncher/work_units/class_CruncherTestUnitProducer.php:79:      * @todo        ~60% done
+./application/hub/main/producer/cruncher/work_units/class_CruncherTestUnitProducer.php:99:                     // @TODO Unfinished work here
 ./application/hub/main/resolver/state/network/class_NetworkStateResolver.php:68:        * @todo        ~30% done
 ./application/hub/main/resolver/state/network/class_NetworkStateResolver.php:80:                       // @TODO On some systems it is 134, on some 107?
+./application/hub/main/states/node/init/class_NodeInitState.php:63:     * @todo        We might want to move some calls to this method to fill it with life
+./application/hub/main/tasks/cruncher/class_CruncherKeyProducerTask.php:53:     * @todo        Maybe visit some sub-objects
 ./application/hub/main/tasks/cruncher/class_CruncherTestUnitProducerTask.php:53:        * @todo        Maybe visit some sub-objects
-./application/hub/main/tasks/cruncher/class_CruncherTestUnitProducerTask.php:64:        * @todo        0%
 ./application/hub/main/tasks/cruncher/class_CruncherWorkUnitFetcherTask.php:54:         * @todo        Maybe visit some sub-objects
 ./application/hub/main/tasks/hub/announcement/class_HubSelfAnnouncementTask.php:53:     * @todo        0%
 ./application/hub/main/tasks/hub/class_HubSelfConnectTask.php:53:       * @todo        0%
 ./inc/classes/exceptions/main/class_MissingMethodException.php:13: * @todo             Try to rewrite user/guest login classes and mark this exception as deprecated
 ./inc/classes/exceptions/main/class_NoConfigEntryException.php:10: * @todo             Rename this class to NoFoundEntryException
 ./inc/classes/interfaces/class_FrameworkInterface.php:11: * @todo              Find a better name for this interface
-./inc/classes/main/class_BaseFrameworkSystem.php:1197:  * @todo        Write a logging mechanism for productive mode
-./inc/classes/main/class_BaseFrameworkSystem.php:1211:                 // @TODO Finish this part!
+./inc/classes/main/class_BaseFrameworkSystem.php:1237:  * @todo        Write a logging mechanism for productive mode
+./inc/classes/main/class_BaseFrameworkSystem.php:1251:                 // @TODO Finish this part!
 ./inc/classes/main/class_BaseFrameworkSystem.php:169:  // @todo Try to clean these constants up
-./inc/classes/main/class_BaseFrameworkSystem.php:368:   * @todo        SearchableResult and UpdateableResult shall have a super interface to use here
+./inc/classes/main/class_BaseFrameworkSystem.php:408:   * @todo        SearchableResult and UpdateableResult shall have a super interface to use here
 ./inc/classes/main/commands/web/class_WebLoginAreaCommand.php:64:       * @todo        Add some stuff here: Some personal data, app/game related data
 ./inc/classes/main/commands/web/class_WebProblemCommand.php:58:         * @todo        0% done
 ./inc/classes/main/commands/web/class_WebStatusCommand.php:58:  * @todo        0% done
 ./inc/classes/main/response/image/class_ImageResponse.php:91:   * @todo        this will send only one cookie out, the first one.
 ./inc/classes/main/result/class_DatabaseResult.php:226:         * @todo        0% done
 ./inc/classes/main/result/class_DatabaseResult.php:379:4        * @todo        Find a caching way without modifying the result array
-./inc/classes/main/rng/class_RandomNumberGenerator.php:152:     * @todo        I had a better random number generator here but now it is somewhere lost :(
+./inc/classes/main/rng/class_RandomNumberGenerator.php:161:     * @todo        I had a better random number generator here but now it is somewhere lost :(
 ./inc/classes/main/rng/class_RandomNumberGenerator.php:83:      * @todo        Add site key for stronger salt!
 ./inc/classes/main/template/class_BaseTemplateEngine.php:1055:                 // @TODO This silent abort should be logged, maybe.
 ./inc/classes/main/template/class_BaseTemplateEngine.php:1063:                 // @TODO Old behaviour, will become obsolete!
 ./application/hub/main/database/wrapper/class_NodeInformationDatabaseWrapper.php:2:// @DEPRECATED
 ./application/hub/main/database/wrapper/class_NodeListDatabaseWrapper.php:2:// @DEPRECATED
 ./application/hub/main/database/wrapper/class_PeerStateLookupDatabaseWrapper.php:2:// @DEPRECATED
+./application/hub/main/factories/states/class_StateFactory.php:2:// @DEPRECATED
 ./application/hub/main/filter/activation/class_HubActivationSelfAnnouncementFilter.php:2:// @DEPRECATED
 ./application/hub/main/filter/bootstrap/class_HubBootstrapAquireHubIdFilter.php:2:// @DEPRECATED
 ./application/hub/main/filter/bootstrap/class_HubBootstrapExtraBootstrappingFilter.php:2:// @DEPRECATED
 ./inc/classes/exceptions/language/class_MissingLanguageHandlerException.php:2:// @DEPRECATED
 ./inc/classes/exceptions/main/class_ClassNotFoundException.php:2:// @DEPRECATED
 ./inc/classes/exceptions/main/class_ConfigEntryNotFoundException.php:2:// @DEPRECATED
+./inc/classes/exceptions/main/class_MissingMethodException.php:14: * @deprecated       Please do no longer use this exception
 ./inc/classes/interfaces/helper/class_HelpableLogin.php:2:// @DEPRECATED
 ./inc/classes/interfaces/helper/class_HelpableTemplate.php:2:// @DEPRECATED
 ./inc/classes.php:9: * @deprecated