X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=application%2Fhub%2Finterfaces%2Fhelper%2Fnodes%2Fclass_NodeHelper.php;h=83d4fca5a76756a3867904965720b956bef8a37f;hb=4243633833e9e46509b05df13b617d52180d8b8f;hp=d0c2aba6a65e343c4737e3835163b1ed368762ab;hpb=c5f2f6d2f83cd429e493afb816e61bc0503a8b88;p=hub.git diff --git a/application/hub/interfaces/helper/nodes/class_NodeHelper.php b/application/hub/interfaces/helper/nodes/class_NodeHelper.php index d0c2aba6a..83d4fca5a 100644 --- a/application/hub/interfaces/helper/nodes/class_NodeHelper.php +++ b/application/hub/interfaces/helper/nodes/class_NodeHelper.php @@ -2,11 +2,11 @@ /** * An interface for "node-helper" classes * - * @author Roland Haeder + * @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.ship-simu.org + * @link http://www.shipsimu.org * @todo We need to find a better name for this interface * * This program is free software: you can redistribute it and/or modify @@ -22,7 +22,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -interface NodeHelper extends Helper { +interface NodeHelper extends Helper, AddableCriteria { /** * Method to "bootstrap" the node. This step does also apply provided * command-line arguments stored in the request instance. You should now @@ -32,13 +32,6 @@ interface NodeHelper extends Helper { */ function doBootstrapping (); - /** - * Initializes hub-specific queues - * - * @return void - */ - function initQueues (); - /** * Outputs the console teaser. This should only be executed on startup or * full restarts. This method generates some space around the teaser. @@ -67,7 +60,7 @@ interface NodeHelper extends Helper { /** * Activates the hub by doing some final preparation and setting - * $hubIsActive to true + * $hubIsActive to TRUE. * * @param $requestInstance A Requestable class * @param $responseInstance A Responseable class @@ -96,13 +89,6 @@ interface NodeHelper extends Helper { */ function initializeListenerPool (); - /** - * Restores a previously stored node list from database - * - * @return void - */ - function bootstrapRestoreNodeList (); - /** * Announces this hub to the upper (bootstrap or list) hubs. After this is * successfully done the given task is unregistered from the handler. @@ -111,7 +97,7 @@ interface NodeHelper extends Helper { * @return void * @throws NodeAlreadyAnnouncedException If this hub is already announced */ - function announceSelfToUpperNodes (Taskable $taskInstance); + function announceToUpperNodes (Taskable $taskInstance); /** * Does a self-connect attempt on the public IP address. This should make @@ -123,21 +109,18 @@ interface NodeHelper extends Helper { function doSelfConnection (Taskable $taskInstance); /** - * "Getter for address:port combination + * Determines the universal node locator * - * @param $handlerInstance An instance of a Networkable class - * @return $addressPort A address:port combination for this node + * @return $unl A an universal node locator for this node */ - function getAddressPort (Networkable $handlerInstance); + function determineUniversalNodeLocator (); /** - * Adds hub data elements to a given dataset instance + * "Getter for an universal node locator array * - * @param $criteriaInstance An instance of a storeable criteria - * @param $requestInstance An instance of a Requestable class - * @return void + * @return $unlArray An array an universal node locator for this node */ - function addElementsToDataSet (StoreableCriteria $criteriaInstance, Requestable $requestInstance); + function getUniversalNodeLocatorArray (); /** * Updates/refreshes node data (e.g. state). @@ -158,7 +141,14 @@ interface NodeHelper extends Helper { * * @return $hasAnnounced Whether this node has attempted to announce itself */ - function ifNodeHasAnnounced (); + function ifNodeIsAnnouncing (); + + /** + * Checks whether this node has attempted to announce itself and completed it + * + * @return $hasAnnouncementCompleted Whether this node has attempted to announce itself and completed it + */ + function ifNodeHasAnnouncementCompleted (); /** * Checks wether this node is accepting node-list requests @@ -182,6 +172,14 @@ interface NodeHelper extends Helper { * @return $objectList Array of all accepted object types */ function getListFromAcceptedObjectTypes (); + + /** + * Adds extra tasks to the given handler for this node + * + * @param $handlerInstance An instance of a HandleableTask class + * @return void + */ + function addExtraTasks (HandleableTask $handlerInstance); } // [EOF]