]> git.mxchange.org Git - hub.git/blobdiff - application/hub/interfaces/wrapper/class_NodeDhtWrapper.php
Some missing code added:
[hub.git] / application / hub / interfaces / wrapper / class_NodeDhtWrapper.php
index e41ead812aa97682b3d19c9dea89349d31a7730f..64eea869518059395207e6a79afb61115b681e50 100644 (file)
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 interface NodeDhtWrapper extends DatabaseWrapper {
+       /**
+        * Getter for result instance for unpublished entries
+        *
+        * @return      $unpublishedEntriesInstance             Result instance
+        */
+       function getUnpublishedEntriesInstance ();
+
        /**
         * Checks whether the local (*this*) node is registered in the DHT by
         * checking if the external ip/port is found.
@@ -53,6 +60,25 @@ interface NodeDhtWrapper extends DatabaseWrapper {
         */
        function findNodeLocalBySessionId ($sessionId);
 
+       /**
+        * Registeres a node by given message data.
+        *
+        * @param       $messageData            An array of all message data
+        * @param       $handlerInstance        An instance of a Handleable class
+        * @return      void
+        */
+       function registerNodeByMessageData (array $messageData, Handleable $handlerInstance);
+
+       /**
+        * Updates an existing entry in node list
+        *
+        * @param       $messageData            An array of all message data
+        * @param       $handlerInstance        An instance of a Handleable class
+        * @param       $searchInstance         An instance of LocalSearchCriteria class
+        * @return      void
+        */
+       function updateNodeByMessageData (array $messageData, Handleable $handlerInstance, LocalSearchCriteria $searchInstance);
+
        /**
         * Determines whether the given node data is already inserted in the DHT
         *
@@ -81,6 +107,32 @@ interface NodeDhtWrapper extends DatabaseWrapper {
         * @throws      NodeDataMissingException        If the node's data is missing
         */
        function updateNode (array $nodeData);
+
+       /**
+        * Checks whether there are unpublished entries
+        *
+        * @return      $hasUnpublished         Whether there are unpublished entries
+        * @todo        Add minimum/maximum age limitations
+        */
+       function hasUnpublishedEntries ();
+
+       /**
+        * 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.
+        *
+        * @return      void
+        * @todo        Add timestamp to dataset instance
+        */
+       function initEntryPublication ();
+
+       /**
+        * Removes non-public data from given array.
+        *
+        * @param       $data   An array with possible non-public data that needs to be removed.
+        * @return      $data   A cleaned up array with only public data.
+        */
+       function removeNonPublicDataFromArray (array $data);
 }
 
 // [EOF]