// CFG: PACKAGE-STACKER-CLASS
$cfg->setConfigEntry('network_package_stacker_class', 'FiFoStacker');
+// CFG: NODE-RAW-DATA-STACKER-CLASS
+$cfg->setConfigEntry('node_raw_data_stacker_class', 'FiFoStacker');
+
// CFG: PRODUCER-OUTGOING-QUEUE
$cfg->setConfigEntry('producer_outgoing_queue', 'FiFoStacker');
* @throws InvalidListHashException If the solved hash index is invalid
*/
function updateCurrentEntryByHash ($hash, array $entryArray);
+
+ /**
+ * "Getter" for an iterator instance of this list
+ *
+ * @return $iteratorInstance An instance of a Iterator class
+ */
+ function getListIterator ();
}
// [EOF]
$connectorInstance->setListInstance($listInstance);
// Prepare iterator instance
- $iteratorInstance = ObjectFactory::createObjectByConfiguredName('query_iterator_class', array($listInstance));
+ $iteratorInstance = $listInstance->getListIterator();
// Set it, too
$connectorInstance->setIteratorInstance($iteratorInstance);
// Set it in this network-package handler
$this->setInputStreamInstance($streamInstance);
+
+ // Init stacker instance for processed raw data
+ $stackerInstance = ObjectFactory::createObjectByConfiguredName('node_raw_data_stacker_class');
+
+ // Remember this in this package handler
+ $this->setStackerInstance($stackerInstance);
+
+ // Init stacker
+ $this->initStacker();
+ }
+
+ /**
+ * Initializes the stacker for raw data
+ *
+ * @return void
+ */
+ protected function initStacker () {
+ $this->getStackerInstance()->initStacker('raw_data');
+ }
+
+ /**
+ * Adds given decoded data to the raw data stacker
+ *
+ * @param $decodedData Decoded data from the socket resource
+ * @return void
+ */
+ protected function addDecodedDataToStacker ($decodedData) {
+ // Add it
+ $this->getStackerInstance()->pushNamed('raw_data', array(
+ 'decoded_data' => $decodedData,
+ 'error_code' => $this->getErrorCode()
+ ));
}
/**
// Get new instance
$handlerInstance = new TcpNetworkPackageHandler();
- // Init stacker instance for processed raw data
- $stackerInstance = ObjectFactory::createObjectByConfiguredName('
// Return the prepared instance
return $handlerInstance;
}
}
// Add the (maybe above decoded) data and error code to the stacker
+ $this->addRawDataToStacker($decodedData);
}
}
* @param $packageData Raw package data
* @return $accepts Wether this listener does accept
*/
- function ifListenerAcceptsPackageData (array $packageData) {
- $this->partialStub('This call should not happen. Please report.');
+ public function ifListenerAcceptsPackageData (array $packageData) {
+ $this->partialStub('This call should not happen. Please report it.');
}
}
// Return the prepared instance
return $listInstance;
}
-}
+
+ /**
+ * "Getter" for an iterator instance of this list
+ *
+ * @return $iteratorInstance An instance of a Iterator class
+ * @todo 0% done
+ */
+ public function getListIterator () {
+ $this->partialStub('Please implement this method.');
+ }
// [EOF]
?>
// Return the prepared instance
return $listInstance;
}
+
+ /**
+ * "Getter" for an iterator instance of this list
+ *
+ * @return $iteratorInstance An instance of a Iterator class
+ * @todo0% done
+ */
+ public function getListIterator () {
+ $this->partialStub('Please implement this method.');
+ }
}
// [EOF]
// Return the prepared instance
return $listInstance;
}
+
+ /**
+ * "Getter" for an iterator instance of this list
+ *
+ * @return $iteratorInstance An instance of a Iterator class
+ */
+ public function getListIterator () {
+ // Get the iterator instance from the factory
+ $iteratorInstance = ObjectFactory::createObjectByConfiguredName('hub_ping_iterator_class', array($this));
+
+ // Rewind it
+ $iteratorInstance->rewind();
+
+ // ... and return it
+ return $iteratorInstance;
+ }
}
-//
+// [EOF]
?>
// Return the prepared instance
return $listInstance;
}
+
+ /**
+ * "Getter" for iterator from this list
+ *
+ * @return $iteratorInstance An instance of a Iterator class
+ */
+ public function getListIterator () {
+ // Get the instance from factory
+ $iteratorInstance = ObjectFactory::createObjectByConfiguredName('query_iterator_class', array($this));
+
+ // Rewind it
+ $iteratorInstance->rewind();
+
+ // ... and return it
+ return $iteratorInstance;
+ }
}
// [EOF]
// Return the prepared instance
return $listInstance;
}
+
+ /**
+ * "Getter" for an iterator instance of this list
+ *
+ * @return $iteratorInstance An instance of a Iterator class
+ * @todo0% done
+ */
+ public function getListIterator () {
+ $this->partialStub('Please implement this method.');
+ }
}
// [EOF]
// Return the prepared instance
return $listInstance;
}
+
+ /**
+ * "Getter" for an iterator instance of this list
+ *
+ * @return $iteratorInstance An instance of a Iterator class
+ * @todo0% done
+ */
+ public function getListIterator () {
+ $this->partialStub('Please implement this method.');
+ }
}
// [EOF]
$taskInstance->setListInstance($listInstance);
// Init ping iterator instance
- $iteratorInstance = ObjectFactory::createObjectByConfiguredName('hub_ping_iterator_class', array($listInstance));
+ $iteratorInstance = $listInstance->getListIterator();
// Set it as well
$taskInstance->setIteratorInstance($iteratorInstance);