]> git.mxchange.org Git - hub.git/blobdiff - application/hub/interfaces/distributable/class_Distributable.php
Introduced ifDhtIsBooting(), updated TODOs.txt
[hub.git] / application / hub / interfaces / distributable / class_Distributable.php
index 43e7bd85d692ce4620e8b8b515d4bbd43421a31c..8adbc8d64b822eef96c3b40e86a24a9f7aacf22e 100644 (file)
@@ -38,52 +38,6 @@ 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)
-        *
-        * @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).
         *
@@ -91,20 +45,6 @@ interface Distributable extends FrameworkInterface {
         */
        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
         *
@@ -135,6 +75,28 @@ interface Distributable extends FrameworkInterface {
         * @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]