]> git.mxchange.org Git - hub.git/blobdiff - application/hub/interfaces/helper/nodes/class_NodeHelper.php
Updated copyright year as this software has been changed in this year.
[hub.git] / application / hub / interfaces / helper / nodes / class_NodeHelper.php
index b19e59b12066a017dcf635676070ebe956b4cfec..0d4f28765f8eb80ca270a8a6e93818fadc47478e 100644 (file)
@@ -2,11 +2,11 @@
 /**
  * An interface for "node-helper" classes
  *
- * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2015 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 <http://www.gnu.org/licenses/>.
  */
-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 an instance of a LocateableNode class
         *
-        * @param       $handlerInstance        An instance of a Networkable class
-        * @return      $addressPort            A address:port combination for this node
+        * @return      $unlInstance    An instance of a LocateableNode class for this node
         */
-       function getAddressPort (Networkable $handlerInstance);
+       function determineUniversalNodeLocator ();
 
        /**
-        * Adds hub data elements to a given dataset instance
+        * "Getter for an array of an instance of a LocateableNode class
         *
-        * @param       $criteriaInstance       An instance of a storeable criteria
-        * @param       $requestInstance        An instance of a Requestable class
-        * @return      void
+        * @return      $unlData        An array of an instance of a LocateableNode class
         */
-       function addElementsToDataSet (StoreableCriteria $criteriaInstance, Requestable $requestInstance);
+       function getUniversalNodeLocatorArray ();
 
        /**
         * Updates/refreshes node data (e.g. state).
@@ -153,10 +136,17 @@ interface NodeHelper extends Helper {
         */
        function isAcceptingAnnouncements ();
 
+       /**
+        * Checks whether this node has attempted to announce itself
+        *
+        * @return      $hasAnnounced   Whether this node has attempted to announce itself
+        */
+       function ifNodeIsAnnouncing ();
+
        /**
         * Checks whether this node has attempted to announce itself and completed it
         *
-        * @return      $hasAnnounced   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 ();
 
@@ -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]