From: Roland Häder Date: Wed, 13 Feb 2013 02:04:08 +0000 (+0000) Subject: Added parameter to set last thrown exception for status handling X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=ee61b6f76e197afd289b08379ecbf5ed7e35ddf9;p=hub.git Added parameter to set last thrown exception for status handling --- 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)); } /**