*
* @author Roland Haeder <webmaster@shipsimu.org>
* @version 0.0.0
- * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
* @license GNU GPL 3.0 or any newer version
* @link http://www.shipsimu.org
*
function bootstrapDht ();
/**
- * 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)
+ * Updates/refreshes DHT data (e.g. status).
*
- * @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);
+ function updateDhtData ();
/**
- * Queries the local DHT data(base) for a node list with all supported
- * object types except the node by given session id.
+ * Checks whether there are unpublished entries
*
- * @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
+ * @return $hasUnpublished Whether there are unpublished entries
*/
- function queryLocalNodeListExceptByMessageData (array $messageData, Handleable $handlerInstance, $excludeKey, $andKey, $separator);
+ function hasUnpublishedEntries ();
/**
- * Inserts given node list array (from earlier database result produced by
- * an other node) into the DHT. This array origins from above method
- * queryLocalNodeListExceptByMessageData().
+ * Initializes publication of DHT entries. This does only prepare
+ * publication. The next step is to pickup such prepared entries and publish
+ * them by uploading to other (recently appeared) DHT members.
*
- * @param $nodeList An array from an earlier database result instance
* @return void
*/
- function insertNodeList (array $nodeList);
+ function initEntryPublication ();
/**
- * Updates/refreshes DHT data (e.g. status).
+ * Checks whether there are entries pending publication
*
- * @return void
+ * @return $isPending Whether there are entries pending publication
*/
- function updateDhtData ();
+ function hasEntriesPendingPublication ();
/**
- * Checks whether there are entries in "INSERT" node data stack
+ * Publishes next entry found in stack. This method shall also update the
+ * corresponding dabase entry.
*
- * @return $isPending Whether there are pending entries
+ * @return void
*/
- function ifInsertNodeDataPending ();
+ function publishEntry ();
/**
- * Inserts a single entry of node data into the DHT
+ * Find recipients for given package data
*
- * @return void
+ * @param $packageData An array of valid package data
+ * @return $recipients An indexed array with DHT recipients
*/
- function insertSingleNodeData ();
+ function findRecipientsByPackageData (array $packageData);
/**
- * Checks whether there are unpublished entries
+ * Whether the DHT has fully bootstrapped (after state 'booting')
*
- * @return $hasUnpublished Whether there are unpublished entries
+ * @return $isFullyBooted Whether the DHT is fully booted
*/
- function hasUnpublishedEntries ();
+ function hasFullyBootstrapped ();
/**
- * Initializes publication of DHT entries. This does only prepare
- * publication. The next step is to pickup such prepared entries and publish
- * them by uploading to other (recently appeared) DHT members.
+ * Whether this DHT's state is 'booting'
*
- * @return void
+ * @return $isBooting Whether this DHT is currently booting
*/
- function initEntryPublication ();
+ function ifDhtIsBooting ();
/**
- * Checks whether there are entries pending publication
+ * Finds DHT recipients by given key/value pair
*
- * @return $isPending Whether there are entries pending publication
+ * @param $key Key to search for
+ * @param $value Value to check on found key
+ * @return $recipientList Array with DHT recipients from given key/value pair
*/
- function hasEntriesPendingPublication ();
+ function findRecipientsByKey ($key, $value);
/**
- * Publishes next entry found in stack. This method shall also update the
- * corresponding dabase entry.
+ * Enable DHT bootstrap request acceptance for local node
*
* @return void
*/
- function publishEntry ();
+ function enableAcceptDhtBootstrap ();
}
// [EOF]