* 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.
*/
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
*
* @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]
// Run the "UPDATE" query
$this->queryUpdateDataSet($dataSetInstance);
}
+
+ /**
+ * 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.
+ */
+ public function removeNonPublicDataFromArray(array $data) {
+ // Currently call only inner method
+ $data = parent::removeNonPublicDataFromArray($data);
+
+ // Return cleaned data
+ return $data;
+ }
}
// [EOF]
// Update database record
$this->queryUpdateDataSet($dataSetInstance);
}
+
+ /**
+ * 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.
+ */
+ public function removeNonPublicDataFromArray(array $data) {
+ // Currently call only inner method
+ $data = parent::removeNonPublicDataFromArray($data);
+
+ // Return cleaned data
+ return $data;
+ }
}
// [EOF]