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
*/
private $socketType;
+ /**
+ * Peer address
+ */
+ private $peerAddress;
+
+ /**
+ * Peer port
+ */
+ private $peerPort;
+
+ /**
+ * Sender address
+ */
+ private $senderAddress;
+
+ /**
+ * Sender port
+ */
+ private $senderPort;
+
/**
* Protected constructor
*
/**
* Getter for socket type
*
- * @return $socketType Stocket type
+ * @return $socketType Socket type
*/
public function getSocketType () {
return $this->socketType;
$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;
+ }
+
}
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
*/
private $universalNodeLocatorInstance = NULL;
+ /**
+ * Node instance
+ */
+ private $nodeInstance = NULL;
+
/**
* Protected constructor
*
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;
+ }
+
}
// 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;
}
// 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
$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();
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));
// 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!');
/* 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
// 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
// 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
*/
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
// 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);
* 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
*/
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);
);
// 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
}
// 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;
}
// 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
*/
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
$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
*/
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
*/
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
$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);
/*
$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.');
}
/**
*/
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));
$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.');
}
/**
*/
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?
*/
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?
*/
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?
*/
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.
*/
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?
*/
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?
$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
* 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));
*/
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!');
}
/**
*/
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!');
}
/**
*/
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;
/**
* "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;
}
/**
*/
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;
} // 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
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
$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
// 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;
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-class AptProxyListenerTask extends BaseTask implements Taskable, Visitable {
+class AptProxyListenerTask extends BaseHubTask implements Taskable, Visitable {
/**
* Protected constructor
*
// 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;
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-class ChatTelnetListenerTask extends BaseTask implements Taskable, Visitable {
+class ChatTelnetListenerTask extends BaseHubTask implements Taskable, Visitable {
/**
* Protected constructor
*
// 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;
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-abstract class BaseUrlSourceTask extends BaseTask {
+abstract class BaseUrlSourceTask extends BaseHubTask {
/**
* An instance of a UrlSource class
// 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;
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-class CrawlerNodeCommunicatorTask extends BaseTask implements Taskable, Visitable {
+class CrawlerNodeCommunicatorTask extends BaseHubTask implements Taskable, Visitable {
/**
* Protected constructor
*
// 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;
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-class CrawlerDocumentParserTask extends BaseTask implements Taskable, Visitable {
+class CrawlerDocumentParserTask extends BaseHubTask implements Taskable, Visitable {
/**
* Protected constructor
*
// 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;
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-class CrawlerMimeSnifferTask extends BaseTask implements Taskable, Visitable {
+class CrawlerMimeSnifferTask extends BaseHubTask implements Taskable, Visitable {
/**
* Protected constructor
*
// 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;
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-class CrawlerPingTask extends BaseTask implements Taskable, Visitable {
+class CrawlerPingTask extends BaseHubTask implements Taskable, Visitable {
/**
* Protected constructor
*
// 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;
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-class CrawlerRemoteJobPublisherTask extends BaseTask implements Taskable, Visitable {
+class CrawlerRemoteJobPublisherTask extends BaseHubTask implements Taskable, Visitable {
/**
* Protected constructor
*
// 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;
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-class CrawlerSnippetExtractorTask extends BaseTask implements Taskable, Visitable {
+class CrawlerSnippetExtractorTask extends BaseHubTask implements Taskable, Visitable {
/**
* Protected constructor
*
// 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;
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-class CrawlerStructureAnalyzerTask extends BaseTask implements Taskable, Visitable {
+class CrawlerStructureAnalyzerTask extends BaseHubTask implements Taskable, Visitable {
/**
* Protected constructor
*
// 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;
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-class CrawlerLocalUrlCrawlerTask extends BaseTask implements Taskable, Visitable {
+class CrawlerLocalUrlCrawlerTask extends BaseHubTask implements Taskable, Visitable {
/**
* Protected constructor
*
// 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;
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-class CrawlerRemoteUrlCrawlerTask extends BaseTask implements Taskable, Visitable {
+class CrawlerRemoteUrlCrawlerTask extends BaseHubTask implements Taskable, Visitable {
/**
* Protected constructor
*
// 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;
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-class CruncherKeyProducerTask extends BaseTask implements Taskable, Visitable {
+class CruncherKeyProducerTask extends BaseHubTask implements Taskable, Visitable {
/**
* Protected constructor
*
// 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;
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-class CruncherTestUnitProducerTask extends BaseTask implements Taskable, Visitable {
+class CruncherTestUnitProducerTask extends BaseHubTask implements Taskable, Visitable {
/**
* Protected constructor
*
// 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;
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-class CruncherWorkUnitFetcherTask extends BaseTask implements Taskable, Visitable {
+class CruncherWorkUnitFetcherTask extends BaseHubTask implements Taskable, Visitable {
/**
* Protected constructor
*
// 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;
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-class MinerBlockFetcherTask extends BaseTask implements Taskable, Visitable {
+class MinerBlockFetcherTask extends BaseHubTask implements Taskable, Visitable {
/**
* Protected constructor
*
// 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;
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-class MinerRealGenesisBlockProducerTask extends BaseTask implements Taskable, Visitable {
+class MinerRealGenesisBlockProducerTask extends BaseHubTask implements Taskable, Visitable {
/**
* Protected constructor
*
// 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;
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-class MinerTestGenesisBlockProducerTask extends BaseTask implements Taskable, Visitable {
+class MinerTestGenesisBlockProducerTask extends BaseHubTask implements Taskable, Visitable {
/**
* Protected constructor
*
// 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;
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-class MinerNodeCommunicatorTask extends BaseTask implements Taskable, Visitable {
+class MinerNodeCommunicatorTask extends BaseHubTask implements Taskable, Visitable {
/**
* Protected constructor
*
// 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;
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-class NetworkPackageReaderTask extends BaseTask implements Taskable, Visitable {
+class NetworkPackageReaderTask extends BaseHubTask implements Taskable, Visitable {
/**
* Protected constructor
*
// 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;
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-class NetworkPackageWriterTask extends BaseTask implements Taskable, Visitable {
+class NetworkPackageWriterTask extends BaseHubTask implements Taskable, Visitable {
/**
* Protected constructor
*
// 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;
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-class NodeAnnouncementTask extends BaseTask implements Taskable, Visitable {
+class NodeAnnouncementTask extends BaseHubTask implements Taskable, Visitable {
/**
* Protected constructor
*
*/
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);
}
// 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;
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-class NodeChunkAssemblerTask extends BaseTask implements Taskable, Visitable {
+class NodeChunkAssemblerTask extends BaseHubTask implements Taskable, Visitable {
/**
* Protected constructor
*
// 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;
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-class NodePackageDecoderTask extends BaseTask implements Taskable, Visitable {
+class NodePackageDecoderTask extends BaseHubTask implements Taskable, Visitable {
/**
* Protected constructor
*
// 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;
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-class NodeDhtBootstrapTask extends BaseTask implements Taskable, Visitable {
+class NodeDhtBootstrapTask extends BaseHubTask implements Taskable, Visitable {
/**
* Protected constructor
*
// 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;
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-class NodeDhtInitializationTask extends BaseTask implements Taskable, Visitable {
+class NodeDhtInitializationTask extends BaseHubTask implements Taskable, Visitable {
/**
* Protected constructor
*
// 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;
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-class NodeDhtLateBootstrapTask extends BaseTask implements Taskable, Visitable {
+class NodeDhtLateBootstrapTask extends BaseHubTask implements Taskable, Visitable {
/**
* Protected constructor
*
// 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;
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-class NodeDhtPublicationCheckTask extends BaseTask implements Taskable, Visitable {
+class NodeDhtPublicationCheckTask extends BaseHubTask implements Taskable, Visitable {
/**
* Protected constructor
*
// 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;
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-class NodeDhtPublicationTask extends BaseTask implements Taskable, Visitable {
+class NodeDhtPublicationTask extends BaseHubTask implements Taskable, Visitable {
/**
* Protected constructor
*
// 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;
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-class NodeDhtQueryTask extends BaseTask implements Taskable, Visitable {
+class NodeDhtQueryTask extends BaseHubTask implements Taskable, Visitable {
/**
* Protected constructor
*
// 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;
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-class NodeSocketListenerTask extends BaseTask implements Taskable, Visitable {
+class NodeSocketListenerTask extends BaseHubTask implements Taskable, Visitable {
/**
* Protected constructor
*
// 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;
}
* @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);
// 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;
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-class NodePingTask extends BaseTask implements Taskable, Visitable {
+class NodePingTask extends BaseHubTask implements Taskable, Visitable {
/**
* Protected constructor
*
// 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;
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-class NodeSelfConnectTask extends BaseTask implements Taskable, Visitable {
+class NodeSelfConnectTask extends BaseHubTask implements Taskable, Visitable {
/**
* Protected constructor
*
*/
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);
}
* @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...');
}
}
// 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;
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-class NodePackageTagsInitTask extends BaseTask implements Taskable, Visitable {
+class NodePackageTagsInitTask extends BaseHubTask implements Taskable, Visitable {
/**
* Protected constructor
*
// 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;
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-class NodeUpdateCheckTask extends BaseTask implements Taskable, Visitable {
+class NodeUpdateCheckTask extends BaseHubTask implements Taskable, Visitable {
/**
* Protected constructor
*
$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?
*
* @return $packageInstance An instance of a DeliverablePackage class
*/
- function getNextRawData ();
+ function getNextPackageInstance ();
}