From: Roland Häder Date: Tue, 12 Feb 2013 05:19:00 +0000 (+0000) Subject: No node_ prefix as it makes session id look-ups invalid X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=510718eb116b95f6f78437b5272a58cfa3d88af2;p=hub.git No node_ prefix as it makes session id look-ups invalid --- diff --git a/application/hub/main/dht/node/class_NodeDhtFacade.php b/application/hub/main/dht/node/class_NodeDhtFacade.php index 227c99e00..b71b7eaa3 100644 --- a/application/hub/main/dht/node/class_NodeDhtFacade.php +++ b/application/hub/main/dht/node/class_NodeDhtFacade.php @@ -119,7 +119,7 @@ class NodeDhtFacade extends BaseDht implements Distributable, Registerable { assert(isset($messageData[$key])); // Add criteria - $searchInstance->addCriteria('node_' . str_replace('my-', '', $key), $messageData[$key]); + $searchInstance->addCriteria(str_replace('my-', '', $key), $messageData[$key]); } // END - foreach // Only one entry is fine diff --git a/application/hub/main/handler/message-types/anouncement/class_NodeMessageAnnouncementHandler.php b/application/hub/main/handler/message-types/anouncement/class_NodeMessageAnnouncementHandler.php index f83f7fa66..f1f954c90 100644 --- a/application/hub/main/handler/message-types/anouncement/class_NodeMessageAnnouncementHandler.php +++ b/application/hub/main/handler/message-types/anouncement/class_NodeMessageAnnouncementHandler.php @@ -116,13 +116,16 @@ class NodeMessageAnnouncementHandler extends BaseMessageHandler implements Handl * @return void */ public function addArrayToDataSet (StoreableCriteria $dataSetInstance, array $messageData) { + // Add generic first + parent::addArrayToDataSet($dataSetInstance, $messageData); + // Add all ements foreach ($this->messageDataElements as $key) { // Is it there? assert(isset($messageData[$key])); // Add it - $dataSetInstance->addCriteria('node_' . $key, $messageData[$key]); + $dataSetInstance->addCriteria($key, $messageData[$key]); } // END - foreach } diff --git a/application/hub/main/handler/message-types/answer/class_NodeMessageAnnouncementAnswerHandler.php b/application/hub/main/handler/message-types/answer/class_NodeMessageAnnouncementAnswerHandler.php index cd2db6bd2..c0b1461db 100644 --- a/application/hub/main/handler/message-types/answer/class_NodeMessageAnnouncementAnswerHandler.php +++ b/application/hub/main/handler/message-types/answer/class_NodeMessageAnnouncementAnswerHandler.php @@ -119,6 +119,9 @@ class NodeMessageAnnouncementAnswerHandler extends BaseMessageHandler implements * @return void */ public function addArrayToDataSet (StoreableCriteria $dataSetInstance, array $messageData) { + // Add generic first + parent::addArrayToDataSet($dataSetInstance, $messageData); + // Add all ements foreach ($this->messageDataElements as $key) { // Is it there? @@ -128,7 +131,7 @@ class NodeMessageAnnouncementAnswerHandler extends BaseMessageHandler implements * Add it, but remove any 'my-' prefixes as they are not used in * database layer. */ - $dataSetInstance->addCriteria('node_' . str_replace('my-', '', $key), $messageData[$key]); + $dataSetInstance->addCriteria(str_replace('my-', '', $key), $messageData[$key]); } // END - foreach } diff --git a/application/hub/main/handler/message-types/answer/class_NodeMessageRequestNodeListAnswerHandler.php b/application/hub/main/handler/message-types/answer/class_NodeMessageRequestNodeListAnswerHandler.php index e8cf9f6c3..0eaed3b51 100644 --- a/application/hub/main/handler/message-types/answer/class_NodeMessageRequestNodeListAnswerHandler.php +++ b/application/hub/main/handler/message-types/answer/class_NodeMessageRequestNodeListAnswerHandler.php @@ -103,6 +103,9 @@ class NodeMessageRequestNodeListAnswerHandler extends BaseMessageHandler impleme * @return void */ public function addArrayToDataSet (StoreableCriteria $dataSetInstance, array $messageData) { + // Add generic first + parent::addArrayToDataSet($dataSetInstance, $messageData); + // Debug message /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('ANSWER-HANDLER: messageData=' . print_r($messageData, true)); @@ -118,7 +121,7 @@ class NodeMessageRequestNodeListAnswerHandler extends BaseMessageHandler impleme * Add it, but remove any 'my-' prefixes as they are not used in * database layer. */ - $dataSetInstance->addCriteria('node_' . str_replace('my-', '', $key), $messageData[$key]); + $dataSetInstance->addCriteria(str_replace('my-', '', $key), $messageData[$key]); } // END - foreach } diff --git a/application/hub/main/handler/message-types/class_ b/application/hub/main/handler/message-types/class_ index 98b417ed7..d36ac50cc 100644 --- a/application/hub/main/handler/message-types/class_ +++ b/application/hub/main/handler/message-types/class_ @@ -85,7 +85,7 @@ class NodeMessage???Handler extends BaseMessageHandler implements HandleableMess assert(isset($messageData[$key])); // Add it - $dataSetInstance->addCriteria('node_' . $key, $messageData[$key]); + $dataSetInstance->addCriteria($key, $messageData[$key]); } // END - foreach } diff --git a/application/hub/main/handler/message-types/requests/class_NodeMessageRequestNodeListHandler.php b/application/hub/main/handler/message-types/requests/class_NodeMessageRequestNodeListHandler.php index 91678068b..1c1f08b17 100644 --- a/application/hub/main/handler/message-types/requests/class_NodeMessageRequestNodeListHandler.php +++ b/application/hub/main/handler/message-types/requests/class_NodeMessageRequestNodeListHandler.php @@ -98,13 +98,16 @@ class NodeMessageRequestNodeListHandler extends BaseMessageHandler implements Ha * @return void */ public function addArrayToDataSet (StoreableCriteria $dataSetInstance, array $messageData) { + // Add generic first + parent::addArrayToDataSet($dataSetInstance, $messageData); + // Add all ements foreach ($this->messageDataElements as $key) { // Is it there? assert(isset($messageData[$key])); // Add it - $dataSetInstance->addCriteria('node_' . $key, $messageData[$key]); + $dataSetInstance->addCriteria($key, $messageData[$key]); } // END - foreach } diff --git a/application/hub/main/handler/message-types/self-connect/class_NodeMessageSelfConnectHandler.php b/application/hub/main/handler/message-types/self-connect/class_NodeMessageSelfConnectHandler.php index 81c7d830a..fe8a5af72 100644 --- a/application/hub/main/handler/message-types/self-connect/class_NodeMessageSelfConnectHandler.php +++ b/application/hub/main/handler/message-types/self-connect/class_NodeMessageSelfConnectHandler.php @@ -82,6 +82,9 @@ class NodeMessageSelfConnectHandler extends BaseMessageHandler implements Handle * @throws UnsupportedOperationException If this method is called */ public function addArrayToDataSet (StoreableCriteria $dataSetInstance, array $messageData) { + // Add generic first + parent::addArrayToDataSet($dataSetInstance, $messageData); + // Please don't call this method! throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION); }