]> git.mxchange.org Git - hub.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Thu, 5 Nov 2020 23:03:47 +0000 (00:03 +0100)
committerRoland Häder <roland@mxchange.org>
Thu, 5 Nov 2020 23:03:47 +0000 (00:03 +0100)
- introduced abstract classes BaseCruncherProducer and BaseMinerProducer as the
  cruncher won't have a miner registry key ready.
- added missing namespaces
- imported missing classes/interfaces

Signed-off-by: Roland Häder <roland@mxchange.org>
49 files changed:
application/hub/class_ApplicationHelper.php
application/hub/classes/compressor/decorator/class_NetworkPackageCompressorDecorator.php
application/hub/classes/cruncher/class_BaseHubCruncher.php
application/hub/classes/cruncher/mcrypt/.htaccess [deleted file]
application/hub/classes/cruncher/mcrypt/class_HubMcryptCruncher.php [deleted file]
application/hub/classes/cruncher/openssl/.htaccess [new file with mode: 0644]
application/hub/classes/cruncher/openssl/class_HubOpenSslCruncher.php [new file with mode: 0644]
application/hub/classes/database/frontend/cruncher/class_CruncherUnitDatabaseWrapper.php
application/hub/classes/discovery/recipient/class_BaseRecipientDiscovery.php
application/hub/classes/factories/source/units/class_UnitSourceFactory.php
application/hub/classes/factories/states/cruncher/class_CruncherStateFactory.php
application/hub/classes/filter/bootstrap/cruncher/class_CruncherBootstrapBufferQueueInitializerFilter.php
application/hub/classes/filter/bootstrap/cruncher/class_CruncherBootstrapExtraBootstrappingFilter.php
application/hub/classes/filter/bootstrap/cruncher/class_CruncherBootstrapGenericActivationFilter.php
application/hub/classes/filter/cruncher/class_CruncherInitializationFilter.php
application/hub/classes/filter/cruncher/class_CruncherPhpRequirementsFilter.php
application/hub/classes/filter/cruncher/class_CruncherWelcomeTeaserFilter.php
application/hub/classes/filter/shutdown/cruncher/class_CruncherShutdownFilter.php
application/hub/classes/filter/task/cruncher/class_CruncherTaskHandlerInitializerFilter.php
application/hub/classes/handler/data/answer-status/class_BaseAnswerStatusHandler.php
application/hub/classes/helper/messages/crypto/class_CryptoRandomUnitMessageHelper.php
application/hub/classes/helper/work_units/cruncher/class_CruncherTestUnitHelper.php
application/hub/classes/iterator/producer/keys/class_TestUnitKeyProducerIterator.php
application/hub/classes/miner/chash/class_HubCoinMiner.php
application/hub/classes/producer/class_BaseProducer.php
application/hub/classes/producer/cruncher/class_BaseCruncherProducer.php [new file with mode: 0644]
application/hub/classes/producer/cruncher/class_BaseKeyProducer.php [deleted file]
application/hub/classes/producer/cruncher/class_BaseUnitProducer.php [deleted file]
application/hub/classes/producer/cruncher/keys/class_BaseKeyProducer.php [new file with mode: 0644]
application/hub/classes/producer/cruncher/keys/class_CruncherKeyProducer.php [deleted file]
application/hub/classes/producer/cruncher/keys/cruncher/.htaccess [new file with mode: 0644]
application/hub/classes/producer/cruncher/keys/cruncher/class_CruncherKeyProducer.php [new file with mode: 0644]
application/hub/classes/producer/cruncher/work_units/class_BaseUnitProducer.php [new file with mode: 0644]
application/hub/classes/producer/cruncher/work_units/class_CruncherTestUnitProducer.php [deleted file]
application/hub/classes/producer/cruncher/work_units/cruncher/.htaccess [new file with mode: 0644]
application/hub/classes/producer/cruncher/work_units/cruncher/class_CruncherTestUnitProducer.php [new file with mode: 0644]
application/hub/classes/producer/miner/blocks/class_BaseBlockProducer.php [new file with mode: 0644]
application/hub/classes/producer/miner/blocks/class_MinerRealGenesisBlockProducer.php [deleted file]
application/hub/classes/producer/miner/blocks/class_MinerTestGenesisBlockProducer.php [deleted file]
application/hub/classes/producer/miner/blocks/miner/.htaccess [new file with mode: 0644]
application/hub/classes/producer/miner/blocks/miner/class_MinerRealGenesisBlockProducer.php [new file with mode: 0644]
application/hub/classes/producer/miner/blocks/miner/class_MinerTestGenesisBlockProducer.php [new file with mode: 0644]
application/hub/classes/producer/miner/class_BaseBlockProducer.php [deleted file]
application/hub/classes/producer/miner/class_BaseMinerProducer.php [new file with mode: 0644]
application/hub/classes/states/cruncher/init/class_CruncherInitState.php
application/hub/classes/states/cruncher/virgin/class_CruncherVirginState.php
application/hub/config.php
application/hub/interfaces/producer/keys/class_KeyProducer.php
application/hub/interfaces/producer/work_units/class_UnitProducer.php

index 11a15027d91c7adcaf9120ea9dc66ad55dec135c..df604326b33de9696dad7782b2f7bf0a0646a1d3 100644 (file)
@@ -11,7 +11,6 @@ use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
 use Org\Mxchange\CoreFramework\Loader\ClassLoader;
 use Org\Mxchange\CoreFramework\Manager\ManageableApplication;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
 use Org\Mxchange\CoreFramework\Registry\Registerable;
 use Org\Mxchange\CoreFramework\Template\CompileableTemplate;
 
index 56c4e946b7ba8b41e364af0876209f23be494f55..d2a5ac585739963eba9a5ac3e3f445075e331c2c 100644 (file)
@@ -5,7 +5,7 @@ namespace Org\Shipsimu\Hub\Network\Compressor\Package;
 // Import application-specific stuff
 use Org\Shipsimu\Hub\Generic\BaseHubSystem;
 
