X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=application%2Fhub%2Finterfaces%2Fdistributable%2Fclass_Distributable.php;h=a58ec5436cb8a7d1bb8000cc06a570519f175791;hb=ea369fbf3b5ab38fa5616561502015855e024b53;hp=43e7bd85d692ce4620e8b8b515d4bbd43421a31c;hpb=9bca5da674f858a9075bb7233ff046a9037aa25b;p=hub.git diff --git a/application/hub/interfaces/distributable/class_Distributable.php b/application/hub/interfaces/distributable/class_Distributable.php index 43e7bd85d..a58ec5436 100644 --- a/application/hub/interfaces/distributable/class_Distributable.php +++ b/application/hub/interfaces/distributable/class_Distributable.php @@ -4,7 +4,7 @@ * * @author Roland Haeder * @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 * @@ -39,102 +39,80 @@ interface Distributable extends FrameworkInterface { 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]