From 0c0b4940fe008d8037a67149d350e4599c2eae93 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Fri, 19 May 2017 16:25:49 +0200 Subject: [PATCH] Continued: - imported Stateable - renamed templates to closer name - deleted duplicate (now in core framework) interface/template - created namespaces MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../communicator/class_BaseCommunicator.php | 3 ++ .../classes/crawler/class_BaseNodeCrawler.php | 1 + .../keys/class_CruncherKeyProducer.php | 1 + .../class_CruncherTestUnitProducer.php | 1 + .../class_MinerRealGenesisBlockProducer.php | 1 + .../active/class_CommunicatorActiveState.php | 6 +++ .../{class_ => class_Communicator} | 6 +++ .../init/class_CommunicatorInitState.php | 6 +++ .../active/class_CrawlerActiveState.php | 6 +++ .../booting/class_CrawlerBootingState.php | 6 +++ .../states/crawler/{class_ => class_Crawler} | 6 +++ .../crawler/init/class_CrawlerInitState.php | 6 +++ .../cruncher/{class_ => class_Cruncher} | 6 +++ .../cruncher/init/class_CruncherInitState.php | 6 +++ .../virgin/class_CruncherVirginState.php | 6 +++ .../dht/active/class_DhtActiveState.php | 6 +++ .../dht/booting/class_DhtBootingState.php | 5 ++- .../classes/states/dht/{class_ => class_Dht} | 6 +++ .../states/dht/init/class_DhtInitState.php | 6 +++ .../dht/virgin/class_DhtVirginState.php | 6 +++ .../miner/booting/class_MinerBootingState.php | 6 +++ .../hub/classes/states/miner/class_Miner | 6 +++ .../miner/init/class_MinerInitState.php | 6 +++ .../miner/virgin/class_MinerVirginState.php | 6 +++ .../node/active/class_NodeActiveState.php | 3 ++ .../class_NodeAnnouncementCompletedState.php | 6 +++ .../announced/class_NodeAnnouncingState.php | 3 ++ .../states/node/class_BaseNodeState.php | 6 +++ .../states/node/{class_ => class_Node} | 5 ++- .../states/node/init/class_NodeInitState.php | 3 ++ .../node/seniors/class_NodeReachableState.php | 3 ++ .../node/virgin/class_NodeVirginState.php | 3 ++ application/hub/classes/states/peer/class_ | 6 +++ .../connected/class_ConnectedPeerState.php | 6 +++ .../class_ConnectionRefusedPeerState.php | 6 +++ .../class_ConnectionTimedOutPeerState.php | 6 +++ .../errors/class_NoRouteToHostPeerState.php | 6 +++ ...lass_OperationAlreadyProgressPeerState.php | 6 +++ .../peer/errors/class_ProblemPeerState.php | 6 +++ .../class_TransportEndpointGonePeerState.php | 6 +++ .../states/peer/init/class_InitPeerState.php | 6 +++ .../hub/interfaces/crawler/class_Crawler.php | 1 + .../interfaces/executor/class_Executor.php | 1 + .../peer_states/class_LookupablePeerState.php | 6 +++ .../producer/block/class_BlockProducer.php | 6 +++ .../producer/keys/class_KeyProducer.php | 6 +++ .../work_units/class_UnitProducer.php | 6 +++ application/hub/interfaces/states/class_ | 28 ------------- .../hub/interfaces/states/class_Stateable.php | 41 ------------------- .../states/client/class_ClientStateable.php | 6 +++ .../states/hub/class_HubStateable.php | 6 +++ .../states/peer/class_PeerStateable.php | 6 +++ 52 files changed, 248 insertions(+), 71 deletions(-) rename application/hub/classes/states/communicator/{class_ => class_Communicator} (94%) rename application/hub/classes/states/crawler/{class_ => class_Crawler} (94%) rename application/hub/classes/states/cruncher/{class_ => class_Cruncher} (95%) rename application/hub/classes/states/dht/{class_ => class_Dht} (94%) rename application/hub/classes/states/node/{class_ => class_Node} (95%) delete mode 100644 application/hub/interfaces/states/class_ delete mode 100644 application/hub/interfaces/states/class_Stateable.php diff --git a/application/hub/classes/communicator/class_BaseCommunicator.php b/application/hub/classes/communicator/class_BaseCommunicator.php index a16daf3df..6eec1dbd7 100644 --- a/application/hub/classes/communicator/class_BaseCommunicator.php +++ b/application/hub/classes/communicator/class_BaseCommunicator.php @@ -5,6 +5,9 @@ namespace Hub\Communicator; // Import hub-specific stuff use Hub\Generic\BaseHubSystem; +// Import framework stuff +use CoreFramework\State\Stateable; + /** * A general communicator class * diff --git a/application/hub/classes/crawler/class_BaseNodeCrawler.php b/application/hub/classes/crawler/class_BaseNodeCrawler.php index 590a222af..ec1e88529 100644 --- a/application/hub/classes/crawler/class_BaseNodeCrawler.php +++ b/application/hub/classes/crawler/class_BaseNodeCrawler.php @@ -7,6 +7,7 @@ use Hub\Generic\BaseHubSystem; // Import framework stuff use CoreFramework\Registry\Registry; +use CoreFramework\State\Stateable; /** * A general NodeCrawler class diff --git a/application/hub/classes/producer/cruncher/keys/class_CruncherKeyProducer.php b/application/hub/classes/producer/cruncher/keys/class_CruncherKeyProducer.php index 3078d680f..83980750e 100644 --- a/application/hub/classes/producer/cruncher/keys/class_CruncherKeyProducer.php +++ b/application/hub/classes/producer/cruncher/keys/class_CruncherKeyProducer.php @@ -5,6 +5,7 @@ namespace Hub\Producer\Cruncher\Key; // Import framework stuff use CoreFramework\Factory\ObjectFactory; use CoreFramework\Registry\Registerable; +use CoreFramework\State\Stateable; /** * A CruncherKey producer class diff --git a/application/hub/classes/producer/cruncher/work_units/class_CruncherTestUnitProducer.php b/application/hub/classes/producer/cruncher/work_units/class_CruncherTestUnitProducer.php index 59d2bc3a0..21dd2f1f5 100644 --- a/application/hub/classes/producer/cruncher/work_units/class_CruncherTestUnitProducer.php +++ b/application/hub/classes/producer/cruncher/work_units/class_CruncherTestUnitProducer.php @@ -6,6 +6,7 @@ namespace Hub\Cruncher\Producer\Unit; use CoreFramework\Factory\Database\Wrapper\DatabaseWrapperFactory; use CoreFramework\Factory\ObjectFactory; use CoreFramework\Registry\Registerable; +use CoreFramework\State\Stateable; /** * A CruncherTestUnit producer class diff --git a/application/hub/classes/producer/miner/blocks/class_MinerRealGenesisBlockProducer.php b/application/hub/classes/producer/miner/blocks/class_MinerRealGenesisBlockProducer.php index 6006a215a..97b7f8e5c 100644 --- a/application/hub/classes/producer/miner/blocks/class_MinerRealGenesisBlockProducer.php +++ b/application/hub/classes/producer/miner/blocks/class_MinerRealGenesisBlockProducer.php @@ -5,6 +5,7 @@ namespace Hub\Miner\Producer\Block\Genesis; // Import framework stuff use CoreFramework\Factory\ObjectFactory; use CoreFramework\Registry\Registerable; +use CoreFramework\State\Stateable; /** * A MinerRealGenesisBlock producer class diff --git a/application/hub/classes/states/communicator/active/class_CommunicatorActiveState.php b/application/hub/classes/states/communicator/active/class_CommunicatorActiveState.php index 64267457d..00d5e4088 100644 --- a/application/hub/classes/states/communicator/active/class_CommunicatorActiveState.php +++ b/application/hub/classes/states/communicator/active/class_CommunicatorActiveState.php @@ -1,4 +1,10 @@ - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2015 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 . - */ -interface ???Stateable extends Stateable { -} - -// [EOF] -?> diff --git a/application/hub/interfaces/states/class_Stateable.php b/application/hub/interfaces/states/class_Stateable.php deleted file mode 100644 index 3488c16d6..000000000 --- a/application/hub/interfaces/states/class_Stateable.php +++ /dev/null @@ -1,41 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2015 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 . - */ -interface Stateable extends FrameworkInterface { - /** - * Executes the state with given Executor instance - * - * @param $executorInstance An instance of a Executor class - * @return void - */ - function executeState (Executor $executorInstance); -} - -// [EOF] -?> diff --git a/application/hub/interfaces/states/client/class_ClientStateable.php b/application/hub/interfaces/states/client/class_ClientStateable.php index cb802286e..79f027370 100644 --- a/application/hub/interfaces/states/client/class_ClientStateable.php +++ b/application/hub/interfaces/states/client/class_ClientStateable.php @@ -1,4 +1,10 @@