-// Import framework-specific stuff
+// Import framework stuff
 use Org\Mxchange\CoreFramework\Compressor\Compressor;
 
 /**
index 5e6c50ef4038abc6229a227acf2d6da73b60ab58..15771d1335aa96255f4a90e1cdb3afce0bb9dc21 100644 (file)
@@ -3,6 +3,7 @@
 namespace Org\Shipsimu\Hub\Cruncher;
 
 // Import application-specific stuff
+use Org\Shipsimu\Hub\Factory\State\Cruncher\CruncherStateFactory;
 use Org\Shipsimu\Hub\Generic\BaseHubSystem;
 
 // Import framework stuff
diff --git a/application/hub/classes/cruncher/mcrypt/.htaccess b/application/hub/classes/cruncher/mcrypt/.htaccess
deleted file mode 100644 (file)
index 3a42882..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Deny from all
diff --git a/application/hub/classes/cruncher/mcrypt/class_HubMcryptCruncher.php b/application/hub/classes/cruncher/mcrypt/class_HubMcryptCruncher.php
deleted file mode 100644 (file)
index 4ceaabd..0000000
+++ /dev/null
@@ -1,156 +0,0 @@
-<?php
-// Own namespace
-namespace Org\Shipsimu\Hub\Cruncher\Mcrypt;
-
-// Import framework stuff
-use Org\Mxchange\CoreFramework\Controller\Controller;
-use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
-use Org\Mxchange\CoreFramework\Registry\Registerable;
-use Org\Mxchange\CoreFramework\Response\Responseable;
-
-/**
- * A hub-mcrypt cruncher class
- *
- * @author             Roland Haeder <webmaster@shipsimu.org>
- * @version            0.0.0
- * @copyright  Copyright (c) 2011 - 2014 - 2018 Hub Developer Team
- * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.shipsimu.org
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-class HubMcryptCruncher extends BaseHubCruncher implements CruncherHelper, Registerable {
-       /**
-        * Protected constructor
-        *
-        * @return      void
-        */
-       protected function __construct () {
-               // Call parent constructor
-               parent::__construct(__CLASS__);
-
-               // Set version number
-               $this->setVersion('0.0.0');
-       }
-
-       /**
-        * Creates an instance of this hub-cruncher class
-        *
-        * @return      $cruncherInstance       An instance of this hub-cruncher class
-        */
-       public final static function createHubMcryptCruncher () {
-               // Get a new instance
-               $cruncherInstance = new HubMcryptCruncher();
-
-               // Return the instance
-               return $cruncherInstance;
-       }
-
-       /**
-        * This method fills the in-buffer with (a) test unit(s) which are mainly
-        * used for development of the crunching part. They must be enabled in
-        * configuration, or else your cruncher runs out of WUs and waits for more
-        * to show up.
-        *
-        * In this method we already know that the in-buffer is going depleted so
-        * no need to double-check it here.
-        *
-        * @return      void
-        */
-       protected function fillInBufferQueueWithTestUnits () {
-               // Are test units enabled?
-               if ($this->getConfigInstance()->getConfigEntry('cruncher_test_units_enabled') == 'N') {
-                       // They are disabled, so skip any further steps
-                       return;
-               } 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');
-
-               // We don't need an iterator here because we just need to generate some test units
-               for ($idx = 0; $idx < $this->getConfigInstance()->getConfigEntry('cruncher_max_text_unit_amount'); $idx++) {
-                       // Get a test unit from it
-                       $unitInstance = $generatorInstance->generateNextUnitInstance();
-
-                       // ... and finally queue it to the in-buffer queue
-                       $this->queueUnitInstanceToInBuffer($unitInstance);
-               } // END - for
-       }
-
-       /**
-        * This method fills the in-buffer with (real) WUs which will be crunched
-        * and the result be sent back to the key producer instance.
-        *
-        * @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.');
-       }
-
-       /**
-        * Method to "bootstrap" the cruncher. This step does also apply provided
-        * command-line arguments stored in the request instance. No buffer queue
-        * will be initialized here, we only do "general" things here.
-        *
-        * @return      void
-        * @todo        Implement this method
-        */
-       public function doBootstrapping () {
-               $this->partialStub('Please implement this method.');
-       }
-
-       /**
-        * Outputs the console teaser. This should only be executed on startup or
-        * full restarts. This method generates some space around the teaser.
-        *
-        * @return      void
-        */
-       public function outputConsoleTeaser () {
-               // Output all lines
-               self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(' ');
-               self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('MCrypt Cruncher v' . $this->getVersion() . ' is starting ...');
-               self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('Copyright (c) 2011 - 2014 - 2018 Hub Developer Team');
-               self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(' ');
-               self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('This program comes with ABSOLUTELY NO WARRANTY; for details see docs/COPYING.');
-               self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('This is free software, and you are welcome to redistribute it under certain');
-               self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('conditions; see docs/COPYING for details.');
-               self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(' ');
-       }
-
-       /**
-        * Add some cruncher-specific filters
-        *
-        * @param       $controllerInstance     An object of a Controller instance
-        * @param       $responseInstance       An object of a Responseable instance
-        * @return      void
-        * @todo        0% done
-        */
-       public function addExtraFilters (Controller $controllerInstance, Responseable $responseInstance) {
-               // Add some filters here
-               $this->partialStub('Please add some cruncher-specific filters, if required.');
-       }
-}
-
-// [EOF]
-?>
diff --git a/application/hub/classes/cruncher/openssl/.htaccess b/application/hub/classes/cruncher/openssl/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/hub/classes/cruncher/openssl/class_HubOpenSslCruncher.php b/application/hub/classes/cruncher/openssl/class_HubOpenSslCruncher.php
new file mode 100644 (file)
index 0000000..455ee4e
--- /dev/null
@@ -0,0 +1,158 @@
+<?php
+// Own namespace
+namespace Org\Shipsimu\Hub\Cruncher\OpenSsl;
+
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Cruncher\BaseHubCruncher;
+use Org\Shipsimu\Hub\Helper\Cruncher\CruncherHelper;
+
+// Import framework stuff
+use Org\Mxchange\CoreFramework\Controller\Controller;
+use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
+use Org\Mxchange\CoreFramework\Registry\Registerable;
+use Org\Mxchange\CoreFramework\Response\Responseable;
+
+/**
+ * A hub-coin cruncher class
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2011 - 2014 - 2018 Hub Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class HubOpenSslCruncher extends BaseHubCruncher implements CruncherHelper, Registerable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+
+               // Set version number
+               $this->setVersion('0.0.0');
+       }
+
+       /**
+        * Creates an instance of this hub-cruncher class
+        *
+        * @return      $cruncherInstance       An instance of this hub-cruncher class
+        */
+       public final static function createHubOpenSslCruncher () {
+               // Get a new instance
+               $cruncherInstance = new HubOpenSslCruncher();
+
+               // Return the instance
+               return $cruncherInstance;
+       }
+
+       /**
+        * This method fills the in-buffer with (a) test unit(s) which are mainly
+        * used for development of the crunching part. They must be enabled in
+        * configuration, or else your cruncher runs out of WUs and waits for more
+        * to show up.
+        *
+        * In this method we already know that the in-buffer is going depleted so
+        * no need to double-check it here.
+        *
+        * @return      void
+        */
+       protected function fillInBufferQueueWithTestUnits () {
+               // Are test units enabled?
+               if ($this->getConfigInstance()->getConfigEntry('cruncher_test_units_enabled') == 'N') {
+                       // They are disabled, so skip any further steps
+                       return;
+               } 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');
+
+               // We don't need an iterator here because we just need to generate some test units
+               for ($idx = 0; $idx < $this->getConfigInstance()->getConfigEntry('cruncher_max_text_unit_amount'); $idx++) {
+                       // Get a test unit from it
+                       $unitInstance = $generatorInstance->generateNextUnitInstance();
+
+                       // ... and finally queue it to the in-buffer queue
+                       $this->queueUnitInstanceToInBuffer($unitInstance);
+               } // END - for
+       }
+
+       /**
+        * This method fills the in-buffer with (real) WUs which will be crunched
+        * and the result be sent back to the key producer instance.
+        *
+        * @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.');
+       }
+
+       /**
+        * Method to "bootstrap" the cruncher. This step does also apply provided
+        * command-line arguments stored in the request instance. No buffer queue
+        * will be initialized here, we only do "general" things here.
+        *
+        * @return      void
+        * @todo        Implement this method
+        */
+       public function doBootstrapping () {
+               $this->partialStub('Please implement this method.');
+       }
+
+       /**
+        * Outputs the console teaser. This should only be executed on startup or
+        * full restarts. This method generates some space around the teaser.
+        *
+        * @return      void
+        */
+       public function outputConsoleTeaser () {
+               // Output all lines
+               self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(' ');
+               self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('OpenSSL Cruncher v' . $this->getVersion() . ' is starting ...');
+               self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('Copyright (c) 2011 - 2014 - 2018 Hub Developer Team');
+               self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(' ');
+               self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('This program comes with ABSOLUTELY NO WARRANTY; for details see docs/COPYING.');
+               self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('This is free software, and you are welcome to redistribute it under certain');
+               self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('conditions; see docs/COPYING for details.');
+               self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(' ');
+       }
+
+       /**
+        * Add some cruncher-specific filters
+        *
+        * @param       $controllerInstance     An object of a Controller instance
+        * @param       $responseInstance       An object of a Responseable instance
+        * @return      void
+        * @todo        0% done
+        */
+       public function addExtraFilters (Controller $controllerInstance, Responseable $responseInstance) {
+               // Add some filters here
+               $this->partialStub('Please add some cruncher-specific filters, if required.');
+       }
+
+}
index 850d7ea78c9f9dc52a62040973eba3da2cd3619f..fcffd06fefc81aa14c4094eb88ed52a992b4fabe 100644 (file)
@@ -4,6 +4,8 @@ namespace Org\Shipsimu\Hub\Database\Frontend\Cruncher\Unit;
 
 // Import application-specific stuff
 use Org\Shipsimu\Hub\Database\Frontend\BaseHubDatabaseWrapper;
+use Org\Shipsimu\Hub\Database\Frontend\Unit\UnitDatabaseWrapper;
+use Org\Shipsimu\Hub\Producer\Cruncher\Unit\BaseUnitProducer;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
index 1573c1433f10b17f24eb13c466ce676768297ed8..3c71dc22e79c00196d078c1db8784887fe8e054a 100644 (file)
@@ -2,7 +2,7 @@
 // Own namespace
 namespace Org\Shipsimu\Hub\Discovery\Recipient;
 
-// Import framework-specific stuff
+// Import framework stuff
 use Org\Shipsimu\Hub\Discovery\Node\BaseNodeDiscovery;
 use Org\Shipsimu\Hub\Discovery\Recipient\DiscoverableRecipient;
 use Org\Shipsimu\Hub\Factory\Lists\Recipient\RecipientListFactory;
index 5fcf24915eac37eefa2d881d0d7227c7067d9b6e..fff20740438e04c7d9869644937f90597264f368 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 // Own namespace
-namespace Org\Shipsimu\Hub\Crawler\Source\Unit;
+namespace Org\Shipsimu\Hub\Factory\Crawler\Source\Unit;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
index fb39ce14c782be02a19b07f8ac347d17f81bbb5c..5ca62e1bec444646e9c15c6cd19d6e04209e55d4 100644 (file)
@@ -44,12 +44,11 @@ class CruncherStateFactory extends ObjectFactory {
         * 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) {
                // Then construct the class' configuraton entry
-               $className = 'cruncher_' . $stateName . '_state_class';
+               $className = sprintf('cruncher_%s_state_class', $stateName);
 
                // Get cruncher instance from registry
                $cruncherInstance = GenericRegistry::getRegistry()->getInstance('cruncher');
index 2c7f5a3406ae0c37b60770b72d4d864b146f714a..f9c00574f88753e2c8d42d3329cf3d2fe9eb9a11 100644 (file)
@@ -2,6 +2,9 @@
 // Own namespace
 namespace Org\Shipsimu\Hub\Filter\Bootstrap\Cruncher\Queue;
 
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Cruncher\Filter\BaseCruncherFilter;
+
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Filter\Filterable;
 use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
index edd80bfdd6fae77a6bf5351cc9e233f266f21eac..bf44749c64f4ded2ea7a67ce146d2d9144d11d61 100644 (file)
@@ -2,6 +2,9 @@
 // Own namespace
 namespace Org\Shipsimu\Hub\Filter\Bootstrap\Cruncher\Extra;
 
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Cruncher\Filter\BaseCruncherFilter;
+
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Filter\Filterable;
 use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
index 69bee2f8066ae0952421a9cdbe68f2eb7b459c6c..2ec30086b73081ab8c15b35a18558f3b5708f6af 100644 (file)
@@ -2,6 +2,9 @@
 // Own namespace
 namespace Org\Shipsimu\Hub\Filter\Bootstrap\Cruncher\Activation;
 
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Cruncher\Filter\BaseCruncherFilter;
+
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Filter\Filterable;
 use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
index 029628f1e7648a221c1bc46e90643f1eeef58364..2457a7f5f1917626f1844c1a8bdde4f552ee5129 100644 (file)
@@ -2,6 +2,9 @@
 // Own namespace
 namespace Org\Shipsimu\Hub\Cruncher\Filter\Initialization;
 
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Cruncher\Filter\BaseCruncherFilter;
+
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
 use Org\Mxchange\CoreFramework\Filter\Filterable;
@@ -77,12 +80,12 @@ class CruncherInitializationFilter extends BaseCruncherFilter implements Filtera
                }
 
                // Now convert the cruncher-mode in a class name
