* @version 0.0.0 * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team * @license GNU GPL 3.0 or any newer version * @link http://www.ship-simu.org * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ interface Distributable extends FrameworkInterface { /** * Initializes the distributable hash table (DHT) * * @return void */ function initDht (); /** * Finds a node locally by given session id * * @param $sessionId Session id to lookup * @return $nodeData Node data array */ function findNodeLocalBySessionId ($sessionId); /** * Registers an other node with this node by given message data. The * following data must always be present: * * - session-id (for finding the node's record together with below data) * - external-ip (hostname or IP number) * - listen-port (TCP/UDP listen port for inbound connections) * * @param $messageData An array with all minimum message data * @param $handlerInstance An instance of a Handleable class * @param $forceUpdate Optionally force update, don't register (default: register if not found) * @return void */ function registerNodeByMessageData (array $messageData, Handleable $handlerInstance, $forceUpdate = FALSE); /** * 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 $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, Handleable $handlerInstance, $excludeKey, $andKey, $separator); /** * Inserts given node list array (from earlier database result produced by * an other node) into the DHT. This array origins from above method * queryLocalNodeListExceptByMessageData(). * * @param $nodeList An array from an earlier database result instance * @return void */ function insertNodeList (array $nodeList); } // [EOF] ?>