*/
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)
- *
- * @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);
-
/**
* Updates/refreshes DHT data (e.g. status).
*
*/
function updateDhtData ();
- /**
- * Checks whether there are entries in "INSERT" node data stack
- *
- * @return $isPending Whether there are pending entries
- */
- function ifInsertNodeDataPending ();
-
- /**
- * Inserts a single entry of node data into the DHT
- *
- * @return void
- */
- function insertSingleNodeData ();
-
/**
* Checks whether there are unpublished entries
*
* @return void
*/
function publishEntry ();
+
+ /**
+ * Find recipients for given package data
+ *
+ * @param $packageData An array of valid package data
+ * @return $recipients An indexed array with DHT recipients
+ */
+ function findRecipientsByPackageData (array $packageData);
+
+ /**
+ * Whether the DHT has fully bootstrapped (after state 'booting')
+ *
+ * @return $isFullyBooted Whether the DHT is fully booted
+ */
+ function hasFullyBootstrapped ();
+
+ /**
+ * Whether this DHT's state is 'booting'
+ *
+ * @return $isBooting Whether this DHT is currently booting
+ */
+ function ifDhtIsBooting ();
}
// [EOF]