From ee61b6f76e197afd289b08379ecbf5ed7e35ddf9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Wed, 13 Feb 2013 02:04:08 +0000 Subject: [PATCH] Added parameter to set last thrown exception for status handling --- .../distributable/class_Distributable.php | 13 +++++++------ .../hub/main/dht/node/class_NodeDhtFacade.php | 13 +++++++------ .../class_NodeMessageRequestNodeListHandler.php | 4 ++-- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/application/hub/interfaces/distributable/class_Distributable.php b/application/hub/interfaces/distributable/class_Distributable.php index 0c85f6d64..f62026546 100644 --- a/application/hub/interfaces/distributable/class_Distributable.php +++ b/application/hub/interfaces/distributable/class_Distributable.php @@ -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] diff --git a/application/hub/main/dht/node/class_NodeDhtFacade.php b/application/hub/main/dht/node/class_NodeDhtFacade.php index 111b9ed9d..6cd1846cf 100644 --- a/application/hub/main/dht/node/class_NodeDhtFacade.php +++ b/application/hub/main/dht/node/class_NodeDhtFacade.php @@ -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]))); 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 c52a4df43..ad7636617 100644 --- a/application/hub/main/handler/message-types/requests/class_NodeMessageRequestNodeListHandler.php +++ b/application/hub/main/handler/message-types/requests/class_NodeMessageRequestNodeListHandler.php @@ -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)); } /** -- 2.39.2