Added parameter to set last thrown exception for status handling
authorRoland Häder <roland@mxchange.org>
Wed, 13 Feb 2013 02:04:08 +0000 (02:04 +0000)
committerRoland Häder <roland@mxchange.org>
Wed, 13 Feb 2013 02:04:08 +0000 (02:04 +0000)
application/hub/interfaces/distributable/class_Distributable.php
application/hub/main/dht/node/class_NodeDhtFacade.php
application/hub/main/handler/message-types/requests/class_NodeMessageRequestNodeListHandler.php

index 0c85f6d6415822abfc96ff4ff649d60098eaff50..f620265466d7be280f2a8721522e6f170275b505 100644 (file)
@@ -56,13 +56,14 @@ interface Distributable extends FrameworkInterface {
         * Queries the local DHT data(base) for a node list with all supported
         * object types except the node by given session id.
         *
-        * @param       $messageData    An array with message data from a node_list request
-        * @param       $excludeKey             Array key which should be excluded
-        * @param       $andKey                 Array of $separator-separated list of elements which all must match
-        * @param       $separator              Sepator char (1st parameter for explode() call)
-        * @return      $nodeList               An array with all found nodes
+        * @param       $messageData            An array with message data from a node_list request
+        * @param       $handlerInstance        An instance of a Handleable class
+        * @param       $excludeKey                     Array key which should be excluded
+        * @param       $andKey                         Array of $separator-separated list of elements which all must match
+        * @param       $separator                      Sepator char (1st parameter for explode() call)
+        * @return      $nodeList                       An array with all found nodes
         */
-       function queryLocalNodeListExceptByMessageData (array $messageData, $excludeKey, $andKey, $separator);
+       function queryLocalNodeListExceptByMessageData (array $messageData, Handleable $handlerInstance, $excludeKey, $andKey, $separator);
 }
 
 // [EOF]
index 111b9ed9da36b2704a49bbdc71b4e8828516d913..6cd1846cfa62771fb0ab038524e2bf7d585f0eb6 100644 (file)
@@ -154,13 +154,14 @@ class NodeDhtFacade extends BaseDht implements Distributable, Registerable {
         * Queries the local DHT data(base) for a node list with all supported
         * object types except the node by given session id.
         *
-        * @param       $messageData    An array with message data from a node_list request
-        * @param       $excludeKey             Array key which should be excluded
-        * @param       $andKey                 Array of $separator-separated list of elements which all must match
-        * @param       $separator              Sepator char (1st parameter for explode() call)
-        * @return      $nodeList               An array with all found nodes
+        * @param       $messageData            An array with message data from a node_list request
+        * @param       $handlerInstance        An instance of a Handleable class
+        * @param       $excludeKey                     Array key which should be excluded
+        * @param       $andKey                         Array of $separator-separated list of elements which all must match
+        * @param       $separator                      Sepator char (1st parameter for explode() call)
+        * @return      $nodeList                       An array with all found nodes
         */
-       public function queryLocalNodeListExceptByMessageData (array $messageData, $excludeKey, $andKey, $separator) {
+       public function queryLocalNodeListExceptByMessageData (array $messageData, Handleable $handlerInstance, $excludeKey, $andKey, $separator) {
                // Make sure both keys are there
                assert((isset($messageData[$excludeKey])) && (isset($messageData[$andKey])));
 
index c52a4df438c7d892ae69faa3f161e114b5f6a087..ad7636617883fb53b6784667ef079cbf0e3ce936 100644 (file)
@@ -137,8 +137,8 @@ class NodeMessageRequestNodeListHandler extends BaseMessageHandler implements Ha
                $this->getConfigInstance()->setConfigEntry('answer_status', $statusCode);
 
                // Query local DHT for nodes except given session id
-               $nodeList = $this->getDhtInstance()->queryLocalNodeListExceptByMessageData($messageData, XmlRequestNodeListTemplateEngine::REQUEST_DATA_SESSION_ID, XmlRequestNodeListTemplateEngine::REQUEST_DATA_ACCEPTED_OBJECT_TYPES, ',');
-               die('nodeList='.print_r($nodeList, true));
+               $nodeList = $this->getDhtInstance()->queryLocalNodeListExceptByMessageData($messageData, $this, XmlRequestNodeListTemplateEngine::REQUEST_DATA_SESSION_ID, XmlRequestNodeListTemplateEngine::REQUEST_DATA_ACCEPTED_OBJECT_TYPES, ',');
+               die(__METHOD__ . ':nodeList='.print_r($nodeList, true));
        }
 
        /**