function initDht ();
/**
- * Finds a node by given session id
+ * Finds a node locally by given session id
*
* @param $sessionId Session id to lookup
* @return $nodeData Node data array
*/
- function findNodeBySessionId ($sessionId);
+ function findNodeLocalBySessionId ($sessionId);
/**
* Registers an other node with this node by given message data. The
function updateLocalNode ();
/**
- * Finds a node by given session id
+ * Finds a node locally by given session id
*
* @param $sessionId Session id to lookup
* @return $nodeData Node data array
*/
- function findNodeBySessionId ($sessionId);
+ function findNodeLocalBySessionId ($sessionId);
}
// [EOF]
}
/**
- * Finds a node by given session id
+ * Finds a node locally by given session id
*
* @param $sessionId Session id to lookup
* @return $nodeData Node data array
*/
- public function findNodeBySessionId ($sessionId) {
+ public function findNodeLocalBySessionId ($sessionId) {
// Get search criteria
$searchInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class');
}
/**
- * Finds a node by given session id
+ * Finds a node locally by given session id
*
* @param $sessionId Session id to lookup
* @return $nodeData Node data array
*/
- public function findNodeBySessionId ($sessionId) {
+ public function findNodeLocalBySessionId ($sessionId) {
// Default is empty data array
$nodeData = array();
// Call the wrapper to do the job and get back a result instance
- $resultInstance = $this->getWrapperInstance()->findNodeBySessionId($sessionId);
+ $resultInstance = $this->getWrapperInstance()->findNodeLocalBySessionId($sessionId);
// Is the next entry valid?
if ($resultInstance->next()) {
$this->getConfigInstance()->setConfigEntry($targetKey, $this->getConfigInstance()->getConfigEntry($sourceKey));
} // END - foreach
+ // Query local DHT for nodes except given session id
+ $nodeList = $this->getDhtInstance()->queryLocalNodeListExceptByMessageData($messageData, $this, XmlRequestNodeListTemplateEngine::REQUEST_DATA_SESSION_ID, XmlRequestNodeListTemplateEngine::REQUEST_DATA_ACCEPTED_OBJECT_TYPES, ',');
+
+ // Set it serialized in configuration (temporarily)
+ $this->getConfigInstance()->setConfigEntry('node_list', base64_encode(serialize($nodeList)));
+
// Translate last exception into a status code
$statusCode = $this->getTranslatedStatusFromLastException();
// Set it in configuration (temporarily)
$this->getConfigInstance()->setConfigEntry('answer_status', $statusCode);
-
- // Query local DHT for nodes except given session id
- $nodeList = $this->getDhtInstance()->queryLocalNodeListExceptByMessageData($messageData, $this, XmlRequestNodeListTemplateEngine::REQUEST_DATA_SESSION_ID, XmlRequestNodeListTemplateEngine::REQUEST_DATA_ACCEPTED_OBJECT_TYPES, ',');
- die(__METHOD__ . ':nodeList='.print_r($nodeList, true));
}
/**
$recipientIpPort = 'invalid:invalid';
// And ask it for ip:port by given session id
- $recipient = $this->getDhtInstance()->findNodeBySessionId($sessionId);
+ $recipient = $this->getDhtInstance()->findNodeLocalBySessionId($sessionId);
// Is the recipient valid?
if ((isset($recipient[NodeDistributedHashTableDatabaseWrapper::DB_COLUMN_EXTERNAL_IP])) && (isset($recipient[NodeDistributedHashTableDatabaseWrapper::DB_COLUMN_LISTEN_PORT]))) {