-               $className = 'Hub' . self::convertToClassName($cruncherMode) . 'Cruncher';
+               $configEntry = sprintf('hub_%s_cruncher_mode_class', $cruncherMode);
 
                // And try to instance it
                try {
                        // Get an instance
-                       $cruncherInstance = ObjectFactory::createObjectByName($className);
+                       $cruncherInstance = ObjectFactory::createObjectByConfiguredName($configEntry);
 
                        // Get a registry
                        $applicationInstance = GenericRegistry::getRegistry()->getInstance('application');
index 8e476e503b2b7f6f24459c83fade844b988cf633..718fc0b5abf517199d9078059860303bfab93f07 100644 (file)
@@ -2,6 +2,9 @@
 // Own namespace
 namespace Org\Shipsimu\Hub\Cruncher\Filter\Requirements;
 
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Cruncher\Filter\BaseCruncherFilter;
+
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Filter\Filterable;
 use Org\Mxchange\CoreFramework\Request\Requestable;
index 6ce151b2a1e0da9a826152515af1b85a4b12453a..92b5e8dc8e3f431e90c29048d640eb64690614c8 100644 (file)
@@ -2,6 +2,9 @@
 // Own namespace
 namespace Org\Shipsimu\Hub\Cruncher\Filter\WelcomeTeaser;
 
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Cruncher\Filter\BaseCruncherFilter;
+
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Filter\Filterable;
 use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
index 8d2a1e9bb56c7e03572064e6835ba6b20ba9c1e7..3c94ef7cc85339efc5de24321c6553781e8c4156 100644 (file)
@@ -2,6 +2,9 @@
 // Own namespace
 namespace Org\Shipsimu\Hub\Filter\Shutdown\Cruncher;
 
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Cruncher\Filter\BaseCruncherFilter;
+
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Filter\Filterable;
 use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
index 4422e11ba71b65acdae2d23f7c8bf4bc187eea15..0f4e3d108d541a473c23c9f709f166243c422e4d 100644 (file)
@@ -2,6 +2,9 @@
 // Own namespace
 namespace Org\Shipsimu\Hub\Filter\Initializer\Cruncher\Handler\Task;
 
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Cruncher\Filter\BaseCruncherFilter;
+
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
 use Org\Mxchange\CoreFramework\Filter\Filterable;
index a6b72ad7485d875ab9539bd35347389fa896f4b6..e0c13216a0a5adec41793f3cd40ff16b061144a7 100644 (file)
@@ -2,7 +2,7 @@
 // Own namespace
 namespace Org\Shipsimu\Hub\Handler\Status\Answer;
 
-// Import framework-specific stuff
+// Import framework stuff
 use Org\Shipsimu\Hub\Handler\Data\BaseDataHandler;
 
 /**
index bb952e00aa25e5d96bfc8f21d5fd2e512b3cdd6c..71c9999922eeec135d6799bb4debe9c010b76820 100644 (file)
@@ -3,7 +3,12 @@
 namespace Org\Shipsimu\Hub\Helper\Crypto\Message\RandomUnit;
 
 // Import application-specific stuff
-use Org\Shipsimu\Hub\Factory\Source\Unit\UnitSourceFactory;
+use Org\Shipsimu\Hub\Factory\Crawler\Source\Unit\UnitSourceFactory;
+use Org\Shipsimu\Hub\Helper\Message\BaseMessageHelper;
+use Org\Shipsimu\Hub\Helper\Message\MessageHelper;
+
+// Import framework stuff
+use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
 
 /**
  * A CryptoRandom message helper
@@ -42,7 +47,7 @@ class CryptoRandomUnitMessageHelper extends BaseMessageHelper implements Message
         * Creates an instance of this class
         *
         * @param       $sourceType                     Type of the source
-        * @return      $messageInstance        An instance of a UnitHelper class
+        * @return      $messageInstance        An instance of a MessageHelper class
         */
        public final static function createCryptoRandomUnitMessageHelper ($sourceType) {
                // Get new instance
index 39991168713dcbcaa5ab2cf1fe46d5da334d5ba1..9a16298fd0c9f6b6633402227f81bf4bfd7a00b2 100644 (file)
@@ -1,4 +1,11 @@
 <?php
+// Own namespace
+namespace Org\Shipsimu\Hub\Cruncher\Helper\WorkUnit\Test;
+
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Helper\Unit\UnitHelper;
+use Org\Shipsimu\Hub\Helper\WorkUnit\BaseWorkUnitHelper;
+
 /**
  * A test unit helper for cruncher
  *
index 69bf92fb99c9826fa5441dfe44b07c28b411a75d..d5a7099032fc9b2811febb67624c31b547314e7e 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 // Own namespace
-namespace Org\Shipsimu\Hub\Iterator\Producer\TestUnitKey;
+namespace Org\Shipsimu\Hub\Iterator\Producer\Key\TestUnit;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Generic\UnsupportedOperationException;
index cd4f7af0a242a15840f6f462feba474c99e591da..51dceb09f4e92ddc3a96cbf10c665f887e8d2d1a 100644 (file)
@@ -12,7 +12,7 @@ use Org\Mxchange\CoreFramework\Registry\Registerable;
 use Org\Mxchange\CoreFramework\Response\Responseable;
 
 /**
- * A hub-mcrypt miner class
+ * A hub-coin miner class
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
index a12b537140f3e757717b01f4a48a02785fddaa0e..c902699658ea4db687fdcb066d45887fff7ff6b5 100644 (file)
@@ -66,12 +66,6 @@ abstract class BaseProducer extends BaseHubSystem {
                // Initialize all producers
                $this->initProducer();
 
-               // Get miner instance
-               $minerInstance = GenericRegistry::getRegistry()->getInstance('miner');
-
-               // Change state to next state
-               $minerInstance->blockProducerHasInitialized($this);
-
                // Initialize work queue (out-going, produced items)
                $this->initWorkQueue();
        }
diff --git a/application/hub/classes/producer/cruncher/class_BaseCruncherProducer.php b/application/hub/classes/producer/cruncher/class_BaseCruncherProducer.php
new file mode 100644 (file)
index 0000000..7efeeb9
--- /dev/null
@@ -0,0 +1,51 @@
+<?php
+// Own namespace
+namespace Org\Shipsimu\Hub\Producer\Cruncher;
+
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Producer\BaseProducer;
+
+// Import framework stuff
+use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+
+/**
+ * A generic cruncher producer class
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2018 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 BaseCruncherProducer extends BaseProducer {
+       /**
+        * Protected constructor
+        *
+        * @param       $className      Complete class name
+        * @return      void
+        */
+       protected function __construct ($className) {
+               // Call parent constructor
+               parent::__construct($className);
+
+               // Get cruncher instance
+               $cruncherInstance = GenericRegistry::getRegistry()->getInstance('cruncher');
+
+               // Change state to next state
+               $cruncherInstance->blockProducerHasInitialized($this);
+       }
+
+}
diff --git a/application/hub/classes/producer/cruncher/class_BaseKeyProducer.php b/application/hub/classes/producer/cruncher/class_BaseKeyProducer.php
deleted file mode 100644 (file)
index 0a6d735..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-<?php
-// Own namespace
-namespace Org\Shipsimu\Hub\Producer\Key;
-
-// Import application-specific stuff
-use Org\Shipsimu\Hub\Producer\BaseProducer;
-
-/**
- * A general KeyProducer class
- *
- * @author             Roland Haeder <webmaster@shipsimu.org>
- * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2018 Hub Developer Team
- * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.shipsimu.org
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-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);
-
-               // Init key producer
-       }
-
-}
diff --git a/application/hub/classes/producer/cruncher/class_BaseUnitProducer.php b/application/hub/classes/producer/cruncher/class_BaseUnitProducer.php
deleted file mode 100644 (file)
index 395649c..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-<?php
-// Own namespace
-namespace Org\Shipsimu\Hub\Producer\Unit;
-
-// Import application-specific stuff
-use Org\Shipsimu\Hub\Producer\BaseProducer;
-
-/**
- * A general UnitProducer class
- *
- * @author             Roland Haeder <webmaster@shipsimu.org>
- * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2018 Hub Developer Team
- * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.shipsimu.org
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-abstract class BaseUnitProducer extends BaseProducer {
-       /**
-        * Work/test unit status
-        */
-       const UNIT_STATUS_AVAILABLE = 'available'; // Available for crunching
-       const UNIT_STATUS_PENDING   = 'pending';   // Is being crunched at the moment
-       const UNIT_STATUS_DONE      = 'done';      // Is already crunched/finished
-
-       /**
-        * Work or test unit?
-        */
-       const UNIT_TYPE_TEST_UNIT = 'test_unit';
-       const UNIT_TYPE_TEST_WORK = 'work_unit';
-
-       /**
-        * Protected constructor
-        *
-        * @param       $className      Name of the class
-        * @return      void
-        */
-       protected function __construct ($className) {
-               // Call parent constructor
-               parent::__construct($className);
-       }
-
-}
diff --git a/application/hub/classes/producer/cruncher/keys/class_BaseKeyProducer.php b/application/hub/classes/producer/cruncher/keys/class_BaseKeyProducer.php
new file mode 100644 (file)
index 0000000..309e06d
--- /dev/null
@@ -0,0 +1,44 @@
+<?php
+// Own namespace
+namespace Org\Shipsimu\Hub\Producer\Cruncher\Key;
+
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Producer\Cruncher\BaseCruncherProducer;
+
+/**
+ * A general KeyProducer class
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2018 Hub Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+abstract class BaseKeyProducer extends BaseCruncherProducer {
+       /**
+        * Protected constructor
+        *
+        * @param       $className      Name of the class
+        * @return      void
+        */
+       protected function __construct ($className) {
+               // Call parent constructor
+               parent::__construct($className);
+
+               // Init key producer
+       }
+
+}
diff --git a/application/hub/classes/producer/cruncher/keys/class_CruncherKeyProducer.php b/application/hub/classes/producer/cruncher/keys/class_CruncherKeyProducer.php
deleted file mode 100644 (file)
index 44a008c..0000000
+++ /dev/null
@@ -1,137 +0,0 @@
-<?php
-// Own namespace
-namespace Org\Shipsimu\Hub\Producer\Cruncher\Key;
-
-// Import application-specific stuff
-use Org\Shipsimu\Hub\Producer\BaseProducer;
-
-// Import framework stuff
-use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
-use Org\Mxchange\CoreFramework\Registry\Registerable;
-use Org\Mxchange\CoreFramework\State\Stateable;
-
-/**
- * A CruncherKey producer class
- *
- * @author             Roland Haeder <webmaster@shipsimu.org>
- * @version            0.0.0
- * @copyright  Copyright (c) 2011 - 2014 - 2018 Hub Developer Team
- * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.shipsimu.org
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-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 () {
-       }
-
-       /**
-        * Initializes the executor, whatever it does.
-        *
-        * @return      void
-        * @todo        0% done
-        */
-       public function initExecutor (Stateable $stateInstance) {
-               $this->partialStub('Maybe implement this method?');
-       }
-
-       /**
-        * 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
-                       self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PRODUCER: The cruncher is not virgin. stateInstance=' . $stateInstance->__toString() . '');
-                       return;
-               } elseif (!$this->getIteratorInstance()->valid()) {
-                       // This producer's iterator has finished its assignment
-                       self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PRODUCER: Finished creating keys. iteratorInstance=' . $this->getIteratorInstance()->__toString() . '');
-                       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();
-
-               // Add it to the out-going work queue
-               $this->addValueToOutgoingQueue($currentKey);
-
-               // Is the per-work unit limit reached?
-               if ($this->isOutgoingQueueLimitReached('cruncher_per_unit_key_limit')) {
-                       // @TODO Send the produced key bundle to the unit producer's input queue
-                       self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('currentKey(b64)="' . base64_encode($currentKey) . '" needs to be processed.');
-
-                       // At last re-init the stack
-                       $this->initOutgoingQueue();
-               } // END - if
-
-               // Continue with next one
-               $this->getIteratorInstance()->next();
-       }
-}
diff --git a/application/hub/classes/producer/cruncher/keys/cruncher/.htaccess b/application/hub/classes/producer/cruncher/keys/cruncher/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/hub/classes/producer/cruncher/keys/cruncher/class_CruncherKeyProducer.php b/application/hub/classes/producer/cruncher/keys/cruncher/class_CruncherKeyProducer.php
new file mode 100644 (file)
index 0000000..7f36ee4
--- /dev/null
@@ -0,0 +1,139 @@
+<?php
+// Own namespace
+namespace Org\Shipsimu\Hub\Producer\Cruncher\Key;
+
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Producer\BaseProducer;
+use Org\Shipsimu\Hub\Producer\Key\KeyProducer;
+
+// Import framework stuff
+use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
+use Org\Mxchange\CoreFramework\Registry\Registerable;
+use Org\Mxchange\CoreFramework\State\Stateable;
+
+/**
+ * A CruncherKey producer class
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2011 - 2014 - 2018 Hub Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+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 () {
+               $this->partialStub('Maybe add something here?');
+       }
+
+       /**
+        * Initializes the executor, whatever it does.
+        *
+        * @return      void
+        * @todo        0% done
+        */
+       public function initExecutor (Stateable $stateInstance) {
+               $this->partialStub('Maybe implement this method?');
+       }
+
+       /**
+        * 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
+                       self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PRODUCER: The cruncher is not virgin. stateInstance=' . $stateInstance->__toString() . '');
+                       return;
+               } elseif (!$this->getIteratorInstance()->valid()) {
+                       // This producer's iterator has finished its assignment
+                       self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PRODUCER: Finished creating keys. iteratorInstance=' . $this->getIteratorInstance()->__toString() . '');
+                       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();
+
+               // Add it to the out-going work queue
+               $this->addValueToOutgoingQueue($currentKey);
+
+               // Is the per-work unit limit reached?
+               if ($this->isOutgoingQueueLimitReached('cruncher_per_unit_key_limit')) {
+                       // @TODO Send the produced key bundle to the unit producer's input queue
+                       self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('currentKey(b64)="' . base64_encode($currentKey) . '" needs to be processed.');
+
+                       // At last re-init the stack
+                       $this->initOutgoingQueue();
+               } // END - if
+
+               // Continue with next one
+               $this->getIteratorInstance()->next();
+       }
+}
diff --git a/application/hub/classes/producer/cruncher/work_units/class_BaseUnitProducer.php b/application/hub/classes/producer/cruncher/work_units/class_BaseUnitProducer.php
new file mode 100644 (file)
index 0000000..68f4ef9
--- /dev/null
@@ -0,0 +1,55 @@
+<?php
+// Own namespace
+namespace Org\Shipsimu\Hub\Producer\Cruncher\Unit;
+
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Producer\Cruncher\BaseCruncherProducer;
+
+/**
+ * A general UnitProducer class
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2018 Hub Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+abstract class BaseUnitProducer extends BaseCruncherProducer {
+       /**
+        * Work/test unit status
+        */
+       const UNIT_STATUS_AVAILABLE = 'available'; // Available for crunching
+       const UNIT_STATUS_PENDING   = 'pending';   // Is being crunched at the moment
+       const UNIT_STATUS_DONE      = 'done';      // Is already crunched/finished
+
+       /**
+        * Work or test unit?
+        */
+       const UNIT_TYPE_TEST_UNIT = 'test_unit';
+       const UNIT_TYPE_TEST_WORK = 'work_unit';
+
+       /**
+        * Protected constructor
+        *
+        * @param       $className      Name of the class
+        * @return      void
+        */
+       protected function __construct ($className) {
+               // Call parent constructor
+               parent::__construct($className);
+       }
+
+}
diff --git a/application/hub/classes/producer/cruncher/work_units/class_CruncherTestUnitProducer.php b/application/hub/classes/producer/cruncher/work_units/class_CruncherTestUnitProducer.php
deleted file mode 100644 (file)
index 63a9545..0000000
+++ /dev/null
@@ -1,130 +0,0 @@
-<?php
-// Own namespace
-namespace Org\Shipsimu\Hub\Cruncher\Producer\Unit;
-
-// Import application-specific stuff
-use Org\Shipsimu\Hub\Producer\BaseProducer;
-
-// Import framework stuff
-use Org\Mxchange\CoreFramework\Factory\Database\Wrapper\DatabaseWrapperFactory;
-use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
-use Org\Mxchange\CoreFramework\Factory\Template\XmlTemplateEngineFactory;
-use Org\Mxchange\CoreFramework\Registry\Registerable;
-use Org\Mxchange\CoreFramework\State\Stateable;
-
-/**
- * A CruncherTestUnit producer class
- *
- * @author             Roland Haeder <webmaster@shipsimu.org>
- * @version            0.0.0
- * @copyright  Copyright (c) 2011 - 2014 - 2018 Hub Developer Team
- * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.shipsimu.org
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-class CruncherTestUnitProducer extends BaseUnitProducer implements UnitProducer, 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 createCruncherTestUnitProducer () {
-               // Get new instance
-               $producerInstance = new CruncherTestUnitProducer();
-
-               // Test units have a helper class that wraps the source
-               $helperInstance = ObjectFactory::createObjectByConfiguredName('crypto_random_message_helper_class', array('test'));
-
-               // So set it in the producer
-               $producerInstance->setHelperInstance($helperInstance);
-
-               // Return the prepared instance
-               return $producerInstance;
-       }
-
-       /**
-        * Initializes the producer. This method satisfies the abstract BaseProducer
-        * class.
-        *
-        * @return      void
-        */
-       protected function initProducer () {
-               // Get a XML template instance
-               $templateInstance = XmlTemplateEngineFactory::createXmlTemplateEngineInstance('cruncher_test_unit_producer_template_class');
-
-               // Load the template
-               $templateInstance->loadXmlTemplate();
-
-               // Render the XML content
-               $templateInstance->renderXmlContent();
-
-               // And set it in this cruncher
-               $this->setTemplateInstance($templateInstance);
-       }
-
-       /**
-        * Prepares the produces of some test units and pushes them onto the queue
-        *
-        * @param       $stateInstance  An instance of a Stateable instance
-        * @return      void
-        * @todo        ~60% done
-        */
-       public function initUnitProduction (Stateable $stateInstance) {
-               // First get a database wrapper because we want to permanently store test units
-               $wrapperInstance = DatabaseWrapperFactory::createWrapperByConfiguredName('cruncher_unit_db_wrapper_class');
-
-               // Do we have some entries?
-               if ($wrapperInstance->isTestUnitProduced()) {
-                       // Entries found
-                       // @TODO Unfinished work here
-                       $this->debugInstance(sprintf('[%s:%d]: stateInstance=%s - Unfinished!', __METHOD__, __LINE__, $stateInstance->__toString()));
-
-                       // The state must be changed because ...
-                       $stateInstance->someFooStateChange();
-               } else {
-                       // Get an encrypted, random message from our source
-                       $encryptedMessage = $this->getHelperInstance()->generateRandomMessage();
-
-                       // Debug message
-                       self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PRODUCER: An encrypted, random message has been generated. Generating keys ...');
-
-                       // Set the encrypted message in the template instance
-                       $this->getTemplateInstance()->assignVariable('encrypted_message', $encryptedMessage);
-
-                       // The state must be changed because we have a new message
-                       $stateInstance->encryptedMessageGenerated();
-               }
-       }
-
-       /**
-        * Initializes the executor, whatever it does.
-        *
-        * @return      void
-        * @todo        Maybe unfinished
-        */
-       public function initExecutor (Stateable $stateInstance) {
-               $this->partialStub('Maybe implement this method?');
-       }
-}
diff --git a/application/hub/classes/producer/cruncher/work_units/cruncher/.htaccess b/application/hub/classes/producer/cruncher/work_units/cruncher/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/hub/classes/producer/cruncher/work_units/cruncher/class_CruncherTestUnitProducer.php b/application/hub/classes/producer/cruncher/work_units/cruncher/class_CruncherTestUnitProducer.php
new file mode 100644 (file)
index 0000000..45cf0b0
--- /dev/null
@@ -0,0 +1,131 @@
+<?php
+// Own namespace
+namespace Org\Shipsimu\Hub\Cruncher\Producer\Cruncher\Unit;
+
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Producer\Cruncher\Unit\BaseUnitProducer;
+use Org\Shipsimu\Hub\Producer\Unit\UnitProducer;
+
+// Import framework stuff
+use Org\Mxchange\CoreFramework\Factory\Database\Wrapper\DatabaseWrapperFactory;
+use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
+use Org\Mxchange\CoreFramework\Factory\Template\XmlTemplateEngineFactory;
+use Org\Mxchange\CoreFramework\Registry\Registerable;
+use Org\Mxchange\CoreFramework\State\Stateable;
+
+/**
+ * A CruncherTestUnit producer class
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2011 - 2014 - 2018 Hub Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+class CruncherTestUnitProducer extends BaseUnitProducer implements UnitProducer, 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 createCruncherTestUnitProducer () {
+               // Get new instance
+               $producerInstance = new CruncherTestUnitProducer();
+
+               // Test units have a helper class that wraps the source
+               $helperInstance = ObjectFactory::createObjectByConfiguredName('crypto_random_message_helper_class', array('test'));
+
+               // So set it in the producer
+               $producerInstance->setHelperInstance($helperInstance);
+
+               // Return the prepared instance
+               return $producerInstance;
+       }
+
+       /**
+        * Initializes the producer. This method satisfies the abstract BaseProducer
+        * class.
+        *
+        * @return      void
+        */
+       protected function initProducer () {
+               // Get a XML template instance
+               $templateInstance = XmlTemplateEngineFactory::createXmlTemplateEngineInstance('cruncher_test_unit_producer_template_class');
+
+               // Load the template
+               $templateInstance->loadXmlTemplate();
+
+               // Render the XML content
+               $templateInstance->renderXmlContent();
+
+               // And set it in this cruncher
+               $this->setTemplateInstance($templateInstance);
+       }
+
+       /**
+        * Prepares the produces of some test units and pushes them onto the queue
+        *
+        * @param       $stateInstance  An instance of a Stateable instance
+        * @return      void
+        * @todo        ~60% done
+        */
+       public function initUnitProduction (Stateable $stateInstance) {
+               // First get a database wrapper because we want to permanently store test units
+               $wrapperInstance = DatabaseWrapperFactory::createWrapperByConfiguredName('cruncher_unit_db_wrapper_class');
+
+               // Do we have some entries?
+               if ($wrapperInstance->isTestUnitProduced()) {
+                       // Entries found
+                       // @TODO Unfinished work here
+                       $this->debugInstance(sprintf('[%s:%d]: stateInstance=%s - Unfinished!', __METHOD__, __LINE__, $stateInstance->__toString()));
+
+                       // The state must be changed because ...
+                       $stateInstance->someFooStateChange();
+               } else {
+                       // Get an encrypted, random message from our source
+                       $encryptedMessage = $this->getHelperInstance()->generateRandomMessage();
+
+                       // Debug message
+                       self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PRODUCER: An encrypted, random message has been generated. Generating keys ...');
+
+                       // Set the encrypted message in the template instance
+                       $this->getTemplateInstance()->assignVariable('encrypted_message', $encryptedMessage);
+
+                       // The state must be changed because we have a new message
+                       $stateInstance->encryptedMessageGenerated();
+               }
+       }
+
+       /**
+        * Initializes the executor, whatever it does.
+        *
+        * @return      void
+        * @todo        Maybe unfinished
+        */
+       public function initExecutor (Stateable $stateInstance) {
+               $this->partialStub('Maybe implement this method?');
+       }
+}
diff --git a/application/hub/classes/producer/miner/blocks/class_BaseBlockProducer.php b/application/hub/classes/producer/miner/blocks/class_BaseBlockProducer.php
new file mode 100644 (file)
index 0000000..1e0bd9b
--- /dev/null
@@ -0,0 +1,45 @@
+<?php
+// Own namespace
+namespace Org\Shipsimu\Hub\Producer\Miner\Block;
+
+// Import application-specific stuff
+
+/**
+ * A general BlockProducer class
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2014 - 2018 Hub Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+abstract class BaseBlockProducer extends BaseMinerProducer {
+       /**
+        * Block status
+        */
+
+       /**
+        * Protected constructor
+        *
+        * @param       $className      Name of the class
+        * @return      void
+        */
+       protected function __construct ($className) {
+               // Call parent constructor
+               parent::__construct($className);
+       }
+
+}
diff --git a/application/hub/classes/producer/miner/blocks/class_MinerRealGenesisBlockProducer.php b/application/hub/classes/producer/miner/blocks/class_MinerRealGenesisBlockProducer.php
deleted file mode 100644 (file)
index f854254..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-<?php
-// Own namespace
-namespace Org\Shipsimu\Hub\Miner\Producer\Block\Genesis;
-
-// Import application-specific stuff
-use Org\Shipsimu\Hub\Producer\BaseProducer;
-use Org\Shipsimu\Hub\Producer\Block\BaseBlockProducer;
-use Org\Shipsimu\Hub\Producer\Block\BlockProducer;
-
-// Import framework stuff
-use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
-use Org\Mxchange\CoreFramework\Registry\Registerable;
-use Org\Mxchange\CoreFramework\State\Stateable;
-
-/**
- * A MinerRealGenesisBlock producer class
- *
- * @author             Roland Haeder <webmaster@shipsimu.org>
- * @version            0.0.0
- * @copyright  Copyright (c) 2011 - 2014 - 2018 Hub Developer Team
- * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.shipsimu.org
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-class MinerRealGenesisBlockProducer extends BaseBlockProducer implements BlockProducer, 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 createMinerRealGenesisBlockProducer () {
-               // Get new instance
-               $producerInstance = new MinerRealGenesisBlockProducer();
-
-               // Get a (minable) hash block instance
-               $minableInstance = ObjectFactory::createObjectByConfiguredName('miner_real_hash_block_class');
-
-               // Set it here
-               $producerInstance->setMinableInstance($minableInstance);
-
-               // Return the prepared instance
-               return $producerInstance;
-       }
-
-       /**
-        * Initializes the producer. This method satisfies the abstract BaseProducer
-        * class.
-        *
-        * @return      void
-        * @todo        0% done
-        */
-       protected function initProducer () {
-               $this->partialStub('Please implement this method.');
-       }
-
-       /**
-        * Initializes the executor, whatever it does.
-        *
-        * @return      void
-        * @todo        0% done
-        */
-       public function initExecutor (Stateable $stateInstance) {
-               $this->partialStub('Please implement this method.');
-       }
-
-       /**
-        * Prepares the produces of some test units and pushes them onto the queue
-        *
-        * @param       $stateInstance  An instance of a Stateable instance
-        * @return      void
-        * @todo        ~5% done
-        */
-       public function prepareBlockProduction (Stateable $stateInstance) {
-               // The state must be 'booting'
-               $stateInstance->validateMinerStateIsBooting();
-
-               /*
-                * Now that the miner is booting a genesis block for real mining can be
-                * created.
-                */
-       }
-}
-
-// [EOF]
-?>
diff --git a/application/hub/classes/producer/miner/blocks/class_MinerTestGenesisBlockProducer.php b/application/hub/classes/producer/miner/blocks/class_MinerTestGenesisBlockProducer.php
deleted file mode 100644 (file)
index 1c5b16f..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-<?php
-// Own namespace
-namespace Org\Shipsimu\Hub\miner\Producer\Block\Genesis;
-
-// Import application-specific stuff
-use Org\Shipsimu\Hub\Producer\BaseProducer;
-use Org\Shipsimu\Hub\Producer\Block\BaseBlockProducer;
-use Org\Shipsimu\Hub\Producer\Block\BlockProducer;
-
-// Import framework stuff
-use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
-use Org\Mxchange\CoreFramework\Registry\Registerable;
-use Org\Mxchange\CoreFramework\State\Stateable;
-
-/**
- * A MinerTestGenesisBlock producer class
- *
- * @author             Roland Haeder <webmaster@shipsimu.org>
- * @version            0.0.0
- * @copyright  Copyright (c) 2011 - 2014 - 2018 Hub Developer Team
- * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.shipsimu.org
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-class MinerTestGenesisBlockProducer extends BaseBlockProducer implements BlockProducer, 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 createMinerTestGenesisBlockProducer () {
-               // Get new instance
-               $producerInstance = new MinerTestGenesisBlockProducer();
-
-               // Get a (minable) hash block instance
-               $minableInstance = ObjectFactory::createObjectByConfiguredName('miner_test_hash_block_class');
-
-               // Set it here
-               $producerInstance->setMinableInstance($minableInstance);
-
-               // Return the prepared instance
-               return $producerInstance;
-       }
-
-       /**
-        * Initializes the producer. This method satisfies the abstract BaseProducer
-        * class.
-        *
-        * @return      void
-        * @todo        0% done
-        */
-       protected function initProducer () {
-               $this->partialStub('Please implement this method.');
-       }
-
-       /**
-        * Initializes the executor, whatever it does.
-        *
-        * @return      void
-        * @todo        0% done
-        */
-       public function initExecutor (Stateable $stateInstance) {
-               $this->partialStub('Please implement this method.');
-       }
-
-       /**
-        * Prepares the produces of some test units and pushes them onto the queue
-        *
-        * @param       $stateInstance  An instance of a Stateable instance
-        * @return      void
-        * @todo        ~5% done
-        */
-       public function prepareBlockProduction (Stateable $stateInstance) {
-               // The state must be 'booting'
-               $stateInstance->validateMinerStateIsBooting();
-
-               /*
-                * Now that the miner is booting a "genesis" block for testing purposes
-                * can be created. The real "genesis" block will be created differently
-                * to this.
-                */
-       }
-
-}
diff --git a/application/hub/classes/producer/miner/blocks/miner/.htaccess b/application/hub/classes/producer/miner/blocks/miner/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/hub/classes/producer/miner/blocks/miner/class_MinerRealGenesisBlockProducer.php b/application/hub/classes/producer/miner/blocks/miner/class_MinerRealGenesisBlockProducer.php
new file mode 100644 (file)
index 0000000..6d4420e
--- /dev/null
@@ -0,0 +1,107 @@
+<?php
+// Own namespace
+namespace Org\Shipsimu\Hub\Miner\Producer\Miner\Block\Genesis;
+
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Producer\BaseProducer;
+use Org\Shipsimu\Hub\Producer\Block\BaseBlockProducer;
+use Org\Shipsimu\Hub\Producer\Block\BlockProducer;
+
+// Import framework stuff
+use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
+use Org\Mxchange\CoreFramework\Registry\Registerable;
+use Org\Mxchange\CoreFramework\State\Stateable;
+
+/**
+ * A MinerRealGenesisBlock producer class
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2011 - 2014 - 2018 Hub Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+class MinerRealGenesisBlockProducer extends BaseBlockProducer implements BlockProducer, 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 createMinerRealGenesisBlockProducer () {
+               // Get new instance
+               $producerInstance = new MinerRealGenesisBlockProducer();
+
+               // Get a (minable) hash block instance
+               $minableInstance = ObjectFactory::createObjectByConfiguredName('miner_real_hash_block_class');
+
+               // Set it here
+               $producerInstance->setMinableInstance($minableInstance);
+
+               // Return the prepared instance
+               return $producerInstance;
+       }
+
+       /**
+        * Initializes the producer. This method satisfies the abstract BaseProducer
+        * class.
+        *
+        * @return      void
+        * @todo        0% done
+        */
+       protected function initProducer () {
+               $this->partialStub('Please implement this method.');
+       }
+
+       /**
+        * Initializes the executor, whatever it does.
+        *
+        * @return      void
+        * @todo        0% done
+        */
+       public function initExecutor (Stateable $stateInstance) {
+               $this->partialStub('Please implement this method.');
+       }
+
+       /**
+        * Prepares the produces of some test units and pushes them onto the queue
+        *
+        * @param       $stateInstance  An instance of a Stateable instance
+        * @return      void
+        * @todo        ~5% done
+        */
+       public function prepareBlockProduction (Stateable $stateInstance) {
+               // The state must be 'booting'
+               $stateInstance->validateMinerStateIsBooting();
+
+               /*
+                * Now that the miner is booting a genesis block for real mining can be
+                * created.
+                */
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/hub/classes/producer/miner/blocks/miner/class_MinerTestGenesisBlockProducer.php b/application/hub/classes/producer/miner/blocks/miner/class_MinerTestGenesisBlockProducer.php
new file mode 100644 (file)
index 0000000..f092c46
--- /dev/null
@@ -0,0 +1,106 @@
+<?php
+// Own namespace
+namespace Org\Shipsimu\Hub\miner\Producer\Miner\Block\Genesis;
+
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Producer\BaseProducer;
+use Org\Shipsimu\Hub\Producer\Block\BaseBlockProducer;
+use Org\Shipsimu\Hub\Producer\Block\BlockProducer;
+
+// Import framework stuff
+use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
+use Org\Mxchange\CoreFramework\Registry\Registerable;
+use Org\Mxchange\CoreFramework\State\Stateable;
+
+/**
+ * A MinerTestGenesisBlock producer class
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2011 - 2014 - 2018 Hub Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+class MinerTestGenesisBlockProducer extends BaseBlockProducer implements BlockProducer, 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 createMinerTestGenesisBlockProducer () {
+               // Get new instance
+               $producerInstance = new MinerTestGenesisBlockProducer();
+
+               // Get a (minable) hash block instance
+               $minableInstance = ObjectFactory::createObjectByConfiguredName('miner_test_hash_block_class');
+
+               // Set it here
+               $producerInstance->setMinableInstance($minableInstance);
+
+               // Return the prepared instance
+               return $producerInstance;
+       }
+
+       /**
+        * Initializes the producer. This method satisfies the abstract BaseProducer
+        * class.
+        *
+        * @return      void
+        * @todo        0% done
+        */
+       protected function initProducer () {
+               $this->partialStub('Please implement this method.');
+       }
+
+       /**
+        * Initializes the executor, whatever it does.
+        *
+        * @return      void
+        * @todo        0% done
+        */
+       public function initExecutor (Stateable $stateInstance) {
+               $this->partialStub('Please implement this method.');
+       }
+
+       /**
+        * Prepares the produces of some test units and pushes them onto the queue
+        *
+        * @param       $stateInstance  An instance of a Stateable instance
+        * @return      void
+        * @todo        ~5% done
+        */
+       public function prepareBlockProduction (Stateable $stateInstance) {
+               // The state must be 'booting'
+               $stateInstance->validateMinerStateIsBooting();
+
+               /*
+                * Now that the miner is booting a "genesis" block for testing purposes
+                * can be created. The real "genesis" block will be created differently
+                * to this.
+                */
+       }
+
+}
diff --git a/application/hub/classes/producer/miner/class_BaseBlockProducer.php b/application/hub/classes/producer/miner/class_BaseBlockProducer.php
deleted file mode 100644 (file)
index eeec008..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-<?php
-// Own namespace
-namespace Org\Shipsimu\Hub\Producer\Block;
-
-// Import application-specific stuff
-use Org\Shipsimu\Hub\Producer\BaseProducer;
-
-/**
- * A general BlockProducer class
- *
- * @author             Roland Haeder <webmaster@shipsimu.org>
- * @version            0.0.0
- * @copyright  Copyright (c) 2014 - 2018 Hub Developer Team
- * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.shipsimu.org
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-abstract class BaseBlockProducer extends BaseProducer {
-       /**
-        * Block status
-        */
-
-       /**
-        * Protected constructor
-        *
-        * @param       $className      Name of the class
-        * @return      void
-        */
-       protected function __construct ($className) {
-               // Call parent constructor
-               parent::__construct($className);
-       }
-
-}
diff --git a/application/hub/classes/producer/miner/class_BaseMinerProducer.php b/application/hub/classes/producer/miner/class_BaseMinerProducer.php
new file mode 100644 (file)
index 0000000..55365c4
--- /dev/null
@@ -0,0 +1,48 @@
+<?php
+// Own namespace
+namespace Org\Shipsimu\Hub\Producer\Miner;
+
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Producer\BaseProducer;
+
+/**
+ * A generic miner producer class
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2018 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 BaseMinerProducer extends BaseProducer {
+       /**
+        * Protected constructor
+        *
+        * @param       $className      Complete class name
+        * @return      void
+        */
+       protected function __construct ($className) {
+               // Call parent constructor
+               parent::__construct($className);
+
+               // Get miner instance
+               $minerInstance = GenericRegistry::getRegistry()->getInstance('miner');
+
+               // Change state to next state
+               $minerInstance->blockProducerHasInitialized($this);
+       }
+
+}
index 5cb6832e947781bb3fbaf8fcf657ef0a26419430..0ab4cc83da507072c893d158d03bff91467a3f4a 100644 (file)
@@ -1,6 +1,10 @@
 <?php
 // Own namespace
