From: Roland Häder Date: Mon, 26 Oct 2020 14:50:07 +0000 (+0100) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=65cbed8d808455a7c55cbaac759934d2791924fa;p=hub.git Continued: - introduced BaseHubTask for holding nodeInstance - added more noisy debug lines - some more rewrites (WIP!) Signed-off-by: Roland Häder --- diff --git a/application/hub/classes/commands/console/class_HubConsoleMainCommand.php b/application/hub/classes/commands/console/class_HubConsoleMainCommand.php index fbdd04ce9..6923cb7ea 100644 --- a/application/hub/classes/commands/console/class_HubConsoleMainCommand.php +++ b/application/hub/classes/commands/console/class_HubConsoleMainCommand.php @@ -88,6 +88,7 @@ class HubConsoleMainCommand extends BaseCommand implements Commandable { self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BOOTSTRAP: Bootstrap finished.'); // Get node instance + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('MAIN-COMMAND: Creating node instance ...'); $nodeInstance = NodeObjectFactory::createNodeInstance(); // Add some node-specific filters, e.g. announcement diff --git a/application/hub/classes/container/socket/class_SocketContainer.php b/application/hub/classes/container/socket/class_SocketContainer.php index bad9de069..bc3abcddd 100644 --- a/application/hub/classes/container/socket/class_SocketContainer.php +++ b/application/hub/classes/container/socket/class_SocketContainer.php @@ -88,6 +88,26 @@ class SocketContainer extends BaseHubContainer implements StorableSocket, Visita */ private $socketType; + /** + * Peer address + */ + private $peerAddress; + + /** + * Peer port + */ + private $peerPort; + + /** + * Sender address + */ + private $senderAddress; + + /** + * Sender port + */ + private $senderPort; + /** * Protected constructor * @@ -1531,7 +1551,7 @@ class SocketContainer extends BaseHubContainer implements StorableSocket, Visita /** * Getter for socket type * - * @return $socketType Stocket type + * @return $socketType Socket type */ public function getSocketType () { return $this->socketType; @@ -1547,4 +1567,80 @@ class SocketContainer extends BaseHubContainer implements StorableSocket, Visita $this->socketType = $socketType; } + /** + * Getter for peer address + * + * @return $peerAddress Peer address + */ + public function getPeerAddress () { + return $this->peerAddress; + } + + /** + * Setter for peer address + * + * @param $peerAddress Peer address + * @return void + */ + public function setPeerAddress ($peerAddress) { + $this->peerAddress = $peerAddress; + } + + /** + * Getter for peer port + * + * @return $peerPort Peer port + */ + public function getPeerPort () { + return $this->peerPort; + } + + /** + * Setter for peer port + * + * @param $peerPort Peer port + * @return void + */ + public function setPeerPort ($peerPort) { + $this->peerPort = $peerPort; + } + + /** + * Getter for sender address + * + * @return $senderAddress Sender address + */ + public function getSenderAddress () { + return $this->senderAddress; + } + + /** + * Setter for sender address + * + * @param $senderAddress Sender address + * @return void + */ + public function setSenderAddress ($senderAddress) { + $this->senderAddress = $senderAddress; + } + + /** + * Getter for sender port + * + * @return $senderPort Sender port + */ + public function getSenderPort () { + return $this->senderPort; + } + + /** + * Setter for sender port + * + * @param $senderPort Sender port + * @return void + */ + public function setSenderPort ($senderPort) { + $this->senderPort = $senderPort; + } + } diff --git a/application/hub/classes/database/frontend/class_BaseHubDatabaseWrapper.php b/application/hub/classes/database/frontend/class_BaseHubDatabaseWrapper.php index f776e8091..bad6fb596 100644 --- a/application/hub/classes/database/frontend/class_BaseHubDatabaseWrapper.php +++ b/application/hub/classes/database/frontend/class_BaseHubDatabaseWrapper.php @@ -8,6 +8,7 @@ use Org\Shipsimu\Hub\Handler\Network\RawData\HandleableRawData; use Org\Shipsimu\Hub\Generic\HubInterface; use Org\Shipsimu\Hub\Information\ShareableInfo; use Org\Shipsimu\Hub\Locator\Node\LocateableNode; +use Org\Shipsimu\Hub\Node\Node; use Org\Shipsimu\Hub\Pool\Poolable; // Import framework stuff @@ -62,6 +63,11 @@ abstract class BaseHubDatabaseWrapper extends BaseDatabaseWrapper implements Hub */ private $universalNodeLocatorInstance = NULL; + /** + * Node instance + */ + private $nodeInstance = NULL; + /** * Protected constructor * @@ -253,4 +259,23 @@ abstract class BaseHubDatabaseWrapper extends BaseDatabaseWrapper implements Hub return $this->listenerInstance; } + /** + * Setter for node instance + * + * @param $nodeInstance A Node instance + * @return void + */ + public final function setNodeInstance (Node $nodeInstance) { + $this->nodeInstance = $nodeInstance; + } + + /** + * Getter for node instance + * + * @return $nodeInstance A Node instance + */ + public function getNodeInstance () { + return $this->nodeInstance; + } + } diff --git a/application/hub/classes/database/frontend/node/class_NodeDistributedHashTableDatabaseWrapper.php b/application/hub/classes/database/frontend/node/class_NodeDistributedHashTableDatabaseWrapper.php index ba1a180d7..cc07f0bc5 100644 --- a/application/hub/classes/database/frontend/node/class_NodeDistributedHashTableDatabaseWrapper.php +++ b/application/hub/classes/database/frontend/node/class_NodeDistributedHashTableDatabaseWrapper.php @@ -89,6 +89,13 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseHubDatabaseWrapper imp // Set (primary!) table name $wrapperInstance->setTableName(self::DB_TABLE_NODE_DHT); + // Get node instance + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-WRAPPER: Creating node instance ...'); + $nodeInstance = NodeObjectFactory::createNodeInstance(); + + // And set it here + $wrapperInstance->setNodeInstance($nodeInstance); + // Return the instance return $wrapperInstance; } @@ -157,8 +164,7 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseHubDatabaseWrapper imp // Debug message /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-WRAPPER: CALLED!'); - // Get node/request instances - $nodeInstance = NodeObjectFactory::createNodeInstance(); + // Get request instances $requestInstance = FrameworkBootstrap::getRequestInstance(); // Get a dataset instance @@ -168,7 +174,7 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseHubDatabaseWrapper imp $dataSetInstance->setUniqueKey(self::DB_COLUMN_NODE_ID); // Get Universal Node Locator and "explode" it - $unlInstance = $nodeInstance->determineUniversalNodeLocator(); + $unlInstance = $this->getNodeInstance()->determineUniversalNodeLocator(); // Get external UNL $externalUnl = $unlInstance->getExternalUnl(); @@ -179,7 +185,7 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseHubDatabaseWrapper imp assert($externalUnl !== 'invalid'); // Get an array of all accepted object types - $objectList = $nodeInstance->getListFromAcceptedObjectTypes(); + $objectList = $this->getNodeInstance()->getListFromAcceptedObjectTypes(); // Make sure this is an array /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-WRAPPER: objectList()=' . count($objectList)); @@ -188,13 +194,13 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseHubDatabaseWrapper imp // Add public node data $dataSetInstance->addCriteria(self::DB_COLUMN_NODE_MODE , $requestInstance->getRequestElement('mode')); $dataSetInstance->addCriteria(self::DB_COLUMN_EXTERNAL_ADDRESS, $externalUnl); - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-WRAPPER: nodeInstance->nodeId=' . $nodeInstance->getNodeId()); - $dataSetInstance->addCriteria(self::DB_COLUMN_NODE_ID , $nodeInstance->getNodeId()); - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-WRAPPER: nodeInstance->sessionId=' . $nodeInstance->getSessionId()); - $dataSetInstance->addCriteria(self::DB_COLUMN_SESSION_ID , $nodeInstance->getSessionId()); - $dataSetInstance->addCriteria(self::DB_COLUMN_PRIVATE_KEY_HASH, $nodeInstance->getNodePrivateKeyHash()); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-WRAPPER: nodeInstance->nodeId=' . $this->getNodeInstance()->getNodeId()); + $dataSetInstance->addCriteria(self::DB_COLUMN_NODE_ID , $this->getNodeInstance()->getNodeId()); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-WRAPPER: nodeInstance->sessionId=' . $this->getNodeInstance()->getSessionId()); + $dataSetInstance->addCriteria(self::DB_COLUMN_SESSION_ID , $this->getNodeInstance()->getSessionId()); + $dataSetInstance->addCriteria(self::DB_COLUMN_PRIVATE_KEY_HASH, $this->getNodeInstance()->getNodePrivateKeyHash()); $dataSetInstance->addCriteria(self::DB_COLUMN_ACCEPTED_OBJECTS, implode(BaseHubNode::OBJECT_LIST_SEPARATOR, $objectList)); - $dataSetInstance->addCriteria(self::DB_COLUMN_ACCEPT_BOOTSTRAP, $this->translateBooleanToYesNo($nodeInstance->isAcceptingDhtBootstrap())); + $dataSetInstance->addCriteria(self::DB_COLUMN_ACCEPT_BOOTSTRAP, $this->translateBooleanToYesNo($this->getNodeInstance()->isAcceptingDhtBootstrap())); // Return it /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-WRAPPER: dataSetInstance=' . $dataSetInstance->__toString() . ' - EXIT!'); @@ -212,11 +218,8 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseHubDatabaseWrapper imp /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-WRAPPER: CALLED!'); $searchInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class'); - // Get node instance - $nodeInstance = NodeObjectFactory::createNodeInstance(); - // Get Universal Node Locator and "explode" it - $unlInstance = $nodeInstance->determineUniversalNodeLocator(); + $unlInstance = $this->getNodeInstance()->determineUniversalNodeLocator(); // Make sure the external address is set and not invalid // @TODO Bad check on UNL, better use a proper validator @@ -226,8 +229,8 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseHubDatabaseWrapper imp // Add Universal Node Locator/node id as criteria $searchInstance->addCriteria(self::DB_COLUMN_EXTERNAL_ADDRESS, $externalUnl); - $searchInstance->addCriteria(self::DB_COLUMN_NODE_ID , $nodeInstance->getNodeId()); - $searchInstance->addCriteria(self::DB_COLUMN_SESSION_ID , $nodeInstance->getSessionId()); + $searchInstance->addCriteria(self::DB_COLUMN_NODE_ID , $this->getNodeInstance()->getNodeId()); + $searchInstance->addCriteria(self::DB_COLUMN_SESSION_ID , $this->getNodeInstance()->getSessionId()); $searchInstance->setLimit(1); // Query database and get a result instance back @@ -277,14 +280,11 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseHubDatabaseWrapper imp // Assert to make sure this method is called with one record in DB (the actual backend of the DHT) assert($this->isLocalNodeRegistered()); - // Get node instance - $nodeInstance = NodeObjectFactory::createNodeInstance(); - // Get search criteria $searchInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class'); // Search for node id and limit it to one entry - $searchInstance->addCriteria(self::DB_COLUMN_NODE_ID, $nodeInstance->getNodeId()); + $searchInstance->addCriteria(self::DB_COLUMN_NODE_ID, $this->getNodeInstance()->getNodeId()); $searchInstance->setLimit(1); // Get a prepared dataset instance @@ -466,6 +466,7 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseHubDatabaseWrapper imp */ public function updateNode (array $nodeData) { // Debug message + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-WRAPPER: nodeData=' . print_r($nodeData, TRUE)); //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-WRAPPER: CALLED!'); // Assert on array elements @@ -492,14 +493,8 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseHubDatabaseWrapper imp // Set primary key (session id) $dataSetInstance->setUniqueKey(self::DB_COLUMN_SESSION_ID); - // Get node instance - $nodeInstance = NodeObjectFactory::createNodeInstance(); - - // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-WRAPPER: nodeData=' . print_r($nodeData, TRUE)); - // Add all array elements - $nodeInstance->addArrayToDataSet($dataSetInstance, $nodeData); + $this->getNodeInstance()->addArrayToDataSet($dataSetInstance, $nodeData); // Remove 'node_list' $dataSetInstance->unsetCriteria(self::DB_COLUMN_NODE_LIST); diff --git a/application/hub/classes/discovery/recipient/socket/class_PackageSocketDiscovery.php b/application/hub/classes/discovery/recipient/socket/class_PackageSocketDiscovery.php index 7881fa9a6..3416d4da4 100644 --- a/application/hub/classes/discovery/recipient/socket/class_PackageSocketDiscovery.php +++ b/application/hub/classes/discovery/recipient/socket/class_PackageSocketDiscovery.php @@ -88,6 +88,7 @@ class PackageSocketDiscovery extends BaseRecipientDiscovery implements Discovera * Get the listener pool instance, we need to lookup the matching * listener->poolInstance chain there. */ + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PACKAGE-SOCKET-DISCOVERY: Creating node instance ...'); $poolInstance = NodeObjectFactory::createNodeInstance()->getListenerPoolInstance(); // Init listener instance diff --git a/application/hub/classes/factories/node/class_NodeObjectFactory.php b/application/hub/classes/factories/node/class_NodeObjectFactory.php index 3b9529acf..a08b7d21b 100644 --- a/application/hub/classes/factories/node/class_NodeObjectFactory.php +++ b/application/hub/classes/factories/node/class_NodeObjectFactory.php @@ -51,26 +51,26 @@ class NodeObjectFactory extends ObjectFactory { */ public static final function createNodeInstance (Requestable $requestInstance = NULL, Responseable $responseInstance = NULL) { // Get new factory instance - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NODE-FACTORY: requestInstance[]=%s,responseInstance[]=%s - CALLED!', gettype($requestInstance), gettype($responseInstance))); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NODE-FACTORY: requestInstance[]=%s,responseInstance[]=%s - CALLED!', gettype($requestInstance), gettype($responseInstance))); $factoryInstance = new NodeObjectFactory(); // If there is no handler? if (GenericRegistry::getRegistry()->instanceExists('node')) { // Get handler from registry - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE-FACTORY: Getting node instance from registry ...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE-FACTORY: Getting node instance from registry ...'); $nodeInstance = GenericRegistry::getRegistry()->getInstance('node'); } elseif (($requestInstance instanceof Requestable) && ($responseInstance instanceof Responseable)) { // The default node-mode is from our configuration - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE-FACTORY: requestInstance and responseInstance are both set.'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE-FACTORY: requestInstance and responseInstance are both set.'); $nodeMode = $factoryInstance->getConfigInstance()->getConfigEntry('node_default_mode'); // Is the node 'mode' parameter set? - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NODE-FACTORY: nodeMode=%s - from CONFIG', $nodeMode)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NODE-FACTORY: nodeMode=%s - from CONFIG', $nodeMode)); if ($requestInstance->isRequestElementSet('mode')) { // Then use this which overrides the config entry temporarily $nodeMode = $requestInstance->getRequestElement('mode'); - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NODE-FACTORY: nodeMode=%s - from REQUEST', $nodeMode)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NODE-FACTORY: nodeMode=%s - from REQUEST', $nodeMode)); } else { // Set it for easier re-usage $requestInstance->setRequestElement('mode', $nodeMode); @@ -84,18 +84,18 @@ class NodeObjectFactory extends ObjectFactory { ); // Get the node instance - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NODE-FACTORY: Loading class with className=%s ...', $className)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NODE-FACTORY: Loading class with className=%s ...', $className)); $nodeInstance = ObjectFactory::createObjectByName($className); // Get a registry $applicationInstance = GenericRegistry::getRegistry()->getInstance('application'); // Add node-specific filters - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NODE-FACTORY: Registering node-specific filters, responseInstance[]=%s', gettype($responseInstance))); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NODE-FACTORY: Registering node-specific filters, responseInstance[]=%s', gettype($responseInstance))); $nodeInstance->addExtraFilters($applicationInstance->getControllerInstance(), $responseInstance); // Add it to the registry - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NODE-FACTORY: Adding nodeInstance=%s to registry ...', $nodeInstance->__toString())); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NODE-FACTORY: Adding nodeInstance=%s to registry ...', $nodeInstance->__toString())); GenericRegistry::getRegistry()->addInstance('node', $nodeInstance); } else { // Throw an exception here @@ -103,7 +103,7 @@ class NodeObjectFactory extends ObjectFactory { } // Return the instance - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NODE-FACTORY: nodeInstance=%s - EXIT!', $nodeInstance->__toString())); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NODE-FACTORY: nodeInstance=%s - EXIT!', $nodeInstance->__toString())); return $nodeInstance; } diff --git a/application/hub/classes/factories/states/node/class_NodeStateFactory.php b/application/hub/classes/factories/states/node/class_NodeStateFactory.php index a68111368..2086cf0a4 100644 --- a/application/hub/classes/factories/states/node/class_NodeStateFactory.php +++ b/application/hub/classes/factories/states/node/class_NodeStateFactory.php @@ -57,6 +57,7 @@ class NodeStateFactory extends ObjectFactory { // Is the node instance set? if (is_null($nodeInstance)) { // Get node instance from registry + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NOTE-STATE-FACTORY: Creating node instance ...'); $nodeInstance = NodeObjectFactory::createNodeInstance(); } // END - if diff --git a/application/hub/classes/filter/task/node/class_NodeTaskHandlerInitializerFilter.php b/application/hub/classes/filter/task/node/class_NodeTaskHandlerInitializerFilter.php index 058b02818..dd980171d 100644 --- a/application/hub/classes/filter/task/node/class_NodeTaskHandlerInitializerFilter.php +++ b/application/hub/classes/filter/task/node/class_NodeTaskHandlerInitializerFilter.php @@ -70,6 +70,7 @@ class NodeTaskHandlerInitializerFilter extends BaseNodeFilter implements Filtera */ public function execute (Requestable $requestInstance, Responseable $responseInstance) { // Get node instance + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE-TASK-HANDLER-INIT-FILTER: Creating node instance ...'); $nodeInstance = NodeObjectFactory::createNodeInstance(); // Get a new task handler instance diff --git a/application/hub/classes/handler/data/answer-status/announcement/class_NodeAnnouncementAnswerOkayHandler.php b/application/hub/classes/handler/data/answer-status/announcement/class_NodeAnnouncementAnswerOkayHandler.php index 8b0e0ba9d..fb926640e 100644 --- a/application/hub/classes/handler/data/answer-status/announcement/class_NodeAnnouncementAnswerOkayHandler.php +++ b/application/hub/classes/handler/data/answer-status/announcement/class_NodeAnnouncementAnswerOkayHandler.php @@ -95,6 +95,7 @@ class NodeAnnouncementAnswerOkayHandler extends BaseAnswerStatusHandler implemen $handlerInstance->registerTask('dht_late_bootstrap', $taskInstance); // Get the node instance + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE-MESSAGE-HANDLER: Creating node instance ...'); $nodeInstance = NodeObjectFactory::createNodeInstance(); // Change state @@ -124,6 +125,7 @@ class NodeAnnouncementAnswerOkayHandler extends BaseAnswerStatusHandler implemen */ protected function initMessageConfigurationData (array $messageData) { // Get node instance + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE-MESSAGE-HANDLER: Creating node instance ...'); $nodeInstance = NodeObjectFactory::createNodeInstance(); // Get an array of all accepted object types diff --git a/application/hub/classes/handler/data/class_BaseDataHandler.php b/application/hub/classes/handler/data/class_BaseDataHandler.php index df149e5fc..380c9439e 100644 --- a/application/hub/classes/handler/data/class_BaseDataHandler.php +++ b/application/hub/classes/handler/data/class_BaseDataHandler.php @@ -109,12 +109,13 @@ abstract class BaseDataHandler extends BaseHubHandler implements HubInterface { */ protected function prepareAnswerMessage (array $messageData, Deliverable $packageInstance) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATA-HANDLER:Going to send an answer message for ' . $this->getHandlerName() . ' ...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-DATA-HANDLER:Going to send an answer message for ' . $this->getHandlerName() . ' ...'); // Get a helper instance based on this handler's name $helperInstance = ObjectFactory::createObjectByConfiguredName('node_answer_' . $this->getHandlerName() . '_helper_class', array($messageData)); // Get node instance + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-DATA-HANDLER: Creating node instance ...'); $nodeInstance = NodeObjectFactory::createNodeInstance(); // Load descriptor XML @@ -130,7 +131,7 @@ abstract class BaseDataHandler extends BaseHubHandler implements HubInterface { $helperInstance->getTemplateInstance()->compileConfigInVariables(); // Deliver the package - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NODE-DHT-FACADE: Calling helperInstance->sendPackage(%s) ...', $nodeInstance->__toString())); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-DATA-HANDLER: Calling helperInstance->sendPackage(%s) ...', $nodeInstance->__toString())); $helperInstance->sendPackage($nodeInstance); /* @@ -139,7 +140,7 @@ abstract class BaseDataHandler extends BaseHubHandler implements HubInterface { $this->removeMessageConfigurationData($messageData); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATA-HANDLER:Answer message has been prepared.'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-DATA-HANDLER:Answer message has been prepared.'); } /** @@ -151,7 +152,7 @@ abstract class BaseDataHandler extends BaseHubHandler implements HubInterface { */ protected function prepareNextMessage (array $messageData, Deliverable $packageInstance) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATA-HANDLER:Going to send next message ...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-DATA-HANDLER:Going to send next message ...'); // Get a helper instance based on this handler's name $helperInstance = ObjectFactory::createObjectByConfiguredName('node_next_' . $this->getHandlerName() . '_helper_class', array($messageData)); @@ -181,7 +182,7 @@ abstract class BaseDataHandler extends BaseHubHandler implements HubInterface { $this->removeMessageConfigurationData($messageData); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATA-HANDLER:Next message has been prepared.'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-DATA-HANDLER:Next message has been prepared.'); } /** diff --git a/application/hub/classes/handler/data/message-types/announcement/class_NodeMessageAnnouncementHandler.php b/application/hub/classes/handler/data/message-types/announcement/class_NodeMessageAnnouncementHandler.php index 4f87b3911..b24545478 100644 --- a/application/hub/classes/handler/data/message-types/announcement/class_NodeMessageAnnouncementHandler.php +++ b/application/hub/classes/handler/data/message-types/announcement/class_NodeMessageAnnouncementHandler.php @@ -109,6 +109,7 @@ class NodeMessageAnnouncementHandler extends BaseMessageHandler implements Handl */ public function handleMessageData (array $messageData, Receivable $packageInstance) { // Get node instance + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE-MESSAGE-HANDLER: Creating node instance ...'); $nodeInstance = NodeObjectFactory::createNodeInstance(); // Is this node accepting announcements? diff --git a/application/hub/classes/handler/data/message-types/answer/class_NodeMessageAnnouncementAnswerHandler.php b/application/hub/classes/handler/data/message-types/answer/class_NodeMessageAnnouncementAnswerHandler.php index 0ce455121..272f70a08 100644 --- a/application/hub/classes/handler/data/message-types/answer/class_NodeMessageAnnouncementAnswerHandler.php +++ b/application/hub/classes/handler/data/message-types/answer/class_NodeMessageAnnouncementAnswerHandler.php @@ -111,6 +111,7 @@ class NodeMessageAnnouncementAnswerHandler extends BaseMessageHandler implements */ public function handleMessageData (array $messageData, Receivable $packageInstance) { // Get node instance + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE-MESSAGE-HANDLER: Creating node instance ...'); $nodeInstance = NodeObjectFactory::createNodeInstance(); // Has this node attempted to announce itself? diff --git a/application/hub/classes/handler/data/message-types/answer/class_NodeMessageRequestNodeListAnswerHandler.php b/application/hub/classes/handler/data/message-types/answer/class_NodeMessageRequestNodeListAnswerHandler.php index 4d28c0ef3..bf552b046 100644 --- a/application/hub/classes/handler/data/message-types/answer/class_NodeMessageRequestNodeListAnswerHandler.php +++ b/application/hub/classes/handler/data/message-types/answer/class_NodeMessageRequestNodeListAnswerHandler.php @@ -94,6 +94,7 @@ class NodeMessageRequestNodeListAnswerHandler extends BaseMessageHandler impleme */ public function handleMessageData (array $messageData, Receivable $packageInstance) { // Get node instance + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE-MESSAGE-HANDLER: Creating node instance ...'); $nodeInstance = NodeObjectFactory::createNodeInstance(); // Has this node attempted to announce itself? diff --git a/application/hub/classes/handler/data/message-types/dht/class_NodeMessageDhtBootstrapHandler.php b/application/hub/classes/handler/data/message-types/dht/class_NodeMessageDhtBootstrapHandler.php index 2d526408e..266699eed 100644 --- a/application/hub/classes/handler/data/message-types/dht/class_NodeMessageDhtBootstrapHandler.php +++ b/application/hub/classes/handler/data/message-types/dht/class_NodeMessageDhtBootstrapHandler.php @@ -104,6 +104,7 @@ class NodeMessageDhtBootstrapHandler extends BaseMessageHandler implements Handl */ public function handleMessageData (array $messageData, Receivable $packageInstance) { // Is this node accepting DHT bootstrap requests? + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE-MESSAGE-HANDLER: Creating node instance ...'); if (!NodeObjectFactory::createNodeInstance()->isAcceptingDhtBootstrap()) { /* * This node is not accepting DHT bootstrap requests. diff --git a/application/hub/classes/handler/data/message-types/requests/class_NodeMessageRequestNodeListHandler.php b/application/hub/classes/handler/data/message-types/requests/class_NodeMessageRequestNodeListHandler.php index e97821aab..c01178a7d 100644 --- a/application/hub/classes/handler/data/message-types/requests/class_NodeMessageRequestNodeListHandler.php +++ b/application/hub/classes/handler/data/message-types/requests/class_NodeMessageRequestNodeListHandler.php @@ -89,6 +89,7 @@ class NodeMessageRequestNodeListHandler extends BaseMessageHandler implements Ha */ public function handleMessageData (array $messageData, Receivable $packageInstance) { // Get node instance + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE-MESSAGE-HANDLER: Creating node instance ...'); $nodeInstance = NodeObjectFactory::createNodeInstance(); // Is this node accepting announcements? diff --git a/application/hub/classes/handler/data/message-types/self-connect/class_NodeMessageSelfConnectHandler.php b/application/hub/classes/handler/data/message-types/self-connect/class_NodeMessageSelfConnectHandler.php index ae784ba9b..adcd2b4c4 100644 --- a/application/hub/classes/handler/data/message-types/self-connect/class_NodeMessageSelfConnectHandler.php +++ b/application/hub/classes/handler/data/message-types/self-connect/class_NodeMessageSelfConnectHandler.php @@ -72,6 +72,7 @@ class NodeMessageSelfConnectHandler extends BaseMessageHandler implements Handle */ public function handleMessageData (array $messageData, Receivable $packageInstance) { // Get node instance + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE-MESSAGE-HANDLER: Creating node instance ...'); $nodeInstance = NodeObjectFactory::createNodeInstance(); // Are node id and session id the same? diff --git a/application/hub/classes/handler/package/class_NetworkPackageHandler.php b/application/hub/classes/handler/package/class_NetworkPackageHandler.php index ad5726a22..e7cf86680 100644 --- a/application/hub/classes/handler/package/class_NetworkPackageHandler.php +++ b/application/hub/classes/handler/package/class_NetworkPackageHandler.php @@ -355,6 +355,7 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei $packageInstance->setAssemblerInstance($assemblerInstance); // Get node instance + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: Creating node instance ...'); $nodeInstance = NodeObjectFactory::createNodeInstance(); // Set it locally @@ -1193,7 +1194,7 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei * Get the decoded data from the handler, this is an array with * 'raw_data' and 'error_code' as elements. */ - $packageInstance = $handlerInstance->getNextRawData(); + $packageInstance = $handlerInstance->getNextPackageInstance(); // Very noisy debug message: //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: decodedData[' . gettype($packageInstance) . ']=' . print_r($packageInstance, TRUE)); diff --git a/application/hub/classes/handler/raw_data/class_BaseRawDataHandler.php b/application/hub/classes/handler/raw_data/class_BaseRawDataHandler.php index f3422631f..ed557f1eb 100644 --- a/application/hub/classes/handler/raw_data/class_BaseRawDataHandler.php +++ b/application/hub/classes/handler/raw_data/class_BaseRawDataHandler.php @@ -70,13 +70,13 @@ abstract class BaseRawDataHandler extends BaseHubHandler implements HandleableRa */ protected function initStack () { // Trace message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('RAW-DATA-HANDLER: CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-RAW-DATA-HANDLER: CALLED!'); // Init stack(s) $this->getStackInstance()->initStack(self::STACKER_NAME_RAW_DATA); // Trace message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('RAW-DATA-HANDLER: EXIT!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-RAW-DATA-HANDLER: EXIT!'); } /** @@ -87,19 +87,23 @@ abstract class BaseRawDataHandler extends BaseHubHandler implements HandleableRa */ protected function addRawDataToStacker ($rawData) { // Trace message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('RAW-DATA-HANDLER: rawData(%d)=%s - CALLED!', strlen($rawData), $rawData)); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-RAW-DATA-HANDLER: rawData(%d)=%s - CALLED!', strlen($rawData), $rawData)); + + // Get package data instance + $packageInstance = ObjectFactory::createObjectByConfiguredName('package_data_class'); + + // Set all data + $packageInstance->setRawData($rawData); + $packageInstance->setErrorCode($this->getErrorCode()); /* * Add the deocoded data and error code to the stacker so other classes * (e.g. NetworkPackage) can "pop" it from the stacker. */ - $this->getStackInstance()->pushNamed(self::STACKER_NAME_RAW_DATA, array( - HandleableRawData::PACKAGE_RAW_DATA => $rawData, - HandleableRawData::PACKAGE_ERROR_CODE => $this->getErrorCode() - )); + $this->getStackInstance()->pushNamed(self::STACKER_NAME_RAW_DATA, $packageInstance); // Trace message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('RAW-DATA-HANDLER: EXIT!'); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-RAW-DATA-HANDLER: EXIT!'); } /** @@ -109,13 +113,13 @@ abstract class BaseRawDataHandler extends BaseHubHandler implements HandleableRa */ public function isRawDataPending () { // Trace message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('RAW-DATA-HANDLER: CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-RAW-DATA-HANDLER: CALLED!'); // Does the stacker have some entries (not empty)? $isPending = (!$this->getStackInstance()->isStackEmpty(self::STACKER_NAME_RAW_DATA)); // Trace message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('RAW-DATA-HANDLER: isPending=%d - EXIT!', intval($isPending))); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-RAW-DATA-HANDLER: isPending=%d - EXIT!', intval($isPending))); // Return it return $isPending; @@ -124,14 +128,14 @@ abstract class BaseRawDataHandler extends BaseHubHandler implements HandleableRa /** * "Getter" for next raw data from the stacker * - * @return $rawData Raw data from the stacker + * @return $packageInstance An instance of a DeliverablePackage class */ - public function getNextRawData () { + public function getNextPackageInstance () { // "Pop" the raw data from the stacker - $rawData = $this->getStackInstance()->popNamed(self::STACKER_NAME_RAW_DATA); + $packageInstance = $this->getStackInstance()->popNamed(self::STACKER_NAME_RAW_DATA); // And return it - return $rawData; + return $packageInstance; } /** @@ -144,16 +148,17 @@ abstract class BaseRawDataHandler extends BaseHubHandler implements HandleableRa */ protected function ifRecipientMatchesOwnUniversalNodeLocator (DeliverablePackage $packageInstance) { // Trace message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('RAW-DATA-HANDLER: packageInstance=%s - CALLED!', $packageInstance->__toString())); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-RAW-DATA-HANDLER: packageInstance=%s - CALLED!', $packageInstance->__toString())); // Construct own address first + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-RAW-DATA-HANDLER: Creating node instance ...'); $ownAddress = NodeObjectFactory::createNodeInstance()->determineUniversalNodeLocator(); // Does it match? $matches = ($ownAddress === $packageInstance->getRecipientUnl()); // Trace message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('RAW-DATA-HANDLER: matches=%d - EXIT!', intval($matches))); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-RAW-DATA-HANDLER: matches=%d - EXIT!', intval($matches))); // Return result return $matches; diff --git a/application/hub/classes/listener/class_BaseListener.php b/application/hub/classes/listener/class_BaseListener.php index 2adc9de93..5205df308 100644 --- a/application/hub/classes/listener/class_BaseListener.php +++ b/application/hub/classes/listener/class_BaseListener.php @@ -382,6 +382,7 @@ abstract class BaseListener extends BaseHubSystem implements Visitable { } // END - if // Get node instance + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: Creating node instance ...', strtoupper($this->getProtocolName()))); $nodeInstance = NodeObjectFactory::createNodeInstance(); // Get a connection info instance diff --git a/application/hub/classes/states/dht/booting/class_DhtBootingState.php b/application/hub/classes/states/dht/booting/class_DhtBootingState.php index a5bf58ccc..9152c0244 100644 --- a/application/hub/classes/states/dht/booting/class_DhtBootingState.php +++ b/application/hub/classes/states/dht/booting/class_DhtBootingState.php @@ -56,11 +56,10 @@ class DhtBootingState extends BaseDhtState implements Stateable { public final static function createDhtBootingState (Distributable $dhtInstance) { // Get new instance $stateInstance = new DhtBootingState(); - - // Debug message /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-STATE: Has changed from ' . $dhtInstance->getPrintableState() . ' to ' . $stateInstance->getStateName() . '.'); // Get node instance and enable DHT bootstrap requests + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-BOOTING-STATE: Creating node instance ...'); NodeObjectFactory::createNodeInstance()->enableAcceptDhtBootstrap(); // Update DHT node info as well diff --git a/application/hub/classes/states/node/active/class_NodeActiveState.php b/application/hub/classes/states/node/active/class_NodeActiveState.php index a846d9b70..bc4a87abc 100644 --- a/application/hub/classes/states/node/active/class_NodeActiveState.php +++ b/application/hub/classes/states/node/active/class_NodeActiveState.php @@ -55,6 +55,7 @@ class NodeActiveState extends BaseNodeState implements Stateable { $stateInstance = new NodeActiveState(); // Get node instance and set 'active' flag + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE-ACTIVE-STATE: Creating node instance ...'); NodeObjectFactory::createNodeInstance()->enableIsActive(); // Return the prepared instance diff --git a/application/hub/classes/tasks/apt-proxy/class_AptProxyListenerTask.php b/application/hub/classes/tasks/apt-proxy/class_AptProxyListenerTask.php index 355077ad1..554fa2e6a 100644 --- a/application/hub/classes/tasks/apt-proxy/class_AptProxyListenerTask.php +++ b/application/hub/classes/tasks/apt-proxy/class_AptProxyListenerTask.php @@ -2,6 +2,9 @@ // Own namespace namespace Org\Shipsimu\Hub\AptProxy\Task\Listener; +// Import application-specific stuff +use Org\Shipsimu\Hub\Task\BaseHubTask; + // Import framework stuff use Org\Mxchange\CoreFramework\Task\BaseTask; use Org\Mxchange\CoreFramework\Task\Taskable; @@ -30,7 +33,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor; * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class AptProxyListenerTask extends BaseTask implements Taskable, Visitable { +class AptProxyListenerTask extends BaseHubTask implements Taskable, Visitable { /** * Protected constructor * diff --git a/application/hub/classes/tasks/chat/class_ChatTelnetListenerTask.php b/application/hub/classes/tasks/chat/class_ChatTelnetListenerTask.php index a64fb0cf3..64a9f1108 100644 --- a/application/hub/classes/tasks/chat/class_ChatTelnetListenerTask.php +++ b/application/hub/classes/tasks/chat/class_ChatTelnetListenerTask.php @@ -2,6 +2,9 @@ // Own namespace namespace Org\Shipsimu\Hub\Chat\Task\Listener\Telnet; +// Import application-specific stuff +use Org\Shipsimu\Hub\Task\BaseHubTask; + // Import framework stuff use Org\Mxchange\CoreFramework\Task\BaseTask; use Org\Mxchange\CoreFramework\Task\Taskable; @@ -30,7 +33,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor; * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class ChatTelnetListenerTask extends BaseTask implements Taskable, Visitable { +class ChatTelnetListenerTask extends BaseHubTask implements Taskable, Visitable { /** * Protected constructor * diff --git a/application/hub/classes/tasks/crawler/class_BaseUrlSourceTask.php b/application/hub/classes/tasks/crawler/class_BaseUrlSourceTask.php index f5a9dd18d..6e9731104 100644 --- a/application/hub/classes/tasks/crawler/class_BaseUrlSourceTask.php +++ b/application/hub/classes/tasks/crawler/class_BaseUrlSourceTask.php @@ -5,6 +5,7 @@ namespace Org\Shipsimu\Hub\Crawler\Task\Source\Url; // Import application-specific stuff use Org\Shipsimu\Hub\Crawler\Source\Url\UrlSource; use Org\Shipsimu\Hub\Crawler\Source\Url\UrlSourceObjectFactory; +use Org\Shipsimu\Hub\Task\BaseHubTask; // Import framework stuff use Org\Mxchange\CoreFramework\Task\BaseTask; @@ -31,7 +32,7 @@ use Org\Mxchange\CoreFramework\Task\BaseTask; * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -abstract class BaseUrlSourceTask extends BaseTask { +abstract class BaseUrlSourceTask extends BaseHubTask { /** * An instance of a UrlSource class diff --git a/application/hub/classes/tasks/crawler/communicator/class_CrawlerNodeCommunicatorTask.php b/application/hub/classes/tasks/crawler/communicator/class_CrawlerNodeCommunicatorTask.php index a64a03054..c73a639d3 100644 --- a/application/hub/classes/tasks/crawler/communicator/class_CrawlerNodeCommunicatorTask.php +++ b/application/hub/classes/tasks/crawler/communicator/class_CrawlerNodeCommunicatorTask.php @@ -4,6 +4,7 @@ namespace Org\Shipsimu\Hub\Crawler\Task\Communicator\Node; // Import application-specific stuff use Org\Shipsimu\Hub\Factory\Communicator\CommunicatorFactory; +use Org\Shipsimu\Hub\Task\BaseHubTask; // Import framework stuff use Org\Mxchange\CoreFramework\Registry\GenericRegistry; @@ -34,7 +35,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor; * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class CrawlerNodeCommunicatorTask extends BaseTask implements Taskable, Visitable { +class CrawlerNodeCommunicatorTask extends BaseHubTask implements Taskable, Visitable { /** * Protected constructor * 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 6aa9286b7..082014ee2 100644 --- a/application/hub/classes/tasks/crawler/document_parser/class_CrawlerDocumentParserTask.php +++ b/application/hub/classes/tasks/crawler/document_parser/class_CrawlerDocumentParserTask.php @@ -2,6 +2,9 @@ // Own namespace namespace Org\Shipsimu\Hub\Crawler\Task\Parser\Document; +// Import application-specific stuff +use Org\Shipsimu\Hub\Task\BaseHubTask; + // Import framework stuff use Org\Mxchange\CoreFramework\Task\BaseTask; use Org\Mxchange\CoreFramework\Task\Taskable; @@ -30,7 +33,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor; * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class CrawlerDocumentParserTask extends BaseTask implements Taskable, Visitable { +class CrawlerDocumentParserTask extends BaseHubTask implements Taskable, Visitable { /** * Protected constructor * diff --git a/application/hub/classes/tasks/crawler/mime_sniffer/class_CrawlerMimeSnifferTask.php b/application/hub/classes/tasks/crawler/mime_sniffer/class_CrawlerMimeSnifferTask.php index d78bcd54d..d3de517ab 100644 --- a/application/hub/classes/tasks/crawler/mime_sniffer/class_CrawlerMimeSnifferTask.php +++ b/application/hub/classes/tasks/crawler/mime_sniffer/class_CrawlerMimeSnifferTask.php @@ -2,6 +2,9 @@ // Own namespace namespace Org\Shipsimu\Hub\Crawler\Task\Sniffer\Mime; +// Import application-specific stuff +use Org\Shipsimu\Hub\Task\BaseHubTask; + // Import framework stuff use Org\Mxchange\CoreFramework\Task\BaseTask; use Org\Mxchange\CoreFramework\Task\Taskable; @@ -30,7 +33,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor; * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class CrawlerMimeSnifferTask extends BaseTask implements Taskable, Visitable { +class CrawlerMimeSnifferTask extends BaseHubTask implements Taskable, Visitable { /** * Protected constructor * diff --git a/application/hub/classes/tasks/crawler/ping/class_CrawlerPingTask.php b/application/hub/classes/tasks/crawler/ping/class_CrawlerPingTask.php index b7ca226c4..1b180c78a 100644 --- a/application/hub/classes/tasks/crawler/ping/class_CrawlerPingTask.php +++ b/application/hub/classes/tasks/crawler/ping/class_CrawlerPingTask.php @@ -2,6 +2,9 @@ // Own namespace namespace Org\Shipsimu\Hub\Crawler\Task\Ping; +// Import application-specific stuff +use Org\Shipsimu\Hub\Task\BaseHubTask; + // Import framework stuff use Org\Mxchange\CoreFramework\Task\BaseTask; use Org\Mxchange\CoreFramework\Task\Taskable; @@ -30,7 +33,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor; * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class CrawlerPingTask extends BaseTask implements Taskable, Visitable { +class CrawlerPingTask extends BaseHubTask implements Taskable, Visitable { /** * Protected constructor * diff --git a/application/hub/classes/tasks/crawler/publisher/class_CrawlerRemoteJobPublisherTask.php b/application/hub/classes/tasks/crawler/publisher/class_CrawlerRemoteJobPublisherTask.php index 18e44d2be..3be4e604d 100644 --- a/application/hub/classes/tasks/crawler/publisher/class_CrawlerRemoteJobPublisherTask.php +++ b/application/hub/classes/tasks/crawler/publisher/class_CrawlerRemoteJobPublisherTask.php @@ -2,6 +2,9 @@ // Own namespace namespace Org\Shipsimu\Hub\Crawler\Task\Publisher\Job\Remote; +// Import application-specific stuff +use Org\Shipsimu\Hub\Task\BaseHubTask; + // Import framework stuff use Org\Mxchange\CoreFramework\Task\BaseTask; use Org\Mxchange\CoreFramework\Task\Taskable; @@ -30,7 +33,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor; * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class CrawlerRemoteJobPublisherTask extends BaseTask implements Taskable, Visitable { +class CrawlerRemoteJobPublisherTask extends BaseHubTask implements Taskable, Visitable { /** * Protected constructor * diff --git a/application/hub/classes/tasks/crawler/snippet_extractor/class_CrawlerSnippetExtractorTask.php b/application/hub/classes/tasks/crawler/snippet_extractor/class_CrawlerSnippetExtractorTask.php index 0fd0211a6..cb09e1817 100644 --- a/application/hub/classes/tasks/crawler/snippet_extractor/class_CrawlerSnippetExtractorTask.php +++ b/application/hub/classes/tasks/crawler/snippet_extractor/class_CrawlerSnippetExtractorTask.php @@ -2,6 +2,9 @@ // Own namespace namespace Org\Shipsimu\Hub\Crawler\Task\SnippetExtractor; +// Import application-specific stuff +use Org\Shipsimu\Hub\Task\BaseHubTask; + // Import framework stuff use Org\Mxchange\CoreFramework\Task\BaseTask; use Org\Mxchange\CoreFramework\Task\Taskable; @@ -30,7 +33,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor; * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class CrawlerSnippetExtractorTask extends BaseTask implements Taskable, Visitable { +class CrawlerSnippetExtractorTask extends BaseHubTask implements Taskable, Visitable { /** * Protected constructor * diff --git a/application/hub/classes/tasks/crawler/structure_analyzer/class_CrawlerStructureAnalyzerTask.php b/application/hub/classes/tasks/crawler/structure_analyzer/class_CrawlerStructureAnalyzerTask.php index ad3778f1c..5d131ad80 100644 --- a/application/hub/classes/tasks/crawler/structure_analyzer/class_CrawlerStructureAnalyzerTask.php +++ b/application/hub/classes/tasks/crawler/structure_analyzer/class_CrawlerStructureAnalyzerTask.php @@ -2,6 +2,9 @@ // Own namespace namespace Org\Shipsimu\Hub\Crawler\Task\Analyzer\DocumentStructure; +// Import application-specific stuff +use Org\Shipsimu\Hub\Task\BaseHubTask; + // Import framework stuff use Org\Mxchange\CoreFramework\Task\BaseTask; use Org\Mxchange\CoreFramework\Task\Taskable; @@ -30,7 +33,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor; * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class CrawlerStructureAnalyzerTask extends BaseTask implements Taskable, Visitable { +class CrawlerStructureAnalyzerTask extends BaseHubTask implements Taskable, Visitable { /** * Protected constructor * diff --git a/application/hub/classes/tasks/crawler/url_crawler/local/class_CrawlerLocalUrlCrawlerTask.php b/application/hub/classes/tasks/crawler/url_crawler/local/class_CrawlerLocalUrlCrawlerTask.php index c5769aaf8..278f3c686 100644 --- a/application/hub/classes/tasks/crawler/url_crawler/local/class_CrawlerLocalUrlCrawlerTask.php +++ b/application/hub/classes/tasks/crawler/url_crawler/local/class_CrawlerLocalUrlCrawlerTask.php @@ -2,6 +2,9 @@ // Own namespace namespace Org\Shipsimu\Hub\Crawler\Task\Crawler\LocalUrl; +// Import application-specific stuff +use Org\Shipsimu\Hub\Task\BaseHubTask; + // Import framework stuff use Org\Mxchange\CoreFramework\Task\BaseTask; use Org\Mxchange\CoreFramework\Task\Taskable; @@ -30,7 +33,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor; * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class CrawlerLocalUrlCrawlerTask extends BaseTask implements Taskable, Visitable { +class CrawlerLocalUrlCrawlerTask extends BaseHubTask implements Taskable, Visitable { /** * Protected constructor * diff --git a/application/hub/classes/tasks/crawler/url_crawler/remote/class_CrawlerRemoteUrlCrawlerTask.php b/application/hub/classes/tasks/crawler/url_crawler/remote/class_CrawlerRemoteUrlCrawlerTask.php index 256542303..d6dfd56d0 100644 --- a/application/hub/classes/tasks/crawler/url_crawler/remote/class_CrawlerRemoteUrlCrawlerTask.php +++ b/application/hub/classes/tasks/crawler/url_crawler/remote/class_CrawlerRemoteUrlCrawlerTask.php @@ -2,6 +2,9 @@ // Own namespace namespace Org\Shipsimu\Hub\Crawler\Task\Crawler\RemoteUrl; +// Import application-specific stuff +use Org\Shipsimu\Hub\Task\BaseHubTask; + // Import framework stuff use Org\Mxchange\CoreFramework\Task\BaseTask; use Org\Mxchange\CoreFramework\Task\Taskable; @@ -30,7 +33,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor; * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class CrawlerRemoteUrlCrawlerTask extends BaseTask implements Taskable, Visitable { +class CrawlerRemoteUrlCrawlerTask extends BaseHubTask implements Taskable, Visitable { /** * Protected constructor * diff --git a/application/hub/classes/tasks/cruncher/class_CruncherKeyProducerTask.php b/application/hub/classes/tasks/cruncher/class_CruncherKeyProducerTask.php index ccd7c6f3c..b70f468e1 100644 --- a/application/hub/classes/tasks/cruncher/class_CruncherKeyProducerTask.php +++ b/application/hub/classes/tasks/cruncher/class_CruncherKeyProducerTask.php @@ -2,6 +2,9 @@ // Own namespace namespace Org\Shipsimu\Hub\Cruncher\Producer\Key; +// Import application-specific stuff +use Org\Shipsimu\Hub\Task\BaseHubTask; + // Import framework stuff use Org\Mxchange\CoreFramework\Task\BaseTask; use Org\Mxchange\CoreFramework\Task\Taskable; @@ -30,7 +33,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor; * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class CruncherKeyProducerTask extends BaseTask implements Taskable, Visitable { +class CruncherKeyProducerTask extends BaseHubTask implements Taskable, Visitable { /** * Protected constructor * diff --git a/application/hub/classes/tasks/cruncher/class_CruncherTestUnitProducerTask.php b/application/hub/classes/tasks/cruncher/class_CruncherTestUnitProducerTask.php index efdd5a4a2..4f04633cb 100644 --- a/application/hub/classes/tasks/cruncher/class_CruncherTestUnitProducerTask.php +++ b/application/hub/classes/tasks/cruncher/class_CruncherTestUnitProducerTask.php @@ -2,6 +2,9 @@ // Own namespace namespace Org\Shipsimu\Hub\Cruncher\Task\Producer\Unit; +// Import application-specific stuff +use Org\Shipsimu\Hub\Task\BaseHubTask; + // Import framework stuff use Org\Mxchange\CoreFramework\Task\BaseTask; use Org\Mxchange\CoreFramework\Task\Taskable; @@ -30,7 +33,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor; * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class CruncherTestUnitProducerTask extends BaseTask implements Taskable, Visitable { +class CruncherTestUnitProducerTask extends BaseHubTask implements Taskable, Visitable { /** * Protected constructor * diff --git a/application/hub/classes/tasks/cruncher/class_CruncherWorkUnitFetcherTask.php b/application/hub/classes/tasks/cruncher/class_CruncherWorkUnitFetcherTask.php index 31a675105..10f1a7170 100644 --- a/application/hub/classes/tasks/cruncher/class_CruncherWorkUnitFetcherTask.php +++ b/application/hub/classes/tasks/cruncher/class_CruncherWorkUnitFetcherTask.php @@ -2,6 +2,9 @@ // Own namespace namespace Org\Shipsimu\Hub\Cruncher\Task\Fetcher\WorkUnit; +// Import application-specific stuff +use Org\Shipsimu\Hub\Task\BaseHubTask; + // Import framework stuff use Org\Mxchange\CoreFramework\Registry\GenericRegistry; use Org\Mxchange\CoreFramework\Task\BaseTask; @@ -32,7 +35,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor; * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class CruncherWorkUnitFetcherTask extends BaseTask implements Taskable, Visitable { +class CruncherWorkUnitFetcherTask extends BaseHubTask implements Taskable, Visitable { /** * Protected constructor * diff --git a/application/hub/classes/tasks/miner/block_fetcher/class_MinerBlockFetcherTask.php b/application/hub/classes/tasks/miner/block_fetcher/class_MinerBlockFetcherTask.php index a96069962..1ae6a208b 100644 --- a/application/hub/classes/tasks/miner/block_fetcher/class_MinerBlockFetcherTask.php +++ b/application/hub/classes/tasks/miner/block_fetcher/class_MinerBlockFetcherTask.php @@ -2,6 +2,9 @@ // Own namespace namespace Org\Shipsimu\Hub\Miner\Task\Fetcher\Block; +// Import application-specific stuff +use Org\Shipsimu\Hub\Task\BaseHubTask; + // Import framework stuff use Org\Mxchange\CoreFramework\Registry\GenericRegistry; use Org\Mxchange\CoreFramework\Task\BaseTask; @@ -32,7 +35,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor; * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class MinerBlockFetcherTask extends BaseTask implements Taskable, Visitable { +class MinerBlockFetcherTask extends BaseHubTask implements Taskable, Visitable { /** * Protected constructor * diff --git a/application/hub/classes/tasks/miner/block_producer/class_MinerRealGenesisBlockProducerTask.php b/application/hub/classes/tasks/miner/block_producer/class_MinerRealGenesisBlockProducerTask.php index 89a7e2dc7..49c13e7f7 100644 --- a/application/hub/classes/tasks/miner/block_producer/class_MinerRealGenesisBlockProducerTask.php +++ b/application/hub/classes/tasks/miner/block_producer/class_MinerRealGenesisBlockProducerTask.php @@ -2,6 +2,9 @@ // Own namespace namespace Org\Shipsimu\Hub\Miner\Task\Producer\GenesisBlock; +// Import application-specific stuff +use Org\Shipsimu\Hub\Task\BaseHubTask; + // Import framework stuff use Org\Mxchange\CoreFramework\Registry\GenericRegistry; use Org\Mxchange\CoreFramework\Task\BaseTask; @@ -31,7 +34,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor; * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class MinerRealGenesisBlockProducerTask extends BaseTask implements Taskable, Visitable { +class MinerRealGenesisBlockProducerTask extends BaseHubTask implements Taskable, Visitable { /** * Protected constructor * diff --git a/application/hub/classes/tasks/miner/block_producer/class_MinerTestGenesisBlockProducerTask.php b/application/hub/classes/tasks/miner/block_producer/class_MinerTestGenesisBlockProducerTask.php index f0ee3c209..8e722f6cf 100644 --- a/application/hub/classes/tasks/miner/block_producer/class_MinerTestGenesisBlockProducerTask.php +++ b/application/hub/classes/tasks/miner/block_producer/class_MinerTestGenesisBlockProducerTask.php @@ -2,6 +2,9 @@ // Own namespace namespace Org\Shipsimu\Hub\Miner\Task\Producer\GenesisBlock; +// Import application-specific stuff +use Org\Shipsimu\Hub\Task\BaseHubTask; + // Import framework stuff use Org\Mxchange\CoreFramework\Task\BaseTask; use Org\Mxchange\CoreFramework\Task\Taskable; @@ -30,7 +33,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor; * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class MinerTestGenesisBlockProducerTask extends BaseTask implements Taskable, Visitable { +class MinerTestGenesisBlockProducerTask extends BaseHubTask implements Taskable, Visitable { /** * Protected constructor * diff --git a/application/hub/classes/tasks/miner/communicator/class_MinerNodeCommunicatorTask.php b/application/hub/classes/tasks/miner/communicator/class_MinerNodeCommunicatorTask.php index fd4dbdaad..e36633b0f 100644 --- a/application/hub/classes/tasks/miner/communicator/class_MinerNodeCommunicatorTask.php +++ b/application/hub/classes/tasks/miner/communicator/class_MinerNodeCommunicatorTask.php @@ -4,6 +4,7 @@ namespace Org\Shipsimu\Hub\Miner\Task\Communicator\Node; // Import application-specific stuff use Org\Shipsimu\Hub\Factory\Communicator\CommunicatorFactory; +use Org\Shipsimu\Hub\Task\BaseHubTask; // Import framework stuff use Org\Mxchange\CoreFramework\Task\BaseTask; @@ -33,7 +34,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor; * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class MinerNodeCommunicatorTask extends BaseTask implements Taskable, Visitable { +class MinerNodeCommunicatorTask extends BaseHubTask implements Taskable, Visitable { /** * Protected constructor * diff --git a/application/hub/classes/tasks/network/class_NetworkPackageReaderTask.php b/application/hub/classes/tasks/network/class_NetworkPackageReaderTask.php index 8a697f817..f7a97036c 100644 --- a/application/hub/classes/tasks/network/class_NetworkPackageReaderTask.php +++ b/application/hub/classes/tasks/network/class_NetworkPackageReaderTask.php @@ -5,6 +5,7 @@ namespace Org\Shipsimu\Hub\Task\Network\Reader; // Import application-specific stuff use Org\Shipsimu\Hub\Factory\Handler\Network\NetworkPackageHandlerFactory; use Org\Shipsimu\Hub\Factory\Network\NetworkPackageFactory; +use Org\Shipsimu\Hub\Task\BaseHubTask; // Import framework stuff use Org\Mxchange\CoreFramework\Task\BaseTask; @@ -34,7 +35,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor; * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class NetworkPackageReaderTask extends BaseTask implements Taskable, Visitable { +class NetworkPackageReaderTask extends BaseHubTask implements Taskable, Visitable { /** * Protected constructor * diff --git a/application/hub/classes/tasks/network/class_NetworkPackageWriterTask.php b/application/hub/classes/tasks/network/class_NetworkPackageWriterTask.php index 8296bcb5e..5500ebc86 100644 --- a/application/hub/classes/tasks/network/class_NetworkPackageWriterTask.php +++ b/application/hub/classes/tasks/network/class_NetworkPackageWriterTask.php @@ -5,6 +5,7 @@ namespace Org\Shipsimu\Hub\Task\Network\Writer; // Import application-specific stuff use Org\Shipsimu\Hub\Factory\Handler\Network\NetworkPackageHandlerFactory; use Org\Shipsimu\Hub\Factory\Network\NetworkPackageFactory; +use Org\Shipsimu\Hub\Task\BaseHubTask; // Import framework stuff use Org\Mxchange\CoreFramework\Task\BaseTask; @@ -34,7 +35,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor; * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class NetworkPackageWriterTask extends BaseTask implements Taskable, Visitable { +class NetworkPackageWriterTask extends BaseHubTask implements Taskable, Visitable { /** * Protected constructor * diff --git a/application/hub/classes/tasks/node/announcement/class_NodeAnnouncementTask.php b/application/hub/classes/tasks/node/announcement/class_NodeAnnouncementTask.php index dbbf9d49a..5e430f2a6 100644 --- a/application/hub/classes/tasks/node/announcement/class_NodeAnnouncementTask.php +++ b/application/hub/classes/tasks/node/announcement/class_NodeAnnouncementTask.php @@ -4,6 +4,7 @@ namespace Org\Shipsimu\Hub\Node\Task\Announcement; // Import application-specific stuff use Org\Shipsimu\Hub\Factory\Node\NodeObjectFactory; +use Org\Shipsimu\Hub\Task\BaseHubTask; // Import framework stuff use Org\Mxchange\CoreFramework\Task\BaseTask; @@ -33,7 +34,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor; * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class NodeAnnouncementTask extends BaseTask implements Taskable, Visitable { +class NodeAnnouncementTask extends BaseHubTask implements Taskable, Visitable { /** * Protected constructor * @@ -75,6 +76,7 @@ class NodeAnnouncementTask extends BaseTask implements Taskable, Visitable { */ public function executeTask () { // Get the node instance and announce us + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE-ANNOUNCEMENT-TASK: Creating node instance ...'); NodeObjectFactory::createNodeInstance()->announceToUpperNodes($this); } diff --git a/application/hub/classes/tasks/node/chunks/class_NodeChunkAssemblerTask.php b/application/hub/classes/tasks/node/chunks/class_NodeChunkAssemblerTask.php index eb32ab7f0..5e3205991 100644 --- a/application/hub/classes/tasks/node/chunks/class_NodeChunkAssemblerTask.php +++ b/application/hub/classes/tasks/node/chunks/class_NodeChunkAssemblerTask.php @@ -4,6 +4,7 @@ namespace Org\Shipsimu\Hub\Node\Task\Assembler; // Import application-specific stuff use Org\Shipsimu\Hub\Factory\Handler\Chunk\ChunkHandlerFactory; +use Org\Shipsimu\Hub\Task\BaseHubTask; // Import framework stuff use Org\Mxchange\CoreFramework\Task\BaseTask; @@ -33,7 +34,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor; * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class NodeChunkAssemblerTask extends BaseTask implements Taskable, Visitable { +class NodeChunkAssemblerTask extends BaseHubTask implements Taskable, Visitable { /** * Protected constructor * diff --git a/application/hub/classes/tasks/node/decoder/class_NodePackageDecoderTask.php b/application/hub/classes/tasks/node/decoder/class_NodePackageDecoderTask.php index 79766ea46..399a9131a 100644 --- a/application/hub/classes/tasks/node/decoder/class_NodePackageDecoderTask.php +++ b/application/hub/classes/tasks/node/decoder/class_NodePackageDecoderTask.php @@ -4,6 +4,7 @@ namespace Org\Shipsimu\Hub\Node\Task\Decoder; // Import application-specific stuff use Org\Shipsimu\Hub\Factory\Decoder\DecoderFactory; +use Org\Shipsimu\Hub\Task\BaseHubTask; // Import framework stuff use Org\Mxchange\CoreFramework\Task\BaseTask; @@ -33,7 +34,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor; * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class NodePackageDecoderTask extends BaseTask implements Taskable, Visitable { +class NodePackageDecoderTask extends BaseHubTask implements Taskable, Visitable { /** * Protected constructor * diff --git a/application/hub/classes/tasks/node/dht/class_NodeDhtBootstrapTask.php b/application/hub/classes/tasks/node/dht/class_NodeDhtBootstrapTask.php index c1703028c..4017181bc 100644 --- a/application/hub/classes/tasks/node/dht/class_NodeDhtBootstrapTask.php +++ b/application/hub/classes/tasks/node/dht/class_NodeDhtBootstrapTask.php @@ -4,6 +4,7 @@ namespace Org\Shipsimu\Hub\Node\Task\Dht\Bootstrap; // Import application-specific stuff use Org\Shipsimu\Hub\Factory\Dht\DhtObjectFactory; +use Org\Shipsimu\Hub\Task\BaseHubTask; // Import framework stuff use Org\Mxchange\CoreFramework\Task\BaseTask; @@ -33,7 +34,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor; * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class NodeDhtBootstrapTask extends BaseTask implements Taskable, Visitable { +class NodeDhtBootstrapTask extends BaseHubTask implements Taskable, Visitable { /** * Protected constructor * diff --git a/application/hub/classes/tasks/node/dht/class_NodeDhtInitializationTask.php b/application/hub/classes/tasks/node/dht/class_NodeDhtInitializationTask.php index 7bcf94e74..48586cf54 100644 --- a/application/hub/classes/tasks/node/dht/class_NodeDhtInitializationTask.php +++ b/application/hub/classes/tasks/node/dht/class_NodeDhtInitializationTask.php @@ -4,6 +4,7 @@ namespace Org\Shipsimu\Hub\Node\Task\Dht\Initialization; // Import application-specific stuff use Org\Shipsimu\Hub\Factory\Dht\DhtObjectFactory; +use Org\Shipsimu\Hub\Task\BaseHubTask; // Import framework stuff use Org\Mxchange\CoreFramework\Task\BaseTask; @@ -33,7 +34,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor; * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class NodeDhtInitializationTask extends BaseTask implements Taskable, Visitable { +class NodeDhtInitializationTask extends BaseHubTask implements Taskable, Visitable { /** * Protected constructor * diff --git a/application/hub/classes/tasks/node/dht/class_NodeDhtLateBootstrapTask.php b/application/hub/classes/tasks/node/dht/class_NodeDhtLateBootstrapTask.php index 06a2479b4..0f1b05304 100644 --- a/application/hub/classes/tasks/node/dht/class_NodeDhtLateBootstrapTask.php +++ b/application/hub/classes/tasks/node/dht/class_NodeDhtLateBootstrapTask.php @@ -4,6 +4,7 @@ namespace Org\Shipsimu\Hub\Node\Task\Dht\Bootstrap\Late; // Import application-specific stuff use Org\Shipsimu\Hub\Factory\Dht\DhtObjectFactory; +use Org\Shipsimu\Hub\Task\BaseHubTask; // Import framework stuff use Org\Mxchange\CoreFramework\Task\BaseTask; @@ -33,7 +34,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor; * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class NodeDhtLateBootstrapTask extends BaseTask implements Taskable, Visitable { +class NodeDhtLateBootstrapTask extends BaseHubTask implements Taskable, Visitable { /** * Protected constructor * diff --git a/application/hub/classes/tasks/node/dht/class_NodeDhtPublicationCheckTask.php b/application/hub/classes/tasks/node/dht/class_NodeDhtPublicationCheckTask.php index a36cc1a8b..0e08c0d55 100644 --- a/application/hub/classes/tasks/node/dht/class_NodeDhtPublicationCheckTask.php +++ b/application/hub/classes/tasks/node/dht/class_NodeDhtPublicationCheckTask.php @@ -4,6 +4,7 @@ namespace Org\Shipsimu\Hub\Node\Task\Dht\Check\Publication; // Import application-specific stuff use Org\Shipsimu\Hub\Factory\Dht\DhtObjectFactory; +use Org\Shipsimu\Hub\Task\BaseHubTask; // Import framework stuff use Org\Mxchange\CoreFramework\Task\BaseTask; @@ -33,7 +34,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor; * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class NodeDhtPublicationCheckTask extends BaseTask implements Taskable, Visitable { +class NodeDhtPublicationCheckTask extends BaseHubTask implements Taskable, Visitable { /** * Protected constructor * diff --git a/application/hub/classes/tasks/node/dht/class_NodeDhtPublicationTask.php b/application/hub/classes/tasks/node/dht/class_NodeDhtPublicationTask.php index 30187eac5..b4c65c4e7 100644 --- a/application/hub/classes/tasks/node/dht/class_NodeDhtPublicationTask.php +++ b/application/hub/classes/tasks/node/dht/class_NodeDhtPublicationTask.php @@ -4,6 +4,7 @@ namespace Org\Shipsimu\Hub\Node\Task\Dht\Publication; // Import application-specific stuff use Org\Shipsimu\Hub\Factory\Dht\DhtObjectFactory; +use Org\Shipsimu\Hub\Task\BaseHubTask; // Import framework stuff use Org\Mxchange\CoreFramework\Task\BaseTask; @@ -33,7 +34,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor; * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class NodeDhtPublicationTask extends BaseTask implements Taskable, Visitable { +class NodeDhtPublicationTask extends BaseHubTask implements Taskable, Visitable { /** * Protected constructor * diff --git a/application/hub/classes/tasks/node/dht/class_NodeDhtQueryTask.php b/application/hub/classes/tasks/node/dht/class_NodeDhtQueryTask.php index 70df5717a..ffc0950d5 100644 --- a/application/hub/classes/tasks/node/dht/class_NodeDhtQueryTask.php +++ b/application/hub/classes/tasks/node/dht/class_NodeDhtQueryTask.php @@ -4,6 +4,7 @@ namespace Org\Shipsimu\Hub\Node\Task\Dht\Query; // Import application-specific stuff use Org\Shipsimu\Hub\Factory\Dht\DhtObjectFactory; +use Org\Shipsimu\Hub\Task\BaseHubTask; // Import framework stuff use Org\Mxchange\CoreFramework\Task\BaseTask; @@ -33,7 +34,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor; * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class NodeDhtQueryTask extends BaseTask implements Taskable, Visitable { +class NodeDhtQueryTask extends BaseHubTask implements Taskable, Visitable { /** * Protected constructor * diff --git a/application/hub/classes/tasks/node/listener/class_NodeSocketListenerTask.php b/application/hub/classes/tasks/node/listener/class_NodeSocketListenerTask.php index fce578f5c..784b6452b 100644 --- a/application/hub/classes/tasks/node/listener/class_NodeSocketListenerTask.php +++ b/application/hub/classes/tasks/node/listener/class_NodeSocketListenerTask.php @@ -4,6 +4,7 @@ namespace Org\Shipsimu\Hub\Node\Task\Listener\Socket; // Import application-specific stuff use Org\Shipsimu\Hub\Factory\Node\NodeObjectFactory; +use Org\Shipsimu\Hub\Task\BaseHubTask; // Import framework stuff use Org\Mxchange\CoreFramework\Task\BaseTask; @@ -33,7 +34,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor; * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class NodeSocketListenerTask extends BaseTask implements Taskable, Visitable { +class NodeSocketListenerTask extends BaseHubTask implements Taskable, Visitable { /** * Protected constructor * @@ -53,6 +54,13 @@ class NodeSocketListenerTask extends BaseTask implements Taskable, Visitable { // Get new instance $taskInstance = new NodeSocketListenerTask(); + // Get the node instance from registry + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('LISTENER-TASK: Creating node instance ...'); + $nodeInstance = NodeObjectFactory::createNodeInstance(); + + // And set it here + $taskInstance->setNodeInstance($nodeInstance); + // Return the prepared instance return $taskInstance; } @@ -64,12 +72,9 @@ class NodeSocketListenerTask extends BaseTask implements Taskable, Visitable { * @return void */ public function accept (Visitor $visitorInstance) { - // Get the node instance from registry - $nodeInstance = NodeObjectFactory::createNodeInstance(); - // Visit the pool listener task - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('LISTENER-TASK: Going to visit object ' . $nodeInstance->getListenerPoolInstance()->__toString() . ' ...'); - $nodeInstance->getListenerPoolInstance()->accept($visitorInstance); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('LISTENER-TASK: Going to visit object ' . $this->getNodeInstance()->getListenerPoolInstance()->__toString() . ' ...'); + $this->getNodeInstance()->getListenerPoolInstance()->accept($visitorInstance); // Visit this task // @TODO Do we need to visit this task? $visitorInstance->visitTask($this); diff --git a/application/hub/classes/tasks/node/ping/class_NodePingTask.php b/application/hub/classes/tasks/node/ping/class_NodePingTask.php index cf9e9e026..7d952ee28 100644 --- a/application/hub/classes/tasks/node/ping/class_NodePingTask.php +++ b/application/hub/classes/tasks/node/ping/class_NodePingTask.php @@ -2,6 +2,9 @@ // Own namespace namespace Org\Shipsimu\Hub\Node\Ping; +// Import application-specific stuff +use Org\Shipsimu\Hub\Task\BaseHubTask; + // Import framework stuff use Org\Mxchange\CoreFramework\Lists\Listable; use Org\Mxchange\CoreFramework\Task\BaseTask; @@ -31,7 +34,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor; * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class NodePingTask extends BaseTask implements Taskable, Visitable { +class NodePingTask extends BaseHubTask implements Taskable, Visitable { /** * Protected constructor * diff --git a/application/hub/classes/tasks/node/self_connect/class_NodeSelfConnectTask.php b/application/hub/classes/tasks/node/self_connect/class_NodeSelfConnectTask.php index ec2541e41..73e17b0c7 100644 --- a/application/hub/classes/tasks/node/self_connect/class_NodeSelfConnectTask.php +++ b/application/hub/classes/tasks/node/self_connect/class_NodeSelfConnectTask.php @@ -4,6 +4,7 @@ namespace Org\Shipsimu\Hub\Node\Task\SelfConnect; // Import application-specific stuff use Org\Shipsimu\Hub\Factory\Node\NodeObjectFactory; +use Org\Shipsimu\Hub\Task\BaseHubTask; // Import framework stuff use Org\Mxchange\CoreFramework\Task\BaseTask; @@ -33,7 +34,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor; * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class NodeSelfConnectTask extends BaseTask implements Taskable, Visitable { +class NodeSelfConnectTask extends BaseHubTask implements Taskable, Visitable { /** * Protected constructor * @@ -75,6 +76,7 @@ class NodeSelfConnectTask extends BaseTask implements Taskable, Visitable { */ public function executeTask () { // Get the node instance and try it + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE-SELF-CONNECT-TASK: Creating node instance ...'); NodeObjectFactory::createNodeInstance()->doSelfConnection($this); } @@ -85,7 +87,7 @@ class NodeSelfConnectTask extends BaseTask implements Taskable, Visitable { * @todo 0% done */ public function doShutdown () { - self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE-SELF-CONNECTTASK: Shutting down...'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE-SELF-CONNECT-TASK: Shutting down...'); } } diff --git a/application/hub/classes/tasks/node/tags/class_NodePackageTagsInitTask.php b/application/hub/classes/tasks/node/tags/class_NodePackageTagsInitTask.php index 7ab62f162..65d963882 100644 --- a/application/hub/classes/tasks/node/tags/class_NodePackageTagsInitTask.php +++ b/application/hub/classes/tasks/node/tags/class_NodePackageTagsInitTask.php @@ -4,6 +4,7 @@ namespace Org\Shipsimu\Hub\Node\Task\Initialization\Tag; // Import application-specific stuff use Org\Shipsimu\Hub\Factory\Tag\Package\PackageTagsFactory; +use Org\Shipsimu\Hub\Task\BaseHubTask; // Import framework stuff use Org\Mxchange\CoreFramework\Task\BaseTask; @@ -33,7 +34,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor; * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class NodePackageTagsInitTask extends BaseTask implements Taskable, Visitable { +class NodePackageTagsInitTask extends BaseHubTask implements Taskable, Visitable { /** * Protected constructor * diff --git a/application/hub/classes/tasks/node/update/class_NodeUpdateCheckTask.php b/application/hub/classes/tasks/node/update/class_NodeUpdateCheckTask.php index c04d95d8f..86df7c647 100644 --- a/application/hub/classes/tasks/node/update/class_NodeUpdateCheckTask.php +++ b/application/hub/classes/tasks/node/update/class_NodeUpdateCheckTask.php @@ -2,6 +2,9 @@ // Own namespace namespace Org\Shipsimu\Hub\Node\Check\Update; +// Import application-specific stuff +use Org\Shipsimu\Hub\Task\BaseHubTask; + // Import framework stuff use Org\Mxchange\CoreFramework\Task\BaseTask; use Org\Mxchange\CoreFramework\Task\Taskable; @@ -30,7 +33,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor; * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class NodeUpdateCheckTask extends BaseTask implements Taskable, Visitable { +class NodeUpdateCheckTask extends BaseHubTask implements Taskable, Visitable { /** * Protected constructor * diff --git a/application/hub/classes/tools/hub/class_HubTools.php b/application/hub/classes/tools/hub/class_HubTools.php index 9dd5d43d0..072912494 100644 --- a/application/hub/classes/tools/hub/class_HubTools.php +++ b/application/hub/classes/tools/hub/class_HubTools.php @@ -115,6 +115,7 @@ class HubTools extends BaseHubSystem { $recipientUniversalNodeLocator = $recipient[NodeDistributedHashTableDatabaseWrapper::DB_COLUMN_EXTERNAL_ADDRESS]; } else { // Get the instance, this might throw a NPE + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('HUB-TOOLS: Creating node instance ...'); $nodeInstance = NodeObjectFactory::createNodeInstance(); // Is the session id the same? diff --git a/application/hub/interfaces/handler/network/class_Networkable.php b/application/hub/interfaces/handler/network/class_Networkable.php index 8f221b08c..d851b6ec4 100644 --- a/application/hub/interfaces/handler/network/class_Networkable.php +++ b/application/hub/interfaces/handler/network/class_Networkable.php @@ -54,6 +54,6 @@ interface Networkable extends HandleableDataSet, HandleableRawData { * * @return $packageInstance An instance of a DeliverablePackage class */ - function getNextRawData (); + function getNextPackageInstance (); }