From 58fd4471c91730c3cbdf94ef48d35fbdaeb8f07f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Mon, 22 May 2017 18:39:19 +0200 Subject: [PATCH] Continued: - ListenerVisitor is not generic (Listenable), re-imported it - this task is also no longer generic - added missing namespaces - imported BaseTask - imported ChunkHandler(Factory), BaseHandler - imported PackageFragmenter - changed namespace MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../hub/classes/class_BaseHubSystem.php | 1 + .../decoder/package/class_PackageDecoder.php | 1 + .../decoder/class_DecoderFactory.php | 3 ++ .../handler/chunks/class_ChunkHandler.php | 4 +- .../protocol/class_BaseProtocolHandler.php | 3 ++ .../assembler/class_PackageAssembler.php | 2 + .../classes/package/class_NetworkPackage.php | 1 + .../hub/classes/tasks/apt-proxy/class_ | 2 + .../apt-proxy/class_AptProxyListenerTask.php | 1 + application/hub/classes/tasks/chat/class_ | 2 + .../chat/class_ChatTelnetListenerTask.php | 1 + .../tasks/crawler/class_BaseUrlSourceTask.php | 3 ++ .../hub/classes/tasks/crawler/class_Crawler | 2 + .../class_CrawlerNodeCommunicatorTask.php | 1 + .../class_CrawlerDocumentParserTask.php | 1 + .../class_CrawlerMimeSnifferTask.php | 1 + .../crawler/ping/class_CrawlerPingTask.php | 1 + .../class_CrawlerRemoteJobPublisherTask.php | 1 + .../tasks/crawler/scanner/class_Crawler | 1 + .../class_CrawlerUploadedListScannerTask.php | 1 + .../class_CrawlerSnippetExtractorTask.php | 1 + .../class_CrawlerStructureAnalyzerTask.php | 1 + .../class_CrawlerLocalUrlCrawlerTask.php | 1 + .../class_CrawlerRemoteUrlCrawlerTask.php | 1 + .../hub/classes/tasks/cruncher/class_Cruncher | 2 + .../class_CruncherKeyProducerTask.php | 1 + .../class_CruncherTestUnitProducerTask.php | 1 + .../class_CruncherWorkUnitFetcherTask.php | 1 + .../class_MinerBlockFetcherTask.php | 1 + ...lass_MinerRealGenesisBlockProducerTask.php | 1 + ...lass_MinerTestGenesisBlockProducerTask.php | 1 + .../hub/classes/tasks/miner/class_Miner | 2 + .../class_MinerNodeCommunicatorTask.php | 1 + .../tasks/network/class_NetworkPackage | 2 + .../class_NetworkPackageReaderTask.php | 1 + .../class_NetworkPackageWriterTask.php | 1 + .../class_NodeAnnouncementTask.php | 1 + .../chunks/class_NodeChunkAssemblerTask.php | 4 ++ application/hub/classes/tasks/node/class_Node | 1 + .../decoder/class_NodePackageDecoderTask.php | 1 + .../hub/classes/tasks/node/dht/class_NodeDht | 2 + .../node/dht/class_NodeDhtBootstrapTask.php | 1 + .../dht/class_NodeDhtInitializationTask.php | 1 + .../dht/class_NodeDhtLateBootstrapTask.php | 1 + .../dht/class_NodeDhtPublicationCheckTask.php | 1 + .../node/dht/class_NodeDhtPublicationTask.php | 1 + .../tasks/node/dht/class_NodeDhtQueryTask.php | 1 + .../listener/class_NodeSocketListenerTask.php | 1 + .../tasks/node/ping/class_NodePingTask.php | 1 + .../class_NodeSelfConnectTask.php | 1 + .../tags/class_NodePackageTagsInitTask.php | 1 + .../node/update/class_NodeUpdateCheckTask.php | 1 + .../class_RawDataPoolMonitorVisitor.php | 1 + .../visitor/tasks/class_ActiveTaskVisitor.php | 2 +- .../tasks/class_ShutdownTaskVisitor.php | 2 +- application/hub/config.php | 23 +++++----- .../class_FinalChunkVerificationException.php | 3 ++ .../package/fragmenter/class_Fragmentable.php | 2 +- .../hub/interfaces/visitor/listener/.htaccess | 1 + .../listener/class_ListenerVisitor.php | 42 +++++++++++++++++++ core | 2 +- 61 files changed, 135 insertions(+), 15 deletions(-) create mode 100644 application/hub/interfaces/visitor/listener/.htaccess create mode 100644 application/hub/interfaces/visitor/listener/class_ListenerVisitor.php diff --git a/application/hub/classes/class_BaseHubSystem.php b/application/hub/classes/class_BaseHubSystem.php index 338059c14..47f4c6f80 100644 --- a/application/hub/classes/class_BaseHubSystem.php +++ b/application/hub/classes/class_BaseHubSystem.php @@ -9,6 +9,7 @@ use Hub\Information\ShareableInfo; use Hub\Listener\BaseListener; use Hub\Listener\Listenable; use Hub\Network\Deliver\Deliverable; +use Hub\Network\Package\Fragment\Fragmentable; use Hub\Network\Receive\Receivable; use Hub\Pool\Poolable; diff --git a/application/hub/classes/decoder/package/class_PackageDecoder.php b/application/hub/classes/decoder/package/class_PackageDecoder.php index 5d11619aa..99cc7db33 100644 --- a/application/hub/classes/decoder/package/class_PackageDecoder.php +++ b/application/hub/classes/decoder/package/class_PackageDecoder.php @@ -3,6 +3,7 @@ namespace Hub\Decoder; // Import application-specific stuff +use Hub\Handler\Network\RawData\Chunks\ChunkHandler; use Hub\Network\Package\NetworkPackage; // Import framework stuff diff --git a/application/hub/classes/factories/decoder/class_DecoderFactory.php b/application/hub/classes/factories/decoder/class_DecoderFactory.php index db3809879..ff8236f2d 100644 --- a/application/hub/classes/factories/decoder/class_DecoderFactory.php +++ b/application/hub/classes/factories/decoder/class_DecoderFactory.php @@ -2,6 +2,9 @@ // Own namespace namespace Hub\Factory\Decoder; +// Import application-specific stuff +use Hub\Handler\Network\RawData\Chunks\ChunkHandler; + // Import framework stuff use CoreFramework\Factory\ObjectFactory; use CoreFramework\Registry\Registry; diff --git a/application/hub/classes/handler/chunks/class_ChunkHandler.php b/application/hub/classes/handler/chunks/class_ChunkHandler.php index 5993cc7d0..f9469078a 100644 --- a/application/hub/classes/handler/chunks/class_ChunkHandler.php +++ b/application/hub/classes/handler/chunks/class_ChunkHandler.php @@ -1,12 +1,14 @@ setConfigEntry('half_shutdown_socket_visitor_class', 'Hub\Visitor\Shutdown // CFG: NODE-RAW-DATA-MONITOR-VISITOR-CLASS $cfg->setConfigEntry('node_raw_data_monitor_visitor_class', 'RawDataPoolMonitorVisitor'); +// CFG: ACTIVE-TASK-VISITOR-CLASS +$cfg->setConfigEntry('active_task_visitor_class', 'Hub\Visitor\Task\Active\ActiveTaskVisitor'); + // CFG: NODE-ANNOUNCEMENT-HELPER-CLASS $cfg->setConfigEntry('node_announcement_helper_class', 'NodeAnnouncementHelper'); @@ -535,7 +538,7 @@ $cfg->setConfigEntry('task_ping_interval_delay', 1000*60*60); $cfg->setConfigEntry('task_ping_max_runs', 0); // CFG: NODE-PACKAGE-TAGS-INIT-TASK-CLASS -$cfg->setConfigEntry('node_package_tags_init_task_class', 'NodePackageTagsInitTask'); +$cfg->setConfigEntry('node_package_tags_init_task_class', 'Hub\Node\Task\Initialization\Tag\NodePackageTagsInitTask'); // CFG: NODE-SELFCONNECT-TASK-CLASS $cfg->setConfigEntry('node_selfconnect_task_class', 'NodeSelfConnectTask'); @@ -550,22 +553,22 @@ $cfg->setConfigEntry('node_ping_task_class', 'NodePingTask'); $cfg->setConfigEntry('node_announcement_task_class', 'NodeAnnouncementTask'); // CFG: NODE-PACKAGE-WRITER-TASK-CLASS -$cfg->setConfigEntry('node_package_writer_task_class', 'NetworkPackageWriterTask'); +$cfg->setConfigEntry('node_package_writer_task_class', 'Hub\Task\Network\Writer\NetworkPackageWriterTask'); // CFG: NODE-PACKAGE-READER-TASK-CLASS -$cfg->setConfigEntry('node_package_reader_task_class', 'NetworkPackageReaderTask'); +$cfg->setConfigEntry('node_package_reader_task_class', 'Hub\Task\Network\Reader\NetworkPackageReaderTask'); // CFG: NODE-SOCKET-LISTENER-TASK-CLASS -$cfg->setConfigEntry('node_socket_listener_task_class', 'NodeSocketListenerTask'); +$cfg->setConfigEntry('node_socket_listener_task_class', 'Hub\Node\Task\Listener\Socket\NodeSocketListenerTask'); // CFG: NODE-CHUNK-ASSEMBLER-TASK-CLASS -$cfg->setConfigEntry('node_chunk_assembler_task_class', 'NodeChunkAssemblerTask'); +$cfg->setConfigEntry('node_chunk_assembler_task_class', 'Hub\Node\Task\Assembler\NodeChunkAssemblerTask'); // CFG: NODE-PACKAGE-DECODER-TASK-CLASS -$cfg->setConfigEntry('node_package_decoder_task_class', 'NodePackageDecoderTask'); +$cfg->setConfigEntry('node_package_decoder_task_class', 'Hub\Node\Task\Decoder\NodePackageDecoderTask'); // CFG: NODE-DHT-INIT-TASK-CLASS -$cfg->setConfigEntry('node_dht_init_task_class', 'NodeDhtInitializationTask'); +$cfg->setConfigEntry('node_dht_init_task_class', 'Hub\Node\Task\Dht\Initialization\NodeDhtInitializationTask'); // CFG: NODE-DHT-BOOTSTRAP-TASK-CLASS $cfg->setConfigEntry('node_dht_bootstrap_task_class', 'NodeDhtBootstrapTask'); @@ -797,7 +800,7 @@ $cfg->setConfigEntry('allow_publish_internal_address', 'N'); $cfg->setConfigEntry('node_status', 'invalid'); // CFG: PACKAGE-FRAGMENTER-CLASS -$cfg->setConfigEntry('package_fragmenter_class', 'PackageFragmenter'); +$cfg->setConfigEntry('package_fragmenter_class', 'Hub\Network\Package\Fragment\PackageFragmenter'); // CFG: PACKAGE-ASSEMBLER-CLASS $cfg->setConfigEntry('package_assembler_class', 'PackageAssembler'); @@ -818,7 +821,7 @@ $cfg->setConfigEntry('socket_timeout_seconds', 3); $cfg->setConfigEntry('socket_timeout_microseconds', 0); // CFG: CHUNK-HANDLER-CLASS -$cfg->setConfigEntry('chunk_handler_class', 'ChunkHandler'); +$cfg->setConfigEntry('chunk_handler_class', 'Hub\Handler\Network\RawData\Chunks\ChunkHandler'); // CFG: PACKAGE-DECODER-CLASS $cfg->setConfigEntry('package_decoder_class', 'PackageDecoder'); @@ -828,7 +831,7 @@ $cfg->setConfigEntry('package_decoder_class', 'PackageDecoder'); $cfg->setConfigEntry('package_recipient_max_count', 3); // CFG: NODE-DHT-CLASS -$cfg->setConfigEntry('node_dht_class', 'NodeDhtFacade'); +$cfg->setConfigEntry('node_dht_class', 'Hub\Dht\Node\NodeDhtFacade'); // CFG: MAX-DHT-RECIPIENTS $cfg->setConfigEntry('max_dht_recipients', 10); diff --git a/application/hub/exceptions/package/class_FinalChunkVerificationException.php b/application/hub/exceptions/package/class_FinalChunkVerificationException.php index 4392798ac..2b54f85a2 100644 --- a/application/hub/exceptions/package/class_FinalChunkVerificationException.php +++ b/application/hub/exceptions/package/class_FinalChunkVerificationException.php @@ -2,6 +2,9 @@ // Own namespace namespace Hub\Node\Network\Chunk; +// Import application-specific stuff +use Hub\Network\Package\Fragment\PackageFragmenter; + // Import framework stuff use CoreFramework\Generic\FrameworkException; diff --git a/application/hub/interfaces/package/fragmenter/class_Fragmentable.php b/application/hub/interfaces/package/fragmenter/class_Fragmentable.php index 3812bc092..15c9fd077 100644 --- a/application/hub/interfaces/package/fragmenter/class_Fragmentable.php +++ b/application/hub/interfaces/package/fragmenter/class_Fragmentable.php @@ -1,6 +1,6 @@ + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2017 Core 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 ListenerVisitor extends Visitor { + /** + * Visits the given listener instance + * + * @param $listenerInstance A Listenable instance + * @return void + */ + function visitListener (Listenable $listenerInstance); + +} diff --git a/core b/core index b89f58d4d..d506014f8 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit b89f58d4d90b6d608b8e16b0e5e3235eaff4f54e +Subproject commit d506014f84d8e6a76ea67ef59537fc56f5f1c364 -- 2.39.5