-namespace Org\Shipsimu\Hub\State\Cruncher;
+namespace Org\Shipsimu\Hub\Cruncher\State\Initialization;
+
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Cruncher\State\BaseCruncherState;
+use Org\Shipsimu\Hub\Factory\State\Cruncher\CruncherStateFactory;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Executor\Executor;
index c0348f7689a8830951fdf30dd5723aeab3fd79eb..0f554031331ea9a19dd9b484a6a3f54556d22a5e 100644 (file)
@@ -1,6 +1,9 @@
 <?php
 // Own namespace
-namespace Org\Shipsimu\Hub\State\Cruncher;
+namespace Org\Shipsimu\Hub\Cruncher\State\Virgin;
+
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Cruncher\State\BaseCruncherState;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Executor\Executor;
index d457fef041d8cb0a7fd9b52ab4827d73bc21e0a9..48b65ea7aa3df748ff8fe46cfc7fc86e109e3813 100644 (file)
@@ -1008,7 +1008,7 @@ $cfg->setConfigEntry('task_miner_block_fetcher_interval_delay', 1000);
 $cfg->setConfigEntry('task_miner_block_fetcher_max_runs', 0);
 
 // CFG: MINER-TEST-GENESIS-BLOCK-PRODUCER-TASK-CLASS
