]> git.mxchange.org Git - hub.git/blobdiff - application/hub/interfaces/wrapper/class_NodeDhtWrapper.php
Continued:
[hub.git] / application / hub / interfaces / wrapper / class_NodeDhtWrapper.php
index 622e864c876495ddd9fb09d8ca3424e548ec1344..c10b010cd1dcd3ba1e25407ebdce699f606647f4 100644 (file)
@@ -52,6 +52,35 @@ interface NodeDhtWrapper extends DatabaseWrapper {
         * @return      $nodeData       Node data array
         */
        function findNodeLocalBySessionId ($sessionId);
+
+       /**
+        * Determines whether the given node data is already inserted in the DHT
+        *
+        * @param       $nodeData               An array with valid node data
+        * @return      $isRegistered   Whether the given node data is already inserted
+        */
+       function isNodeRegistered (array $nodeData);
+
+       /**
+        * Registers a node with given data in the DHT. If the node is already
+        * registered this method shall throw an exception.
+        *
+        * @param       $nodeData       An array with valid node data
+        * @return      void
+        * @throws      NodeAlreadyRegisteredException  If the node is already registered
+        */
+       function registerNode (array $nodeData);
+
+       /**
+        * Updates a node's entry in the DHT with given data. This will enrich or
+        * just update already exsiting data. If the node is not found this method
+        * shall throw an exception.
+        *
+        * @param       $nodeData       An array with valid node data
+        * @return      void
+        * @throws      NodeDataMissingException        If the node's data is missing
+        */
+       function updateNode (array $nodeData);
 }
 
 // [EOF]