*
* @author Roland Haeder <webmaster@shipsimu.org>
* @version 0.0.0
- * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
* @license GNU GPL 3.0 or any newer version
* @link http://www.shipsimu.org
* @todo Needs to add functionality for handling the object's type
*/
const PACKAGE_DATA_SENDER = 'sender';
const PACKAGE_DATA_RECIPIENT = 'recipient';
- const PACKAGE_DATA_PROTOCOL = 'protocol';
const PACKAGE_DATA_CONTENT = 'content';
const PACKAGE_DATA_STATUS = 'status';
const PACKAGE_DATA_SIGNATURE = 'signature';
* which have no recipient address and stamp... ;-) This stacker will
* also be used for incoming raw data to handle it.
*/
- $stackerInstance = ObjectFactory::createObjectByConfiguredName('network_package_stacker_class');
+ $stackInstance = ObjectFactory::createObjectByConfiguredName('network_package_stacker_class');
// At last, set it in this class
- $packageInstance->setStackerInstance($stackerInstance);
+ $packageInstance->setStackInstance($stackInstance);
// Init all stacker
$packageInstance->initStacks();
*/
protected function initStacks ($forceReInit = FALSE) {
// Initialize all
- $this->getStackerInstance()->initStacks(array(
+ $this->getStackInstance()->initStacks(array(
self::STACKER_NAME_UNDECLARED,
self::STACKER_NAME_DECLARED,
self::STACKER_NAME_OUTGOING,
*/
private function changePackageStatus (array $packageData, $stackerName, $newStatus) {
// Skip this for empty stacks
- if ($this->getStackerInstance()->isStackEmpty($stackerName)) {
+ if ($this->getStackInstance()->isStackEmpty($stackerName)) {
// This avoids an exception after all packages has failed
return;
} // END - if
// Pop the entry (it should be it)
- $nextData = $this->getStackerInstance()->popNamed($stackerName);
+ $nextData = $this->getStackInstance()->popNamed($stackerName);
// Compare both signatures
assert($nextData[self::PACKAGE_DATA_SIGNATURE] == $packageData[self::PACKAGE_DATA_SIGNATURE]);
$packageData[self::PACKAGE_DATA_STATUS] = $newStatus;
// And push it again
- $this->getStackerInstance()->pushNamed($stackerName, $packageData);
+ $this->getStackInstance()->pushNamed($stackerName, $packageData);
}
/**
// Now get an iterator
$iteratorInstance = $discoveryInstance->getIterator();
+ // Make sure the iterator instance is valid
+ assert($iteratorInstance instanceof Iterator);
+
// Rewind back to the beginning
$iteratorInstance->rewind();
$currentRecipient = $iteratorInstance->current();
// Debug message
- //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: Setting recipient to ' . $currentRecipient . ',previous=' . $packageData[self::PACKAGE_DATA_RECIPIENT]);
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: Setting recipient to ' . $currentRecipient . ',previous=' . $packageData[self::PACKAGE_DATA_RECIPIENT]);
// Set the recipient
$packageData[self::PACKAGE_DATA_RECIPIENT] = $currentRecipient;
// Push the declared package to the next stack.
- $this->getStackerInstance()->pushNamed(self::STACKER_NAME_DECLARED, $packageData);
+ $this->getStackInstance()->pushNamed(self::STACKER_NAME_DECLARED, $packageData);
// Debug message
- //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: Package declared for recipient ' . $currentRecipient);
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: Package declared for recipient ' . $currentRecipient);
// Skip to next entry
$iteratorInstance->next();
// And make sure it is valid
assert($helperInstance instanceof ConnectionHelper);
+ // Get connection info class
+ $infoInstance = ConnectionInfoFactory::createConnectionInfoInstance();
+
+ // Will the info instance with connection helper data
+ $infoInstance->fillWithConnectionHelperInformation($helperInstance);
+
// Is it not there?
- if ((is_resource($socketResource)) && (!$registryInstance->isSocketRegistered($helperInstance, $socketResource))) {
+ if ((is_resource($socketResource)) && (!$registryInstance->isSocketRegistered($infoInstance, $socketResource))) {
// Debug message
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: Registering socket ' . $socketResource . ' ...');
// Then register it
- $registryInstance->registerSocket($helperInstance, $socketResource, $packageData);
+ $registryInstance->registerSocket($infoInstance, $socketResource, $packageData);
} elseif (!$helperInstance->getStateInstance()->isPeerStateConnected()) {
// Is not connected, then we cannot send
self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: Unexpected peer state ' . $helperInstance->getStateInstance()->__toString() . ' detected.');
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: Reached line ' . __LINE__ . ' after validatePeerStateConnected() has been called.');
// Enqueue it again on the out-going queue, the connection is up and working at this point
- $this->getStackerInstance()->pushNamed(self::STACKER_NAME_OUTGOING, $packageData);
+ $this->getStackInstance()->pushNamed(self::STACKER_NAME_OUTGOING, $packageData);
// Debug message
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: Reached line ' . __LINE__ . ' after pushNamed() has been called.');
// Get the right connection instance
$helperInstance = SocketRegistryFactory::createSocketRegistryInstance()->getHandlerInstanceFromPackageData($packageData);
+ // Test helper instance
+ assert($helperInstance instanceof ConnectionHelper);
+
// Is this connection still alive?
if ($helperInstance->isShuttedDown()) {
// This connection is shutting down
// Is it the same?
//$isSignatureValid =
- exit(__METHOD__.': signature='.$signature.chr(10).',decodedArray='.print_r($decodedArray, TRUE));
+ exit(__METHOD__ . ': signature=' . $signature . chr(10) . ',decodedArray=' . print_r($decodedArray, TRUE));
}
/**
* from given helper's template instance and pushing it on the 'undeclared'
* stack.
*
- * @param $helperInstance An instance of a Helper class
- * @param $protocol Name of used protocol (TCP/UDP)
+ * @param $helperInstance An instance of a HubHelper class
* @return void
*/
- public function enqueueRawDataFromTemplate (Helper $helperInstance, $protocolName) {
+ public function enqueueRawDataFromTemplate (HubHelper $helperInstance) {
+ // Debug message
+ //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ': CALLED!');
+
// Get the raw content ...
$content = $helperInstance->getTemplateInstance()->getRawTemplateData();
//* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('content(' . strlen($content) . ')=' . $content);
$this->getHashFromContent($content)
);
+ // Debug message
+ //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ': Enqueueing package for recipientType=' . $helperInstance->getRecipientType() . ' ...');
+
// Now prepare the temporary array and push it on the 'undeclared' stack
- $this->getStackerInstance()->pushNamed(self::STACKER_NAME_UNDECLARED, array(
+ $this->getStackInstance()->pushNamed(self::STACKER_NAME_UNDECLARED, array(
self::PACKAGE_DATA_SENDER => $this->getSessionId(),
self::PACKAGE_DATA_RECIPIENT => $helperInstance->getRecipientType(),
- self::PACKAGE_DATA_PROTOCOL => $protocolName,
self::PACKAGE_DATA_CONTENT => $packageContent,
self::PACKAGE_DATA_STATUS => self::PACKAGE_STATUS_NEW,
self::PACKAGE_DATA_SIGNATURE => $this->generatePackageSignature($packageContent, $this->getSessionId())
));
+
+ // Debug message
+ //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ': EXIT!');
}
/**
*/
public function isPackageEnqueued () {
// Check whether the stacker is not empty
- $isEnqueued = (($this->getStackerInstance()->isStackInitialized(self::STACKER_NAME_UNDECLARED)) && (!$this->getStackerInstance()->isStackEmpty(self::STACKER_NAME_UNDECLARED)));
+ $isEnqueued = (($this->getStackInstance()->isStackInitialized(self::STACKER_NAME_UNDECLARED)) && (!$this->getStackInstance()->isStackEmpty(self::STACKER_NAME_UNDECLARED)));
// Return the result
return $isEnqueued;
*/
public function isPackageDeclared () {
// Check whether the stacker is not empty
- $isDeclared = (($this->getStackerInstance()->isStackInitialized(self::STACKER_NAME_DECLARED)) && (!$this->getStackerInstance()->isStackEmpty(self::STACKER_NAME_DECLARED)));
+ $isDeclared = (($this->getStackInstance()->isStackInitialized(self::STACKER_NAME_DECLARED)) && (!$this->getStackInstance()->isStackEmpty(self::STACKER_NAME_DECLARED)));
// Return the result
return $isDeclared;
*/
public function isPackageWaitingForDelivery () {
// Check whether the stacker is not empty
- $isWaitingDelivery = (($this->getStackerInstance()->isStackInitialized(self::STACKER_NAME_OUTGOING)) && (!$this->getStackerInstance()->isStackEmpty(self::STACKER_NAME_OUTGOING)));
+ $isWaitingDelivery = (($this->getStackInstance()->isStackInitialized(self::STACKER_NAME_OUTGOING)) && (!$this->getStackInstance()->isStackEmpty(self::STACKER_NAME_OUTGOING)));
// Return the result
return $isWaitingDelivery;
*/
public function isEncodedDataPending () {
// Check whether the stacker is not empty
- $isPending = (($this->getStackerInstance()->isStackInitialized(self::STACKER_NAME_OUTGOING_STREAM)) && (!$this->getStackerInstance()->isStackEmpty(self::STACKER_NAME_OUTGOING_STREAM)));
+ $isPending = (($this->getStackInstance()->isStackInitialized(self::STACKER_NAME_OUTGOING_STREAM)) && (!$this->getStackInstance()->isStackEmpty(self::STACKER_NAME_OUTGOING_STREAM)));
// Return the result
return $isPending;
* @throws NoTargetException If no target can't be determined
*/
public function declareEnqueuedPackage () {
+ // Debug message
+ //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ': CALLED!');
+
// Make sure this method isn't working if there is no package enqueued
if (!$this->isPackageEnqueued()) {
// This is not fatal but should be avoided
* Now there are for sure packages to deliver, so start with the first
* one.
*/
- $packageData = $this->getStackerInstance()->popNamed(self::STACKER_NAME_UNDECLARED);
+ $packageData = $this->getStackInstance()->popNamed(self::STACKER_NAME_UNDECLARED);
// Declare the raw package data for delivery
$this->declareRawPackageData($packageData);
+
+ // Debug message
+ //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ': EXIT!');
}
/**
* @return void
*/
public function processDeclaredPackage () {
+ // Debug message
+ //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ': CALLED!');
+
// Sanity check if we have packages declared
if (!$this->isPackageDeclared()) {
// This is not fatal but should be avoided
} // END - if
// Get the package
- $packageData = $this->getStackerInstance()->getNamed(self::STACKER_NAME_DECLARED);
+ $packageData = $this->getStackInstance()->getNamed(self::STACKER_NAME_DECLARED);
// Assert on it
assert(isset($packageData[self::PACKAGE_DATA_RECIPIENT]));
$this->deliverRawPackageData($packageData);
// And remove it finally
- $this->getStackerInstance()->popNamed(self::STACKER_NAME_DECLARED);
+ $this->getStackInstance()->popNamed(self::STACKER_NAME_DECLARED);
} catch (InvalidStateException $e) {
// The state is not excepected (shall be 'connected')
self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: Caught ' . $e->__toString() . ',message=' . $e->getMessage());
// Mark the package with status failed
$this->changePackageStatus($packageData, self::STACKER_NAME_DECLARED, self::PACKAGE_STATUS_FAILED);
}
+
+ // Debug message
+ //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ': EXIT!');
}
/**
* @return void
*/
public function sendWaitingPackage () {
+ // Debug message
+ /* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ': CALLED!');
+
// Sanity check if we have packages waiting for delivery
if (!$this->isPackageWaitingForDelivery()) {
// This is not fatal but should be avoided
} // END - if
// Get the package
- $packageData = $this->getStackerInstance()->getNamed(self::STACKER_NAME_OUTGOING);
+ $packageData = $this->getStackInstance()->getNamed(self::STACKER_NAME_OUTGOING);
try {
// Now try to send it
$this->sendOutgoingRawPackageData($packageData);
// And remove it finally
- $this->getStackerInstance()->popNamed(self::STACKER_NAME_OUTGOING);
+ $this->getStackInstance()->popNamed(self::STACKER_NAME_OUTGOING);
} catch (InvalidSocketException $e) {
// Output exception message
self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: Package was not delivered: ' . $e->getMessage());
// Mark package as failed
$this->changePackageStatus($packageData, self::STACKER_NAME_OUTGOING, self::PACKAGE_STATUS_FAILED);
}
+
+ // Debug message
+ /* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ': EXIT!');
}
/**
* @return void
*/
public function sendEncodedData () {
+ // Debug message
+ /* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ': CALLED!');
+
// Make sure there is pending encoded data
assert($this->isEncodedDataPending());
// Pop current data from stack
- $encodedDataArray = $this->getStackerInstance()->popNamed(self::STACKER_NAME_OUTGOING_STREAM);
+ $encodedDataArray = $this->getStackInstance()->popNamed(self::STACKER_NAME_OUTGOING_STREAM);
// Init in this round sent bytes
$sentBytes = 0;
}
// Push array back in stack
- $this->getStackerInstance()->pushNamed(self::STACKER_NAME_OUTGOING_STREAM, $encodedDataArray);
+ $this->getStackInstance()->pushNamed(self::STACKER_NAME_OUTGOING_STREAM, $encodedDataArray);
+
+ // Debug message
+ /* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ': EXIT!');
}
///////////////////////////////////////////////////////////////////////////
*/
private function isRawDataPending () {
// Just return whether the stack is not empty
- $isPending = (!$this->getStackerInstance()->isStackEmpty(self::STACKER_NAME_DECODED_INCOMING));
+ $isPending = (!$this->getStackInstance()->isStackEmpty(self::STACKER_NAME_DECODED_INCOMING));
// Return the status
return $isPending;
} // END - if
// Very noisy debug message:
- //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: Stacker size is ' . $this->getStackerInstance()->getStackCount(self::STACKER_NAME_DECODED_INCOMING) . ' entries.');
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: Stacker size is ' . $this->getStackInstance()->getStackCount(self::STACKER_NAME_DECODED_INCOMING) . ' entries.');
// "Pop" the next entry (the same array again) from the stack
- $decodedData = $this->getStackerInstance()->popNamed(self::STACKER_NAME_DECODED_INCOMING);
+ $decodedData = $this->getStackInstance()->popNamed(self::STACKER_NAME_DECODED_INCOMING);
// Make sure both array elements are there
assert(
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: errorCode=' . $decodedData[BaseRawDataHandler::PACKAGE_ERROR_CODE] . '(' . BaseRawDataHandler::SOCKET_ERROR_UNHANDLED . ')');
assert($decodedData[BaseRawDataHandler::PACKAGE_ERROR_CODE] == BaseRawDataHandler::SOCKET_ERROR_UNHANDLED);
- // Remove the last chunk SEPARATOR (because it is being added and we don't need it)
+ // Remove the last chunk SEPARATOR (because there is no need for it)
if (substr($decodedData[BaseRawDataHandler::PACKAGE_RAW_DATA], -1, 1) == PackageFragmenter::CHUNK_SEPARATOR) {
// It is there and should be removed
$decodedData[BaseRawDataHandler::PACKAGE_RAW_DATA] = substr($decodedData[BaseRawDataHandler::PACKAGE_RAW_DATA], 0, -1);
// This package is "handled" and can be pushed on the next stack
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: Pushing ' . strlen($decodedData[BaseRawDataHandler::PACKAGE_RAW_DATA]) . ' bytes to stack ' . self::STACKER_NAME_DECODED_HANDLED . ' ...');
- $this->getStackerInstance()->pushNamed(self::STACKER_NAME_DECODED_HANDLED, $decodedData);
+ $this->getStackInstance()->pushNamed(self::STACKER_NAME_DECODED_HANDLED, $decodedData);
}
/**
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: decodedData[' . gettype($decodedData) . ']=' . print_r($decodedData, TRUE));
// And push it on our stack
- $this->getStackerInstance()->pushNamed(self::STACKER_NAME_DECODED_INCOMING, $decodedData);
+ $this->getStackInstance()->pushNamed(self::STACKER_NAME_DECODED_INCOMING, $decodedData);
}
/**
*/
public function isIncomingRawDataHandled () {
// Determine if the stack is not empty
- $isHandled = (!$this->getStackerInstance()->isStackEmpty(self::STACKER_NAME_DECODED_HANDLED));
+ $isHandled = (!$this->getStackInstance()->isStackEmpty(self::STACKER_NAME_DECODED_HANDLED));
// Return it
return $isHandled;
return $isHandled;
}
+ /**
+ * Checks whether the assembler has multiple packages pending
+ *
+ * @return $isPending Whether the assembler has multiple packages pending
+ */
+ public function ifMultipleMessagesPending () {
+ // Determine if the stack is not empty
+ $isPending = ($this->getAssemblerInstance()->ifMultipleMessagesPending());
+
+ // Return it
+ return $isPending;
+ }
+
/**
* Handles the attached assemler's pending data queue to be finally
* assembled to the raw package data back.
$this->getAssemblerInstance()->handlePendingData();
}
+ /**
+ * Handles multiple messages.
+ *
+ * @return void
+ */
+ public function handleMultipleMessages () {
+ // Handle it
+ $this->getAssemblerInstance()->handleMultipleMessages();
+ }
+
/**
* Assembles incoming decoded data so it will become an abstract network
* package again. The assembler does later do it's job by an other task,
assert($this->isIncomingRawDataHandled());
// Get current package content (an array with two elements; see handleIncomingDecodedData() for details)
- $packageContent = $this->getStackerInstance()->getNamed(self::STACKER_NAME_DECODED_HANDLED);
+ $packageContent = $this->getStackInstance()->getNamed(self::STACKER_NAME_DECODED_HANDLED);
// Assert on some elements
assert(
$this->getAssemblerInstance()->chunkPackageContent($packageContent);
// Remove the package from 'handled_decoded' stack ...
- $this->getStackerInstance()->popNamed(self::STACKER_NAME_DECODED_HANDLED);
+ $this->getStackInstance()->popNamed(self::STACKER_NAME_DECODED_HANDLED);
// ... and push it on the 'chunked' stacker
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: Pushing ' . strlen($packageContent[BaseRawDataHandler::PACKAGE_RAW_DATA]) . ' bytes on stack ' . self::STACKER_NAME_DECODED_CHUNKED . ',packageContent=' . print_r($packageContent, TRUE));
- $this->getStackerInstance()->pushNamed(self::STACKER_NAME_DECODED_CHUNKED, $packageContent);
+ $this->getStackInstance()->pushNamed(self::STACKER_NAME_DECODED_CHUNKED, $packageContent);
}
/**
*/
public function accept (Visitor $visitorInstance) {
// Debug message
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: ' . $visitorInstance->__toString() . ' has visited - START');
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: ' . $visitorInstance->__toString() . ' has visited - CALLED!');
// Visit the package
$visitorInstance->visitNetworkPackage($this);
$this->getAssemblerInstance()->accept($visitorInstance);
// Debug message
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: ' . $visitorInstance->__toString() . ' has visited - FINISHED');
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: ' . $visitorInstance->__toString() . ' has visited - EXIT!');
}
/**
*/
public function removeFirstFailedPackage () {
// Get the package again
- $packageData = $this->getStackerInstance()->getNamed(self::STACKER_NAME_DECLARED);
+ $packageData = $this->getStackInstance()->getNamed(self::STACKER_NAME_DECLARED);
// Is the package status 'failed'?
if ($packageData[self::PACKAGE_DATA_STATUS] != self::PACKAGE_STATUS_FAILED) {
} // END - if
// Remove this entry
- $this->getStackerInstance()->popNamed(self::STACKER_NAME_DECLARED);
+ $this->getStackInstance()->popNamed(self::STACKER_NAME_DECLARED);
}
/**
$decodedContent[self::PACKAGE_CONTENT_MESSAGE] = $this->getCompressorInstance()->decompressStream($decodedContent[self::PACKAGE_CONTENT_MESSAGE]);
// And push it on the next stack
- $this->getStackerInstance()->pushNamed(self::STACKER_NAME_NEW_MESSAGE, $decodedContent);
+ $this->getStackInstance()->pushNamed(self::STACKER_NAME_NEW_MESSAGE, $decodedContent);
}
/**
*/
public function isNewMessageArrived () {
// Determine if the stack is not empty
- $hasArrived = (!$this->getStackerInstance()->isStackEmpty(self::STACKER_NAME_NEW_MESSAGE));
+ $hasArrived = (!$this->getStackInstance()->isStackEmpty(self::STACKER_NAME_NEW_MESSAGE));
// Return it
return $hasArrived;
*/
public function handleNewlyArrivedMessage () {
// Get it from the stacker, it is the full array with the decoded message
- $decodedContent = $this->getStackerInstance()->popNamed(self::STACKER_NAME_NEW_MESSAGE);
+ $decodedContent = $this->getStackInstance()->popNamed(self::STACKER_NAME_NEW_MESSAGE);
// Now get a filter chain back from factory with given tags array
$chainInstance = PackageFilterChainFactory::createChainByTagsArray($decodedContent[self::PACKAGE_CONTENT_TAGS]);
*/
public function isProcessedMessagePending () {
// Check it
- $isPending = (!$this->getStackerInstance()->isStackEmpty(self::STACKER_NAME_PROCESSED_MESSAGE));
+ $isPending = (!$this->getStackInstance()->isStackEmpty(self::STACKER_NAME_PROCESSED_MESSAGE));
// Return it
return $isPending;
*/
public function handleProcessedMessage () {
// Get it from the stacker, it is the full array with the processed message
- $messageArray = $this->getStackerInstance()->popNamed(self::STACKER_NAME_PROCESSED_MESSAGE);
+ $messageArray = $this->getStackInstance()->popNamed(self::STACKER_NAME_PROCESSED_MESSAGE);
// Add type for later easier handling
$messageArray[self::MESSAGE_ARRAY_DATA][self::MESSAGE_ARRAY_TYPE] = $messageArray[self::MESSAGE_ARRAY_TYPE];