-$cfg->setConfigEntry('miner_test_genesis_block_producer_task_class', 'Org\Shipsimu\Hub\Miner\Task\Producer\Block\Genesis\MinerTestGenesisBlockProducerTask');
+$cfg->setConfigEntry('miner_test_genesis_block_producer_task_class', 'Org\Shipsimu\Hub\Miner\Task\Producer\Miner\Block\Genesis\MinerTestGenesisBlockProducerTask');
 
 // CFG: TASK-MINER-TEST-GENESIS-BLOCK-PRODUCER-STARTUP-DELAY
 $cfg->setConfigEntry('task_miner_test_genesis_block_producer_startup_delay', 1000);
@@ -1020,7 +1020,7 @@ $cfg->setConfigEntry('task_miner_test_genesis_block_producer_interval_delay', 10
 $cfg->setConfigEntry('task_miner_test_genesis_block_producer_max_runs', 0);
 
 // CFG: MINER-REAL-GENESIS-BLOCK-PRODUCER-TASK-CLASS
-$cfg->setConfigEntry('miner_real_genesis_block_producer_task_class', 'Org\Shipsimu\Hub\Miner\Task\Producer\Block\Genesis\MinerRealGenesisBlockProducerTask');
+$cfg->setConfigEntry('miner_real_genesis_block_producer_task_class', 'Org\Shipsimu\Hub\Miner\Task\Producer\Miner\Block\Genesis\MinerRealGenesisBlockProducerTask');
 
 // CFG: TASK-MINER-REAL-GENESIS-BLOCK-PRODUCER-STARTUP-DELAY
 $cfg->setConfigEntry('task_miner_real_genesis_block_producer_startup_delay', 500);
@@ -1044,10 +1044,10 @@ $cfg->setConfigEntry('task_miner_node_communicator_interval_delay', 250);
 $cfg->setConfigEntry('task_miner_node_communicator_max_runs', 0);
 
 // CFG: MINER-TEST-GENESIS-BLOCK-PRODUCER-CLASS
-$cfg->setConfigEntry('miner_test_genesis_block_producer_class', 'Org\Shipsimu\Hub\miner\Producer\Block\Genesis\MinerTestGenesisBlockProducer');
+$cfg->setConfigEntry('miner_test_genesis_block_producer_class', 'Org\Shipsimu\Hub\miner\Producer\Miner\Block\Genesis\MinerTestGenesisBlockProducer');
 
 // CFG: MINER-REAL-GENESIS-BLOCK-PRODUCER-CLASS
-$cfg->setConfigEntry('miner_real_genesis_block_producer_class', 'Org\Shipsimu\Hub\Miner\Producer\Block\Genesis\MinerRealGenesisBlockProducer');
+$cfg->setConfigEntry('miner_real_genesis_block_producer_class', 'Org\Shipsimu\Hub\Miner\Producer\Miner\Block\Genesis\MinerRealGenesisBlockProducer');
 
 // CFG: MINER-NODE-COMMUNICATOR-CLASS
 $cfg->setConfigEntry('miner_node_communicator_class', 'Org\Shipsimu\Hub\Miner\Communicator\Node\MinerNodeCommunicator');
@@ -1065,8 +1065,11 @@ $cfg->setConfigEntry('hub_coin_miner_mode_class', 'Org\Shipsimu\Hub\Miner\HubCoi
 //                        Cruncher configuration
 ///////////////////////////////////////////////////////////////////////////////
 
-// CFG: CRUNCHER-DEFAULT-MODE (can be only 'mcrypt' at the moment)
-$cfg->setConfigEntry('cruncher_default_mode', 'mcrypt');
+// CFG: CRUNCHER-DEFAULT-MODE (can be only 'openssl' at the moment)
+$cfg->setConfigEntry('cruncher_default_mode', 'openssl');
+
+// CFG: HUB-OPENSSL-CRUNCHER-MODE-CLASS
+$cfg->setConfigEntry('hub_openssl_cruncher_mode_class', 'Org\Shipsimu\Hub\Cruncher\OpenSsl\HubOpenSslCruncher');
 
 // CFG: CRUNCHER-BUFFER-STACKER-CLASS
 $cfg->setConfigEntry('cruncher_buffer_stacker_class', 'Org\Mxchange\CoreFramework\Stacker\FiFoStacker');
@@ -1075,31 +1078,31 @@ $cfg->setConfigEntry('cruncher_buffer_stacker_class', 'Org\Mxchange\CoreFramewor
 $cfg->setConfigEntry('hub_console_cmd_cruncher_resolver_class', 'Org\Shipsimu\Hub\Resolver\Command\HubConsoleCommandResolver');
 
 // CFG: CRUNCHER-PHP-REQUIREMENTS-FILTER
-$cfg->setConfigEntry('cruncher_php_requirements_filter_class', 'CruncherPhpRequirementsFilter');
+$cfg->setConfigEntry('cruncher_php_requirements_filter_class', 'Org\Shipsimu\Hub\Cruncher\Filter\Requirements\CruncherPhpRequirementsFilter');
 
 // CFG: CRUNCHER-INITIALIZER-FILTER
-$cfg->setConfigEntry('cruncher_initializer_filter_class', 'CruncherInitializationFilter');
+$cfg->setConfigEntry('cruncher_initializer_filter_class', 'Org\Shipsimu\Hub\Cruncher\Filter\Initialization\CruncherInitializationFilter');
 
 // CFG: CRUNCHER-BOOTSTRAP-TASK-HANDLER-INITIALIZER-FILTER
-$cfg->setConfigEntry('cruncher_bootstrap_task_handler_initializer_filter_class', 'CruncherTaskHandlerInitializerFilter');
+$cfg->setConfigEntry('cruncher_bootstrap_task_handler_initializer_filter_class', 'Org\Shipsimu\Hub\Filter\Initializer\Cruncher\Handler\Task\CruncherTaskHandlerInitializerFilter');
 
 // CFG: CRUNCHER-BOOTSTRAP-EXTRA-BOOTSTRAPPING-FILTER
-$cfg->setConfigEntry('cruncher_bootstrap_extra_bootstrapping_filter_class', 'CruncherBootstrapExtraBootstrappingFilter');
+$cfg->setConfigEntry('cruncher_bootstrap_extra_bootstrapping_filter_class', 'Org\Shipsimu\Hub\Filter\Bootstrap\Cruncher\Extra\CruncherBootstrapExtraBootstrappingFilter');
 
 // CFG: CRUNCHER-BOOTSTRAP-BUFFER-QUEUE-INITIALIZER-FILTER
-$cfg->setConfigEntry('cruncher_bootstrap_buffer_queue_initializer_filter_class', 'CruncherBootstrapBufferQueueInitializerFilter');
+$cfg->setConfigEntry('cruncher_bootstrap_buffer_queue_initializer_filter_class', 'Org\Shipsimu\Hub\Filter\Bootstrap\Cruncher\Queue\CruncherBootstrapBufferQueueInitializerFilter');
 
 // CFG: CRUNCHER-BOOTSTRAP-GENERIC-ACTIVATION-FILTER
-$cfg->setConfigEntry('cruncher_bootstrap_generic_activation_filter_class', 'CruncherBootstrapGenericActivationFilter');
+$cfg->setConfigEntry('cruncher_bootstrap_generic_activation_filter_class', 'Org\Shipsimu\Hub\Filter\Bootstrap\Cruncher\Activation\CruncherBootstrapGenericActivationFilter');
 
 // CFG: CRUNCHER-WELCOME-TEASER-FILTER
-$cfg->setConfigEntry('cruncher_welcome_teaser_filter_class', 'CruncherWelcomeTeaserFilter');
+$cfg->setConfigEntry('cruncher_welcome_teaser_filter_class', 'Org\Shipsimu\Hub\Cruncher\Filter\WelcomeTeaser\CruncherWelcomeTeaserFilter');
 
 // CFG: CRUNCHER-SHUTDOWN-FILTER
-$cfg->setConfigEntry('cruncher_shutdown_filter_class', 'CruncherShutdownFilter');
+$cfg->setConfigEntry('cruncher_shutdown_filter_class', 'Org\Shipsimu\Hub\Filter\Shutdown\Cruncher\CruncherShutdownFilter');
 
 // CFG: CRUNCHER-WORK-UNIT-FETCHER-TASK-CLASS
-$cfg->setConfigEntry('cruncher_work_unit_fetcher_task_class', 'CruncherWorkUnitFetcherTask');
+$cfg->setConfigEntry('cruncher_work_unit_fetcher_task_class', 'Org\Shipsimu\Hub\Cruncher\Task\Fetcher\WorkUnit\CruncherWorkUnitFetcherTask');
 
 // CFG: TASK-CRUNCHER-WORK-UNIT-FETCHER-STARTUP-DELAY
 $cfg->setConfigEntry('task_cruncher_work_unit_fetcher_startup_delay', 1000);
@@ -1111,7 +1114,7 @@ $cfg->setConfigEntry('task_cruncher_work_unit_fetcher_interval_delay', 10);
 $cfg->setConfigEntry('task_cruncher_work_unit_fetcher_max_runs', 0);
 
 // CFG: CRUNCHER-TEST-UNIT-PRODUCER-TASK-CLASS
-$cfg->setConfigEntry('cruncher_test_unit_producer_task_class', 'CruncherTestUnitProducerTask');
+$cfg->setConfigEntry('cruncher_test_unit_producer_task_class', 'Org\Shipsimu\Hub\Cruncher\Task\Producer\Unit\CruncherTestUnitProducerTask');
 
 // CFG: TASK-CRUNCHER-TEST-UNIT-PRODUCER-STARTUP-DELAY
 $cfg->setConfigEntry('task_cruncher_test_unit_producer_startup_delay', 500);
@@ -1123,7 +1126,7 @@ $cfg->setConfigEntry('task_cruncher_test_unit_producer_interval_delay', 1000*60*
 $cfg->setConfigEntry('task_cruncher_test_unit_producer_max_runs', 0);
 
 // CFG: CRUNCHER-KEY-PRODUCER-TASK-CLASS
-$cfg->setConfigEntry('cruncher_key_producer_task_class', 'CruncherKeyProducerTask');
+$cfg->setConfigEntry('cruncher_key_producer_task_class', 'Org\Shipsimu\Hub\Cruncher\Producer\Key\CruncherKeyProducerTask');
 
 // CFG: TASK-CRUNCHER-KEY-PRODUCER-STARTUP-DELAY
 $cfg->setConfigEntry('task_cruncher_key_producer_startup_delay', 750);
@@ -1141,19 +1144,19 @@ $cfg->setConfigEntry('cruncher_test_units_enabled', 'Y');
 $cfg->setConfigEntry('cruncher_in_buffer_min_threshold', 3);
 
 // CFG: CRUNCHER-TEST-UNIT-GENERATOR-CLASS
-$cfg->setConfigEntry('cruncher_test_unit_generator_class', 'CruncherTestUnitHelper');
+$cfg->setConfigEntry('cruncher_test_unit_generator_class', 'Org\Shipsimu\Hub\Cruncher\Helper\WorkUnit\Test\CruncherTestUnitHelper');
 
 // CFG: CRUNCHER-MAX-TEST-UNIT-AMOUNT
 $cfg->setConfigEntry('cruncher_max_text_unit_amount', 10);
 
 // CFG: CRUNCHER-TEST-UNIT-PRODUCER-CLASS
-$cfg->setConfigEntry('cruncher_test_unit_producer_class', 'CruncherTestUnitProducer');
+$cfg->setConfigEntry('cruncher_test_unit_producer_class', 'Org\Shipsimu\Hub\Cruncher\Producer\Cruncher\Unit\CruncherTestUnitProducer');
 
 // CFG: CRUNCHER-KEY-PRODUCER-CLASS
-$cfg->setConfigEntry('cruncher_key_producer_class', 'CruncherKeyProducer');
+$cfg->setConfigEntry('cruncher_key_producer_class', 'Org\Shipsimu\Hub\Producer\Cruncher\Key\CruncherKeyProducer');
 
 // CFG: CRUNCHER-TEST-UNIT-PRODUCER-TEMPLATE-CLASS
-$cfg->setConfigEntry('cruncher_test_unit_producer_template_class', 'XmlCruncherTestUnitTemplateEngine');
+$cfg->setConfigEntry('cruncher_test_unit_producer_template_class', 'Org\Shipsimu\Hub\Cruncher\Template\Engine\Xml\TestUnit\XmlCruncherTestUnitTemplateEngine');
 
 // CFG: CRUNCHER-MESSAGE-TEMPLATE-EXTENSION
 $cfg->setConfigEntry('cruncher_message_template_extension', '.xml');
@@ -1177,13 +1180,13 @@ $cfg->setConfigEntry('stacker_outgoing_queue_max_size', 2000);
 $cfg->setConfigEntry('cruncher_test_unit_max_count', 1000);
 
 // CFG: CRUNCHER-UNIT-DB-WRAPPER-CLASS
-$cfg->setConfigEntry('cruncher_unit_db_wrapper_class', 'CruncherUnitDatabaseWrapper');
+$cfg->setConfigEntry('cruncher_unit_db_wrapper_class', 'Org\Shipsimu\Hub\Database\Frontend\Cruncher\Unit\CruncherUnitDatabaseWrapper');
 
 // CFG: CRUNCHER-RANDOM-SECRET-MESSAGE-LENGTH
 $cfg->setConfigEntry('random_secret_message_length', 100);
 
 // CFG: TEST-UNIT-PRODUCER-KEY-ITERATOR-CLASS
-$cfg->setConfigEntry('test_unit_producer_key_iterator_class', 'TestUnitKeyProducerIterator');
+$cfg->setConfigEntry('test_unit_producer_key_iterator_class', 'Org\Shipsimu\Hub\Iterator\Producer\Key\TestUnit\TestUnitKeyProducerIterator');
 
 // CFG: WORK-UNIT-PRODUCER-KEY-ITERATOR-CLASS
 $cfg->setConfigEntry('work_unit_producer_key_iterator_class', 'WorkUnitKeyProducerIterator');
@@ -1192,16 +1195,16 @@ $cfg->setConfigEntry('work_unit_producer_key_iterator_class', 'WorkUnitKeyProduc
 $cfg->setConfigEntry('test_unit_random_secret_key_length', 8 * 32);
 
 // CFG: TEST-UNIT-SOURCE-CLASS
-$cfg->setConfigEntry('test_unit_source_class', 'TestUnitSource');
+$cfg->setConfigEntry('test_unit_source_class', 'Org\Shipsimu\Hub\Crawler\Source\Unit\TestUnitSource');
 
 // CFG: CRYPTO-RANDOM-MESSAGE-HELPER-CLASS
-$cfg->setConfigEntry('crypto_random_message_helper_class', 'CryptoRandomUnitMessageHelper');
+$cfg->setConfigEntry('crypto_random_message_helper_class', 'Org\Shipsimu\Hub\Helper\Crypto\Message\RandomUnit\CryptoRandomUnitMessageHelper');
 
 // CFG: CRUNCHER-INIT-STATE-CLASS
-$cfg->setConfigEntry('cruncher_init_state_class', 'CruncherInitState');
+$cfg->setConfigEntry('cruncher_init_state_class', 'Org\Shipsimu\Hub\Cruncher\State\Initialization\CruncherInitState');
 
 // CFG: CRUNCHER-VIRGIN-STATE-CLASS
-$cfg->setConfigEntry('cruncher_virgin_state_class', 'CruncherVirginState');
+$cfg->setConfigEntry('cruncher_virgin_state_class', 'Org\Shipsimu\Hub\Cruncher\State\Virgin\CruncherVirginState');
 
 // CFG: CRUNCHER-PER-UNIT-KEY-LIMIT
 $cfg->setConfigEntry('cruncher_per_unit_key_limit', 1000);
index 442689922dc689e9b8b058f1e592b269c0c01ec6..e6a0117971a376b079e485e334050fa6528d0a4d 100644 (file)
@@ -2,6 +2,9 @@
 // Own namespace
 namespace Org\Shipsimu\Hub\Producer\Key;
 
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Producer\Producer;
+
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Executor\Executor;
 use Org\Mxchange\CoreFramework\State\Stateable;
index b4cba737182a265c9687389b610dbc89aae59f2f..242af0fa5f528ab649cc5dde5a2ab479650103b9 100644 (file)
@@ -2,6 +2,9 @@
 // Own namespace
 namespace Org\Shipsimu\Hub\Producer\Unit;
 
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Producer\Producer;
+
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Executor\Executor;
 use Org\Mxchange\CoreFramework\State\Stateable;