]> git.mxchange.org Git - hub.git/blobdiff - application/hub/interfaces/nodes/class_NodeHelper.php
Added getAddressPort() method to ease comparison with 'recipient' field
[hub.git] / application / hub / interfaces / nodes / class_NodeHelper.php
index 71c0b08f65812c70b1f372c1a19ce4b8c21b0c78..f023f6e32ca90b7fd252b948dbd596638a0ede10 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  * @todo               We need to find a better name for this interface
@@ -52,9 +52,11 @@ interface NodeHelper extends FrameworkInterface {
         * based on many pseudo-random data. On any later run, unless the id
         * got not removed from database, it will be restored from the database.
         *
+        * @param       $requestInstance        A Requestable class
+        * @param       $responseInstance       A Responseable class
         * @return      void
         */
-       function bootstrapAcquireHubId ();
+       function bootstrapAcquireHubId (Requestable $requestInstance, Responseable $responseInstance);
 
        /**
         * Activates the hub by doing some final preparation and setting
@@ -67,7 +69,7 @@ interface NodeHelper extends FrameworkInterface {
        function activateHub (Requestable $requestInstance, Responseable $responseInstance);
 
        /**
-        * Generates a session id which will be sent to the other hubs and clients
+        * Generates a session id which will be sent to the other hubs and peers
         *
         * @return      void
         */
@@ -93,7 +95,34 @@ interface NodeHelper extends FrameworkInterface {
         * @return      void
         */
        function addExtraHubFilters ();
+
+       /**
+        * Announces this hub to the upper (bootstrap or list) hubs. After this is
+        * successfully done the given task is unregistered from the handler.
+        *
+        * @param       $taskInstance   The task instance running this announcement
+        * @return      void
+        * @throws      HubAlreadyAnnouncedException    If this hub is already announced
+        */
+       function announceSelfToUpperNodes (Taskable $taskInstance);
+
+       /**
+        * Does a self-connect attempt on the public IP address. This should make
+        * it sure, we are reachable from outside world.
+        *
+        * @param       $taskInstance   The task instance running this announcement
+        * @return      void
+        */
+       function doSelfConnection (Taskable $taskInstance);
+
+       /**
+        * "Getter for address:port combination
+        *
+        * @param       $handlerInstance        A valid Networkable instance
+        * @return      $addressPort            A address:port combination for this node
+        */
+       function getAddressPort (Networkable $handlerInstance);
 }
 
-//
+// [EOF]
 ?>