From: Roland Häder Date: Tue, 12 Feb 2013 10:13:20 +0000 (+0000) Subject: Moved to generic class BaseHandler and interface Handleable X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=ad45b22b26e0788c4b53451efca9065ea1a26805;p=hub.git Moved to generic class BaseHandler and interface Handleable --- diff --git a/application/hub/interfaces/handler/class_Handleable.php b/application/hub/interfaces/handler/class_Handleable.php index a55ac2b1b..fe1a0dfb6 100644 --- a/application/hub/interfaces/handler/class_Handleable.php +++ b/application/hub/interfaces/handler/class_Handleable.php @@ -22,6 +22,14 @@ * along with this program. If not, see . */ interface Handleable extends FrameworkInterface { + /** + * Adds all required elements from given array into data set instance + * + * @param $dataSetInstance An instance of a StoreableCriteria class + * @param $messageData An array with all message data + * @return void + */ + function addArrayToDataSet (StoreableCriteria $dataSetInstance, array $messageData); } // [EOF] diff --git a/application/hub/interfaces/handler/message-types/class_HandleableMessage.php b/application/hub/interfaces/handler/message-types/class_HandleableMessage.php index dc090eafb..9f55c5963 100644 --- a/application/hub/interfaces/handler/message-types/class_HandleableMessage.php +++ b/application/hub/interfaces/handler/message-types/class_HandleableMessage.php @@ -30,15 +30,6 @@ interface HandleableMessage extends Handleable { * @return void */ function handleMessageData (array $messageData, Receivable $packageInstance); - - /** - * Adds all required elements from given array into data set instance - * - * @param $dataSetInstance An instance of a StoreableCriteria class - * @param $messageData An array with all message data - * @return void - */ - function addArrayToDataSet (StoreableCriteria $dataSetInstance, array $messageData); } // [EOF] diff --git a/application/hub/main/handler/answer-status/class_BaseAnserStatusHandler.php b/application/hub/main/handler/answer-status/class_BaseAnserStatusHandler.php index e3c81adaa..6fea337ff 100644 --- a/application/hub/main/handler/answer-status/class_BaseAnserStatusHandler.php +++ b/application/hub/main/handler/answer-status/class_BaseAnserStatusHandler.php @@ -43,22 +43,6 @@ abstract class BaseAnserStatusHandler extends BaseDataHandler { // Call parent constructor parent::__construct($className); } - - /** - * Adds all required elements from given array into data set instance - * - * @param $dataSetInstance An instance of a StoreableCriteria class - * @param $messageData An array with all message data - * @return void - * @todo Rewrite this to use DHT - */ - public function addArrayToDataSet (StoreableCriteria $dataSetInstance, array $messageData) { - // Add some generic data all messageData arrays provide - /* - $dataSetInstance->addCriteria(NodeListDatabaseWrapper::DB_COLUMN_ANSWER_STATUS, $messageData[BaseXmlAnswerTemplateEngine::ANSWER_STATUS]); - $dataSetInstance->addCriteria(NodeListDatabaseWrapper::DB_COLUMN_MESSAGE_TYPE , $messageData[NetworkPackage::MESSAGE_ARRAY_TYPE]); - */ - } } // [EOF] diff --git a/application/hub/main/handler/answer-status/requests/class_RequestNodeListAnswerOkayHandler.php b/application/hub/main/handler/answer-status/requests/class_RequestNodeListAnswerOkayHandler.php index c3f775789..cca50dab4 100644 --- a/application/hub/main/handler/answer-status/requests/class_RequestNodeListAnswerOkayHandler.php +++ b/application/hub/main/handler/answer-status/requests/class_RequestNodeListAnswerOkayHandler.php @@ -66,7 +66,7 @@ class RequestNodeListAnswerOkayHandler extends BaseAnserStatusHandler implements $searchInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class'); // Lookup external session id/external IP/port - $searchInstance->addCriteria('node_session_id' , $messageData[XmlRequestNodeListAnswerTemplateEngine::REQUEST_DATA_SESSION_ID]); + $searchInstance->addCriteria('session_id' , $messageData[XmlRequestNodeListAnswerTemplateEngine::REQUEST_DATA_SESSION_ID]); // Only one entry is fine $searchInstance->setLimit(1); diff --git a/application/hub/main/handler/class_BaseHandler.php b/application/hub/main/handler/class_BaseHandler.php index d73a461b3..c2146e0ee 100644 --- a/application/hub/main/handler/class_BaseHandler.php +++ b/application/hub/main/handler/class_BaseHandler.php @@ -56,6 +56,22 @@ class BaseHandler extends BaseHubSystem implements Handleable { protected final function setHandlerName ($handlerName) { $this->handlerName = $handlerName; } + + /** + * Adds all required elements from given array into data set instance + * + * @param $dataSetInstance An instance of a StoreableCriteria class + * @param $messageData An array with all message data + * @return void + * @todo Rewrite this to use DHT + */ + public function addArrayToDataSet (StoreableCriteria $dataSetInstance, array $messageData) { + // Add some generic data all messageData arrays provide + /* + $dataSetInstance->addCriteria(NodeListDatabaseWrapper::DB_COLUMN_ANSWER_STATUS, $messageData[BaseXmlAnswerTemplateEngine::ANSWER_STATUS]); + $dataSetInstance->addCriteria(NodeListDatabaseWrapper::DB_COLUMN_MESSAGE_TYPE , $messageData[NetworkPackage::MESSAGE_ARRAY_TYPE]); + */ + } } // [EOF]