From: Roland Häder Date: Wed, 3 Jan 2018 22:04:33 +0000 (+0100) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=7998103e168f449f08b706ab3b8c9fd3f1a743b5;p=hub.git Continued: - started porting crawler sub project to new framework - fixed namespaces for task classes, \Task should always be included - added commented-out/in debug lines for hub Signed-off-by: Roland Häder --- diff --git a/application/hub/classes/filter/bootstrap/crawler/class_CrawlerBootstrapExtraBootstrappingFilter.php b/application/hub/classes/filter/bootstrap/crawler/class_CrawlerBootstrapExtraBootstrappingFilter.php index 7544ff846..10df8349e 100644 --- a/application/hub/classes/filter/bootstrap/crawler/class_CrawlerBootstrapExtraBootstrappingFilter.php +++ b/application/hub/classes/filter/bootstrap/crawler/class_CrawlerBootstrapExtraBootstrappingFilter.php @@ -2,6 +2,9 @@ // Own namespace namespace Org\Shipsimu\Hub\Filter\Bootstrap\Crawler\Extra; +// Import application-specific stuff +use Org\Shipsimu\Hub\Crawler\Filter\BaseCrawlerFilter; + // Import framework stuff use Org\Mxchange\CoreFramework\Filter\Filterable; use Org\Mxchange\CoreFramework\Registry\Registry; diff --git a/application/hub/classes/filter/bootstrap/crawler/class_CrawlerBootstrapGenericActivationFilter.php b/application/hub/classes/filter/bootstrap/crawler/class_CrawlerBootstrapGenericActivationFilter.php index e868aff85..cd4931725 100644 --- a/application/hub/classes/filter/bootstrap/crawler/class_CrawlerBootstrapGenericActivationFilter.php +++ b/application/hub/classes/filter/bootstrap/crawler/class_CrawlerBootstrapGenericActivationFilter.php @@ -2,6 +2,9 @@ // Own namespace namespace Org\Shipsimu\Hub\Filter\Bootstrap\Crawler\Activation; +// Import application-specific stuff +use Org\Shipsimu\Hub\Crawler\Filter\BaseCrawlerFilter; + // Import framework stuff use Org\Mxchange\CoreFramework\Filter\Filterable; use Org\Mxchange\CoreFramework\Registry\Registry; diff --git a/application/hub/classes/filter/crawler/class_CrawlerInitializationFilter.php b/application/hub/classes/filter/crawler/class_CrawlerInitializationFilter.php index a903a788c..dc1acf8e3 100644 --- a/application/hub/classes/filter/crawler/class_CrawlerInitializationFilter.php +++ b/application/hub/classes/filter/crawler/class_CrawlerInitializationFilter.php @@ -2,6 +2,9 @@ // Own namespace namespace Org\Shipsimu\Hub\Crawler\Filter\Initialization; +// Import application-specific stuff +use Org\Shipsimu\Hub\Crawler\Filter\BaseCrawlerFilter; + // Import framework stuff use Org\Mxchange\CoreFramework\Factory\ObjectFactory; use Org\Mxchange\CoreFramework\Filter\Filterable; diff --git a/application/hub/classes/filter/crawler/class_CrawlerPhpRequirementsFilter.php b/application/hub/classes/filter/crawler/class_CrawlerPhpRequirementsFilter.php index 5b1fa474b..5ba52c2b0 100644 --- a/application/hub/classes/filter/crawler/class_CrawlerPhpRequirementsFilter.php +++ b/application/hub/classes/filter/crawler/class_CrawlerPhpRequirementsFilter.php @@ -2,6 +2,9 @@ // Own namespace namespace Org\Shipsimu\Hub\Crawler\Filter\Requirements; +// Import application-specific stuff +use Org\Shipsimu\Hub\Crawler\Filter\BaseCrawlerFilter; + // Import framework stuff use Org\Mxchange\CoreFramework\Filter\Filterable; use Org\Mxchange\CoreFramework\Request\Requestable; diff --git a/application/hub/classes/filter/crawler/class_CrawlerWelcomeTeaserFilter.php b/application/hub/classes/filter/crawler/class_CrawlerWelcomeTeaserFilter.php index ebc476bc0..3e5f7db14 100644 --- a/application/hub/classes/filter/crawler/class_CrawlerWelcomeTeaserFilter.php +++ b/application/hub/classes/filter/crawler/class_CrawlerWelcomeTeaserFilter.php @@ -2,6 +2,9 @@ // Own namespace namespace Org\Shipsimu\Hub\Crawler\Filter\WelcomeTeaser; +// Import application-specific stuff +use Org\Shipsimu\Hub\Crawler\Filter\BaseCrawlerFilter; + // Import framework stuff use Org\Mxchange\CoreFramework\Filter\Filterable; use Org\Mxchange\CoreFramework\Registry\Registry; diff --git a/application/hub/classes/filter/shutdown/crawler/class_CrawlerShutdownFilter.php b/application/hub/classes/filter/shutdown/crawler/class_CrawlerShutdownFilter.php index b961f97a1..e198c68e2 100644 --- a/application/hub/classes/filter/shutdown/crawler/class_CrawlerShutdownFilter.php +++ b/application/hub/classes/filter/shutdown/crawler/class_CrawlerShutdownFilter.php @@ -2,6 +2,9 @@ // Own namespace namespace Org\Shipsimu\Hub\Filter\Shutdown\Crawler; +// Import application-specific stuff +use Org\Shipsimu\Hub\Crawler\Filter\BaseCrawlerFilter; + // Import framework stuff use Org\Mxchange\CoreFramework\Filter\Filterable; use Org\Mxchange\CoreFramework\Registry\Registry; diff --git a/application/hub/classes/filter/task/crawler/class_CrawlerTaskHandlerInitializerFilter.php b/application/hub/classes/filter/task/crawler/class_CrawlerTaskHandlerInitializerFilter.php index 25e3ec8a5..80668f155 100644 --- a/application/hub/classes/filter/task/crawler/class_CrawlerTaskHandlerInitializerFilter.php +++ b/application/hub/classes/filter/task/crawler/class_CrawlerTaskHandlerInitializerFilter.php @@ -2,6 +2,9 @@ // Own namespace namespace Org\Shipsimu\Hub\Filter\Initializer\Crawler\Handler\Task; +// Import application-specific stuff +use Org\Shipsimu\Hub\Crawler\Filter\BaseCrawlerFilter; + // Import framework stuff use Org\Mxchange\CoreFramework\Factory\ObjectFactory; use Org\Mxchange\CoreFramework\Filter\Filterable; diff --git a/application/hub/classes/listener/class_BaseListener.php b/application/hub/classes/listener/class_BaseListener.php index fb656ebc4..45cfc471e 100644 --- a/application/hub/classes/listener/class_BaseListener.php +++ b/application/hub/classes/listener/class_BaseListener.php @@ -283,25 +283,25 @@ class BaseListener extends BaseHubSystem implements Visitable { */ public function monitorIncomingRawData () { // Trace message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: CALLED!', strtoupper($this->getProtocolName()))); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: CALLED!', strtoupper($this->getProtocolName()))); // Check if an incoming socket is registered if (!$this->getRegistryInstance()->isIncomingSocketRegistered()) { // Trace message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: No socket of type "%s" registered. - EXIT!', strtoupper($this->getProtocolName()), StorableSocket::CONNECTION_TYPE_INCOMING)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: No socket of type "%s" registered. - EXIT!', strtoupper($this->getProtocolName()), StorableSocket::CONNECTION_TYPE_INCOMING)); // Skip further processing return; } // END - if // Debugging: - /* DEBUG-DIE: */ $this->getRegistryInstance()->debugInstance(); + //* DEBUG-DIE: */ $this->getRegistryInstance()->debugInstance(); // Get iterator from registry instance $iteratorInstance = $this->getRegistryInstance()->getIterator(); // Debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: iteratorInstance[]=%s', strtoupper($this->getProtocolName()), gettype($iteratorInstance))); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: iteratorInstance[]=%s', strtoupper($this->getProtocolName()), gettype($iteratorInstance))); // Should be valid instance if (is_null($iteratorInstance)) { @@ -319,12 +319,12 @@ class BaseListener extends BaseHubSystem implements Visitable { $socketInstance = $iteratorInstance->current(); // Debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: socketInstance[]=%s', strtoupper($this->getProtocolName()), gettype($socketInstance))); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: socketInstance[]=%s', strtoupper($this->getProtocolName()), gettype($socketInstance))); // Is NULL returned? if (is_null($socketInstance)) { // Trace message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: socketInstance=NULL - EXIT!', strtoupper($this->getProtocolName()))); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: socketInstance=NULL - EXIT!', strtoupper($this->getProtocolName()))); // Then abort here return; @@ -334,7 +334,7 @@ class BaseListener extends BaseHubSystem implements Visitable { $iteratorInstance->next(); // Trace message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: EXIT!', strtoupper($this->getProtocolName()))); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: EXIT!', strtoupper($this->getProtocolName()))); } /** diff --git a/application/hub/classes/listener/class_BaseListenerDecorator.php b/application/hub/classes/listener/class_BaseListenerDecorator.php index 50097c108..957c88233 100644 --- a/application/hub/classes/listener/class_BaseListenerDecorator.php +++ b/application/hub/classes/listener/class_BaseListenerDecorator.php @@ -155,7 +155,7 @@ class BaseListenerDecorator extends BaseDecorator implements Visitable { */ public function monitorIncomingRawData () { // Trace message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('LISTENER-DECORATOR: CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('LISTENER-DECORATOR: CALLED!'); // Get the handler instance $handlerInstance = $this->getListenerInstance()->getHandlerInstance(); @@ -173,12 +173,12 @@ class BaseListenerDecorator extends BaseDecorator implements Visitable { } // Debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('LISTENER-DECORATOR: handlerInstance=%s', $handlerInstance->__toString())); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('LISTENER-DECORATOR: handlerInstance=%s', $handlerInstance->__toString())); // Does the handler have some decoded data pending? if (!$handlerInstance->isRawDataPending()) { // No data is pending so skip further code silently - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('LISTENER-DECORATOR: No data pending on handlerInstance=' . $handlerInstance->__toString() . ' - EXIT!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('LISTENER-DECORATOR: No data pending on handlerInstance=' . $handlerInstance->__toString() . ' - EXIT!'); return; } // END - if @@ -192,11 +192,11 @@ class BaseListenerDecorator extends BaseDecorator implements Visitable { * know if the decoded data origins from a TCP or UDP connection so it * can just be passed over to the network package receiver. */ - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('LISTENER-DECORATOR: Going to handle over some raw data to receiverInstance=' . $receiverInstance->__toString() . ' ...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('LISTENER-DECORATOR: Going to handle over some raw data to receiverInstance=' . $receiverInstance->__toString() . ' ...'); $receiverInstance->addRawDataToIncomingStack($handlerInstance); // Trace message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('LISTENER-DECORATOR: EXIT!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('LISTENER-DECORATOR: EXIT!'); } /** diff --git a/application/hub/classes/package/assembler/class_PackageAssembler.php b/application/hub/classes/package/assembler/class_PackageAssembler.php index 4535ed850..e83b847ca 100644 --- a/application/hub/classes/package/assembler/class_PackageAssembler.php +++ b/application/hub/classes/package/assembler/class_PackageAssembler.php @@ -238,18 +238,23 @@ class PackageAssembler extends BaseHubSystem implements Assembler, Registerable, */ public function handlePendingData () { // Debug output - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PACKAGE-ASSEMBLER: Going to decode ' . strlen($this->pendingData) . ' Bytes of pending data. pendingData=' . $this->pendingData); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PACKAGE-ASSEMBLER: Going to decode ' . strlen($this->pendingData) . ' Bytes of pending data. pendingData=' . $this->pendingData); // Assert on condition assert(!$this->isPendingDataEmpty()); // No markers set? if (!$this->ifStartEndMarkersSet($this->pendingData)) { + // Debug messages + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PACKAGE-ASSEMBLER: Pending data of ' . strlen($this->pendingData) . ' Bytes are incomplete, waiting for more ...'); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PACKAGE-ASSEMBLER: this->pendingData=' . $this->pendingData); + // This will cause an assertition in next call, so simply wait for more data - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PACKAGE-ASSEMBLER: Pending data of ' . strlen($this->pendingData) . ' Bytes are incomplete, waiting for more ...'); - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PACKAGE-ASSEMBLER: this->pendingData=' . $this->pendingData); return; } elseif (substr_count($this->pendingData, HandleableRawData::STREAM_START_MARKER) > 1) { + // Debug message + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PACKAGE-ASSEMBLER: Pending data of ' . strlen($this->pendingData) . ' Bytes contain multiple messages. Need to split each message out.'); + /* * Multiple messages found, so split off first message as the input * stream can only handle one message per time. @@ -258,6 +263,9 @@ class PackageAssembler extends BaseHubSystem implements Assembler, Registerable, // Prepend start marker again as it is needed to decode the message. $message = HandleableRawData::STREAM_START_MARKER . $message; + // Debug message + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PACKAGE-ASSEMBLER: Found message of ' . strlen($message) . ' Bytes, appending to stack ...'); + // Push it on stack $this->getStackInstance()->pushNamed(self::STACKER_NAME_MULTIPLE_MESSAGE, $message); } // END - foreach @@ -282,7 +290,7 @@ class PackageAssembler extends BaseHubSystem implements Assembler, Registerable, $this->clearPendingData(); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PACKAGE-ASSEMBLER: Last block of partial data received. A total of ' . strlen($packageContent[HandleableRawData::PACKAGE_RAW_DATA]) . ' bytes has been received.'); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PACKAGE-ASSEMBLER: Last block of partial data received. A total of ' . strlen($packageContent[HandleableRawData::PACKAGE_RAW_DATA]) . ' bytes has been received.'); // Make sure last CHUNK_SEPARATOR is not there if (substr($packageContent[HandleableRawData::PACKAGE_RAW_DATA], -1, 1) == PackageFragmenter::CHUNK_SEPARATOR) { @@ -298,7 +306,7 @@ class PackageAssembler extends BaseHubSystem implements Assembler, Registerable, $chunks = explode(PackageFragmenter::CHUNK_SEPARATOR, $packageContent[HandleableRawData::PACKAGE_RAW_DATA]); // Add all chunks because the last final chunk is found - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PACKAGE-ASSEMBLER: Going to add ' . count($chunks) . ' to chunk handler ...'); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PACKAGE-ASSEMBLER: Going to add ' . count($chunks) . ' to chunk handler ...'); $this->getHandlerInstance()->addAllChunksWithFinal($chunks); } diff --git a/application/hub/classes/package/class_NetworkPackage.php b/application/hub/classes/package/class_NetworkPackage.php index 1933b8315..d231d3f3a 100644 --- a/application/hub/classes/package/class_NetworkPackage.php +++ b/application/hub/classes/package/class_NetworkPackage.php @@ -9,6 +9,7 @@ use Org\Shipsimu\Hub\Factory\Assembler\Package\PackageAssemblerFactory; use Org\Shipsimu\Hub\Factory\Dht\DhtObjectFactory; use Org\Shipsimu\Hub\Factory\Discovery\Package\PackageDiscoveryFactory; use Org\Shipsimu\Hub\Factory\Discovery\Socket\SocketDiscoveryFactory; +use Org\Shipsimu\Hub\Factory\FilterChain\Package\PackageFilterChainFactory; use Org\Shipsimu\Hub\Factory\Information\Connection\ConnectionInfoFactory; use Org\Shipsimu\Hub\Factory\Node\NodeObjectFactory; use Org\Shipsimu\Hub\Generic\BaseHubSystem; @@ -1097,6 +1098,9 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R // Just return whether the stack is not empty $isPending = (!$this->getStackInstance()->isStackEmpty(self::STACKER_NAME_DECODED_INCOMING)); + // Trace message + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE: isPending=%d - EXIT!', intval($isPending))); + // Return the status return $isPending; } @@ -1238,6 +1242,9 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R * @return void */ public function handleAssemblerPendingData () { + // Debug message + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE: Calling this->getAssemblerInstance()->handlePendingData() ...'); + // Handle it $this->getAssemblerInstance()->handlePendingData(); } @@ -1248,6 +1255,9 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R * @return void */ public function handleMultipleMessages () { + // Debug message + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE: Calling this->getAssemblerInstance()->handleMultipleMessages() ...'); + // Handle it $this->getAssemblerInstance()->handleMultipleMessages(); } diff --git a/application/hub/classes/tasks/crawler/document_parser/class_CrawlerDocumentParserTask.php b/application/hub/classes/tasks/crawler/document_parser/class_CrawlerDocumentParserTask.php index 2505a1cb7..88c78f61b 100644 --- a/application/hub/classes/tasks/crawler/document_parser/class_CrawlerDocumentParserTask.php +++ b/application/hub/classes/tasks/crawler/document_parser/class_CrawlerDocumentParserTask.php @@ -1,6 +1,6 @@ isProcessedMessagePending()) { // Trace message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-READER-TASK: Calling packageInstance->handleProcessedMessage() ...'); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-READER-TASK: Calling packageInstance->handleProcessedMessage() ...'); /* * A previously proccessed message is waiting for being @@ -103,7 +103,7 @@ class NetworkPackageReaderTask extends BaseTask implements Taskable, Visitable { $packageInstance->handleProcessedMessage(); } elseif ($packageInstance->isNewMessageArrived()) { // Trace message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-READER-TASK: Calling packageInstance->handleNewlyArrivedMessage() ...'); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-READER-TASK: Calling packageInstance->handleNewlyArrivedMessage() ...'); /* * A fully "decoded" message has been received and added for being @@ -115,7 +115,7 @@ class NetworkPackageReaderTask extends BaseTask implements Taskable, Visitable { $packageInstance->handleNewlyArrivedMessage(); } elseif ($packageInstance->isIncomingRawDataHandled()) { // Trace message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-READER-TASK: Calling packageInstance->assembleDecodedDataToPackage() ...'); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-READER-TASK: Calling packageInstance->assembleDecodedDataToPackage() ...'); /* * Incoming decoded data has been handled (see below) so it needs to @@ -125,7 +125,7 @@ class NetworkPackageReaderTask extends BaseTask implements Taskable, Visitable { $packageInstance->assembleDecodedDataToPackage(); } elseif ($packageInstance->ifMultipleMessagesPending()) { // Trace message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-READER-TASK: Calling packageInstance->handleMultipleMessages() ...'); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-READER-TASK: Calling packageInstance->handleMultipleMessages() ...'); /* * Some raw data contained multiple messages which where now splitted. @@ -133,13 +133,13 @@ class NetworkPackageReaderTask extends BaseTask implements Taskable, Visitable { $packageInstance->handleMultipleMessages(); } elseif ($packageInstance->isNewRawDataPending()) { // Trace message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-READER-TASK: Calling packageInstance->handleIncomingDecodedData() ...'); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-READER-TASK: Calling packageInstance->handleIncomingDecodedData() ...'); // Raw, decoded data has been received $packageInstance->handleIncomingDecodedData(); } elseif ($packageInstance->ifAssemblerHasPendingDataLeft()) { // Trace message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-READER-TASK: Calling packageInstance->handleAssemblerPendingData() ...'); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-READER-TASK: Calling packageInstance->handleAssemblerPendingData() ...'); // Handle any pending data from the package assembler $packageInstance->handleAssemblerPendingData(); diff --git a/application/hub/config.php b/application/hub/config.php index 7ccea7d68..bd33cc0dd 100644 --- a/application/hub/config.php +++ b/application/hub/config.php @@ -112,10 +112,10 @@ $cfg->setConfigEntry('tcp_pool_iterator_class', 'Org\Mxchange\CoreFramework\Iter $cfg->setConfigEntry('udp_pool_iterator_class', 'Org\Mxchange\CoreFramework\Iterator\DefaultIterator'); // CFG: SHUTDOWN-POOL-ITERATOR-CLASS -$cfg->setConfigEntry('shutdown_pool_iterator_class', 'ShutdownPoolIterator'); +$cfg->setConfigEntry('shutdown_pool_iterator_class', 'Org\Shipsimu\Hub\Iterator\Shutdown\Pool\ShutdownPoolIterator'); // CFG: HANDLER-POOL-ITERATOR-CLASS -$cfg->setConfigEntry('handler_pool_iterator_class', 'HandlerPoolIterator'); +$cfg->setConfigEntry('handler_pool_iterator_class', 'Org\Shipsimu\Hub\Iterator\Handler\Pool\HandlerPoolIterator'); // CFG: NETWORK-LISTEN-ITERATOR-CLASS $cfg->setConfigEntry('network_listen_iterator_class', 'Org\Shipsimu\Hub\Iterator\Network\Listener\NetworkListenIterator'); @@ -133,7 +133,7 @@ $cfg->setConfigEntry('udp_raw_data_handler_class', 'Org\Shipsimu\Hub\Handler\Net $cfg->setConfigEntry('socket_raw_data_handler_class', 'Org\Shipsimu\Hub\Handler\Network\Socket\RawData\SocketRawDataHandler'); // CFG: SHUTDOWN-LISTENER-POOL-VISITOR-CLASS -$cfg->setConfigEntry('shutdown_listener_pool_visitor_class', 'ShutdownListenerPoolVisitor'); +$cfg->setConfigEntry('shutdown_listener_pool_visitor_class', 'Org\Shipsimu\Hub\Visitor\Pool\Listener\ShutdownListenerPoolVisitor'); // CFG: SHUTDOWN-SOCKET-VISITOR-CLASS $cfg->setConfigEntry('shutdown_socket_visitor_class', 'Org\Shipsimu\Hub\Visitor\Shutdown\Socket\ShutdownSocketVisitor'); @@ -151,7 +151,7 @@ $cfg->setConfigEntry('active_task_visitor_class', 'Org\Shipsimu\Hub\Visitor\Task $cfg->setConfigEntry('shutdown_task_visitor_class', 'Org\Shipsimu\Hub\Visitor\Task\Shutdown\ShutdownTaskVisitor'); // CFG: NODE-ANNOUNCEMENT-HELPER-CLASS -$cfg->setConfigEntry('node_announcement_helper_class', 'NodeAnnouncementHelper'); +$cfg->setConfigEntry('node_announcement_helper_class', 'Org\Shipsimu\Hub\Node\Helper\Announcement\NodeAnnouncementHelper'); // CFG: NODE-SELF-CONNECT-HELPER-CLASS $cfg->setConfigEntry('node_self_connect_helper_class', 'Org\Shipsimu\Hub\Node\Helper\SelfConnect\NodeSelfConnectHelper'); @@ -160,7 +160,7 @@ $cfg->setConfigEntry('node_self_connect_helper_class', 'Org\Shipsimu\Hub\Node\He $cfg->setConfigEntry('dht_bootstrap_helper_class', 'Org\Shipsimu\Hub\Helper\Dht\Bootstrap\DhtBootstrapHelper'); // CFG: DHT-PUBLISH-ENTRY-HELPER-CLASS -$cfg->setConfigEntry('dht_publish_entry_helper_class', 'DhtPublishEntryHelper'); +$cfg->setConfigEntry('dht_publish_entry_helper_class', 'Org\Shipsimu\Hub\Helper\Dht\Publish\DhtPublishEntryHelper'); // CFG: DEFAULT-CONSOLE-COMMAND $cfg->setConfigEntry('default_console_command', 'main'); @@ -190,7 +190,7 @@ $cfg->setConfigEntry('node_initializer_filter_class', 'Org\Shipsimu\Hub\Filter\N $cfg->setConfigEntry('node_activation_task_handler_initializer_filter_class', 'Org\Shipsimu\Hub\Filter\Initializer\Node\Handler\Task\NodeTaskHandlerInitializerFilter'); // CFG: NODE-ACTIVATION-ANNOUNCEMENT-TASK-FILTER -$cfg->setConfigEntry('node_activation_announcement_task_filter_class', 'NodeActivationAnnouncementFilter'); +$cfg->setConfigEntry('node_activation_announcement_task_filter_class', 'Org\Shipsimu\Hub\Filter\Activation\Node\Announcement\NodeActivationAnnouncementFilter'); // CFG: NODE-WELCOME-TEASER-FILTER $cfg->setConfigEntry('node_welcome_teaser_filter_class', 'Org\Shipsimu\Hub\Filter\Node\WelcomeTeaser\NodeWelcomeTeaserFilter'); @@ -220,7 +220,7 @@ $cfg->setConfigEntry('node_shutdown_task_handler_filter_class', 'Org\Shipsimu\Hu $cfg->setConfigEntry('node_shutdown_node_filter_class', 'Org\Shipsimu\Hub\Filter\Shutdown\Node\NodeShutdownNodeFilter'); // CFG: PACKAGE-FILTER-CHAIN-CLASS -$cfg->setConfigEntry('package_filter_chain_class', 'PackageFilterChain'); +$cfg->setConfigEntry('package_filter_chain_class', 'Org\Shipsimu\Hub\FilterChain\Package\PackageFilterChain'); // CFG: PACKAGE-TAG-ANNOUNCEMENT-FILTER $cfg->setConfigEntry('package_tag_announcement_filter_class', 'PackageAnnouncementTagFilter'); @@ -1260,61 +1260,61 @@ $cfg->setConfigEntry('index_extension', '.idx'); $cfg->setConfigEntry('hub_console_cmd_crawler_resolver_class', 'Org\Shipsimu\Hub\Resolver\Command\HubConsoleCommandResolver'); // CFG: CRAWLER-PHP-REQUIREMENTS-FILTER -$cfg->setConfigEntry('crawler_php_requirements_filter_class', 'CrawlerPhpRequirementsFilter'); +$cfg->setConfigEntry('crawler_php_requirements_filter_class', 'Org\Shipsimu\Hub\Crawler\Filter\Requirements\CrawlerPhpRequirementsFilter'); // CFG: CRAWLER-INITIALIZER-FILTER -$cfg->setConfigEntry('crawler_initializer_filter_class', 'CrawlerInitializationFilter'); +$cfg->setConfigEntry('crawler_initializer_filter_class', 'Org\Shipsimu\Hub\Crawler\Filter\Initialization\CrawlerInitializationFilter'); // CFG: NODE-CONSOLE-CRAWLER -$cfg->setConfigEntry('node_console_crawler_class', 'NodeConsoleCrawler'); +$cfg->setConfigEntry('node_console_crawler_class', 'Org\Shipsimu\Hub\Crawler\NodeConsoleCrawler'); // CFG: CRAWLER-WELCOME-TEASER-FILTER -$cfg->setConfigEntry('crawler_welcome_teaser_filter_class', 'CrawlerWelcomeTeaserFilter'); +$cfg->setConfigEntry('crawler_welcome_teaser_filter_class', 'Org\Shipsimu\Hub\Crawler\Filter\WelcomeTeaser\CrawlerWelcomeTeaserFilter'); // CFG: CRAWLER-BOOTSTRAP-TASK-HANDLER-INITIALIZER-FILTER -$cfg->setConfigEntry('crawler_bootstrap_task_handler_initializer_filter_class', 'CrawlerTaskHandlerInitializerFilter'); +$cfg->setConfigEntry('crawler_bootstrap_task_handler_initializer_filter_class', 'Org\Shipsimu\Hub\Filter\Initializer\Crawler\Handler\Task\CrawlerTaskHandlerInitializerFilter'); // CFG: CRAWLER-BOOTSTRAP-EXTRA-BOOTSTRAPPING-FILTER -$cfg->setConfigEntry('crawler_bootstrap_extra_bootstrapping_filter_class', 'CrawlerBootstrapExtraBootstrappingFilter'); +$cfg->setConfigEntry('crawler_bootstrap_extra_bootstrapping_filter_class', 'Org\Shipsimu\Hub\Filter\Bootstrap\Crawler\Extra\CrawlerBootstrapExtraBootstrappingFilter'); // CFG: CRAWLER-BOOTSTRAP-GENERIC-ACTIVATION-FILTER -$cfg->setConfigEntry('crawler_bootstrap_generic_activation_filter_class', 'CrawlerBootstrapGenericActivationFilter'); +$cfg->setConfigEntry('crawler_bootstrap_generic_activation_filter_class', 'Org\Shipsimu\Hub\Filter\Bootstrap\Crawler\Activation\CrawlerBootstrapGenericActivationFilter'); // CFG: CRAWLER-SHUTDOWN-FILTER -$cfg->setConfigEntry('crawler_shutdown_filter_class', 'CrawlerShutdownFilter'); +$cfg->setConfigEntry('crawler_shutdown_filter_class', 'Org\Shipsimu\Hub\Filter\Shutdown\Crawler\CrawlerShutdownFilter'); // CFG: CRAWLER-NODE-COMMUNICATOR-CLASS -$cfg->setConfigEntry('crawler_node_communicator_class', 'CrawlerNodeCommunicator'); +$cfg->setConfigEntry('crawler_node_communicator_class', 'Org\Shipsimu\Hub\Crawler\Communicator\Node\CrawlerNodeCommunicator'); // CFG: CRAWLER-INIT-STATE-CLASS -$cfg->setConfigEntry('crawler_init_state_class', 'CrawlerInitState'); +$cfg->setConfigEntry('crawler_init_state_class', 'Org\Shipsimu\Hub\State\Crawler\CrawlerInitState'); // CFG: CRAWLER-BOOTING-STATE-CLASS -$cfg->setConfigEntry('crawler_booting_state_class', 'CrawlerBootingState'); +$cfg->setConfigEntry('crawler_booting_state_class', 'Org\Shipsimu\Hub\State\Crawler\CrawlerBootingState'); // CFG: COMMUNICATOR-INIT-STATE-CLASS -$cfg->setConfigEntry('communicator_init_state_class', 'CommunicatorInitState'); +$cfg->setConfigEntry('communicator_init_state_class', 'Org\Shipsimu\Hub\State\Communicator\CommunicatorInitState'); // CFG: CRAWLER-UPLOADED-LIST-SCANNER -$cfg->setConfigEntry('crawler_uploaded_list_scanner', 'CrawlerUploadedListScanner'); +$cfg->setConfigEntry('crawler_uploaded_list_scanner', 'Org\Shipsimu\Hub\Crawler\Scanner\UploadedList\CrawlerUploadedListScanner'); // CFG: CRAWLER-URL-SOURCE-LOCAL-START-CLASS -$cfg->setConfigEntry('crawler_url_source_local_start_class', 'CrawlerLocalStartUrlSource'); +$cfg->setConfigEntry('crawler_url_source_local_start_class', 'Org\Shipsimu\Hub\Crawler\Source\LocalStart\CrawlerLocalStartUrlSource'); // CFG: CRAWLER-URL-SOURCE-UPLOADED-LIST-CLASS -$cfg->setConfigEntry('crawler_url_source_uploaded_list_class', 'CrawlerUploadedListUrlSource'); +$cfg->setConfigEntry('crawler_url_source_uploaded_list_class', 'Org\Shipsimu\Hub\Crawler\Source\Url\UploadList\CrawlerUploadedListUrlSource'); // CFG: CRAWLER-URL-SOURCE-RSS-START-CLASS -$cfg->setConfigEntry('crawler_url_source_rss_start_class', 'CrawlerRssStartUrlSource'); +$cfg->setConfigEntry('crawler_url_source_rss_start_class', 'Org\Shipsimu\Hub\Crawler\Source\RssStart\CrawlerRssStartUrlSource'); // CFG: CRAWLER-URL-SOURCE-FOUND-RSS-CLASS -$cfg->setConfigEntry('crawler_url_source_found_rss_class', 'CrawlerFoundRssUrlSource'); +$cfg->setConfigEntry('crawler_url_source_found_rss_class', 'Org\Shipsimu\Hub\Crawler\Source\FoundRss\CrawlerFoundRssUrlSource'); // CFG: CRAWLER-URL-STACKS $cfg->setConfigEntry('crawler_url_stacks', 'local_start:uploaded_list:rss_start:found_rss'); // CFG: CRAWLER-NODE-COMMUNICATOR-TASK-CLASS -$cfg->setConfigEntry('crawler_node_communicator_task_class', 'CrawlerNodeCommunicatorTask'); +$cfg->setConfigEntry('crawler_node_communicator_task_class', 'Org\Shipsimu\Hub\Crawler\Task\Communicator\Node\CrawlerNodeCommunicatorTask'); // CFG: CRAWLER-URL-LOCAL-START-STACK-CLASS $cfg->setConfigEntry('crawler_url_local_start_stack_class', 'Org\Mxchange\CoreFramework\Stack\Filesystem\FiFoFileStack'); @@ -1359,7 +1359,7 @@ $cfg->setConfigEntry('task_crawler_node_communicator_interval_delay', 250); $cfg->setConfigEntry('task_crawler_node_communicator_max_runs', 0); // CFG: CRAWLER-LOCAL-URL-CRAWLER-TASK-CLASS -$cfg->setConfigEntry('crawler_local_url_crawler_task_class', 'CrawlerLocalUrlCrawlerTask'); +$cfg->setConfigEntry('crawler_local_url_crawler_task_class', 'Org\Shipsimu\Hub\Crawler\Task\Crawler\LocalUrl\CrawlerLocalUrlCrawlerTask'); // CFG: TASK-CRAWLER-LOCAL-URL-CRAWLER-STARTUP-DELAY $cfg->setConfigEntry('task_crawler_local_url_crawler_startup_delay', 1500); @@ -1371,7 +1371,7 @@ $cfg->setConfigEntry('task_crawler_local_url_crawler_interval_delay', 200); $cfg->setConfigEntry('task_crawler_local_url_crawler_max_runs', 0); // CFG: CRAWLER-REMOTE-URL-CRAWLER-TASK-CLASS -$cfg->setConfigEntry('crawler_remote_url_crawler_task_class', 'CrawlerRemoteUrlCrawlerTask'); +$cfg->setConfigEntry('crawler_remote_url_crawler_task_class', 'Org\Shipsimu\Hub\Crawler\Task\Crawler\RemoteUrl\CrawlerRemoteUrlCrawlerTask'); // CFG: TASK-CRAWLER-REMOTE-URL-CRAWLER-STARTUP-DELAY $cfg->setConfigEntry('task_crawler_remote_url_crawler_startup_delay', 1500); @@ -1383,7 +1383,7 @@ $cfg->setConfigEntry('task_crawler_remote_url_crawler_interval_delay', 200); $cfg->setConfigEntry('task_crawler_remote_url_crawler_max_runs', 0); // CFG: CRAWLER-REMOTE-JOB-PUBLISHER-TASK-CLASS -$cfg->setConfigEntry('crawler_remote_job_publisher_task_class', 'CrawlerRemoteJobPublisherTask'); +$cfg->setConfigEntry('crawler_remote_job_publisher_task_class', 'Org\Shipsimu\Hub\Crawler\Task\Publisher\Job\Remote\CrawlerRemoteJobPublisherTask'); // CFG: TASK-CRAWLER-REMOTE-JOB-PUBLISHER-STARTUP-DELAY $cfg->setConfigEntry('task_crawler_remote_job_publisher_startup_delay', 2000); @@ -1395,7 +1395,7 @@ $cfg->setConfigEntry('task_crawler_remote_job_publisher_interval_delay', 200); $cfg->setConfigEntry('task_crawler_remote_job_publisher_max_runs', 0); // CFG: CRAWLER-MIME-SNIFFER-TASK-CLASS -$cfg->setConfigEntry('crawler_mime_sniffer_task_class', 'CrawlerMimeSnifferTask'); +$cfg->setConfigEntry('crawler_mime_sniffer_task_class', 'Org\Shipsimu\Hub\Crawler\Task\Sniffer\Mime\CrawlerMimeSnifferTask'); // CFG: TASK-CRAWLER-MIME-SNIFFER-STARTUP-DELAY $cfg->setConfigEntry('task_crawler_mime_sniffer_startup_delay', 1500); @@ -1407,7 +1407,7 @@ $cfg->setConfigEntry('task_crawler_mime_sniffer_interval_delay', 250); $cfg->setConfigEntry('task_crawler_mime_sniffer_max_runs', 0); // CFG: CRAWLER-DOCUMENT-PARSER-TASK-CLASS -$cfg->setConfigEntry('crawler_document_parser_task_class', 'CrawlerDocumentParserTask'); +$cfg->setConfigEntry('crawler_document_parser_task_class', 'Org\Shipsimu\Hub\Crawler\Task\Parser\Document\CrawlerDocumentParserTask'); // CFG: TASK-CRAWLER-DOCUMENT-PARSER-STARTUP-DELAY $cfg->setConfigEntry('task_crawler_document_parser_startup_delay', 1500); @@ -1419,7 +1419,7 @@ $cfg->setConfigEntry('task_crawler_document_parser_interval_delay', 250); $cfg->setConfigEntry('task_crawler_document_parser_max_runs', 0); // CFG: CRAWLER-STRUCTURE-ANALYZER-TASK-CLASS -$cfg->setConfigEntry('crawler_structure_analyzer_task_class', 'CrawlerStructureAnalyzerTask'); +$cfg->setConfigEntry('crawler_structure_analyzer_task_class', 'Org\Shipsimu\Hub\Crawler\Task\Analyzer\DocumentStructure\CrawlerStructureAnalyzerTask'); // CFG: TASK-CRAWLER-STRUCTURE-ANALYZER-STARTUP-DELAY $cfg->setConfigEntry('task_crawler_structure_analyzer_startup_delay', 1500); @@ -1431,7 +1431,7 @@ $cfg->setConfigEntry('task_crawler_structure_analyzer_interval_delay', 250); $cfg->setConfigEntry('task_crawler_structure_analyzer_max_runs', 0); // CFG: CRAWLER-SNIPPET-EXTRACTOR-TASK-CLASS -$cfg->setConfigEntry('crawler_snippet_extractor_task_class', 'CrawlerSnippetExtractorTask'); +$cfg->setConfigEntry('crawler_snippet_extractor_task_class', 'Org\Shipsimu\Hub\Crawler\Task\SnippetExtractor\CrawlerSnippetExtractorTask'); // CFG: TASK-CRAWLER-SNIPPET-EXTRACTOR-STARTUP-DELAY $cfg->setConfigEntry('task_crawler_snippet_extractor_startup_delay', 1500); @@ -1455,7 +1455,7 @@ $cfg->setConfigEntry('task_crawler_ping_interval_delay', 250); $cfg->setConfigEntry('task_crawler_ping_max_runs', 0); // CFG: CRAWLER-URL-SOURCE-LOCAL-START-TASK-CLASS -$cfg->setConfigEntry('crawler_url_source_local_start_task_class', 'CrawlerUrlSourceLocalStartTask'); +$cfg->setConfigEntry('crawler_url_source_local_start_task_class', 'Org\Shipsimu\Hub\Crawler\Task\Source\LocalStart\CrawlerUrlSourceLocalStartTask'); // CFG: TASK-CRAWLER-URL-SOURCE-LOCAL-START-STARTUP-DELAY $cfg->setConfigEntry('task_crawler_url_source_local_start_startup_delay', 3000); @@ -1467,7 +1467,7 @@ $cfg->setConfigEntry('task_crawler_url_source_local_start_interval_delay', 150); $cfg->setConfigEntry('task_crawler_url_source_local_start_max_runs', 0); // CFG: CRAWLER-URL-SOURCE-UPLOADED-LIST-TASK-CLASS -$cfg->setConfigEntry('crawler_url_source_uploaded_list_task_class', 'CrawlerUrlSourceUploadedListTask'); +$cfg->setConfigEntry('crawler_url_source_uploaded_list_task_class', 'Org\Shipsimu\Hub\Crawler\Task\Source\UploadedList\CrawlerUrlSourceUploadedListTask'); // CFG: TASK-CRAWLER-URL-SOURCE-UPLOADED-LIST-STARTUP-DELAY $cfg->setConfigEntry('task_crawler_url_source_uploaded_list_startup_delay', 3000); @@ -1479,7 +1479,7 @@ $cfg->setConfigEntry('task_crawler_url_source_uploaded_list_interval_delay', 150 $cfg->setConfigEntry('task_crawler_url_source_uploaded_list_max_runs', 0); // CFG: CRAWLER-URL-SOURCE-RSS-START-TASK-CLASS -$cfg->setConfigEntry('crawler_url_source_rss_start_task_class', 'CrawlerUrlSourceRssStartTask'); +$cfg->setConfigEntry('crawler_url_source_rss_start_task_class', 'Org\Shipsimu\Hub\Crawler\Task\Source\RssStart\CrawlerUrlSourceRssStartTask'); // CFG: TASK-CRAWLER-URL-SOURCE-RSS-START-STARTUP-DELAY $cfg->setConfigEntry('task_crawler_url_source_rss_start_startup_delay', 3000); @@ -1491,7 +1491,7 @@ $cfg->setConfigEntry('task_crawler_url_source_rss_start_interval_delay', 150); $cfg->setConfigEntry('task_crawler_url_source_rss_start_max_runs', 0); // CFG: CRAWLER-URL-SOURCE-FOUND-RSS-TASK-CLASS -$cfg->setConfigEntry('crawler_url_source_found_rss_task_class', 'CrawlerUrlSourceFoundRssTask'); +$cfg->setConfigEntry('crawler_url_source_found_rss_task_class', 'Org\Shipsimu\Hub\Crawler\Task\Source\FoundRss\CrawlerUrlSourceFoundRssTask'); // CFG: TASK-CRAWLER-URL-SOURCE-FOUND-RSS-STARTUP-DELAY $cfg->setConfigEntry('task_crawler_url_source_found_rss_startup_delay', 3000); @@ -1503,7 +1503,7 @@ $cfg->setConfigEntry('task_crawler_url_source_found_rss_interval_delay', 150); $cfg->setConfigEntry('task_crawler_url_source_found_rss_max_runs', 0); // CFG: CRAWLER-URL-SOURCE-FOUND-RSS-TASK-CLASS -$cfg->setConfigEntry('crawler_uploaded_list_scanner_task_class', 'CrawlerUploadedListScannerTask'); +$cfg->setConfigEntry('crawler_uploaded_list_scanner_task_class', 'Org\Shipsimu\Hub\Crawler\Task\Scanner\UploadedList\CrawlerUploadedListScannerTask'); // CFG: TASK-CRAWLER-URL-SOURCE-FOUND-RSS-STARTUP-DELAY $cfg->setConfigEntry('task_crawler_uploaded_list_scanner_startup_delay', 500);