/**
* Announces this hub to the upper (bootstrap or list) hubs. After this is
- * successfully done the given task is unregistered from the handler.
+ * successfully done the given task is unregistered from the handler. This
+ * might look a bit overloaded here but the announcement phase isn't a
+ * simple "Hello there" message, it may later on also contain more
+ * informations like the object list.
*
* @param $taskInstance The task instance running this announcement
* @return void
} // END - if
// Debug output
- $this->debugOutput('HUB: Self-announcement: START (taskInstance=' . $taskInstance->__toString(). ')');
+ $this->debugOutput('HUB: Self Announcement: START (taskInstance=' . $taskInstance->__toString(). ')');
// Get a helper instance
$helperInstance = ObjectFactory::createObjectByConfiguredName('hub_announcement_helper_class', array($this));
$this->getStateInstance()->nodeAnnouncedToUpperHubs();
// Debug output
- $this->debugOutput('HUB: Self-announcement: FINISHED');
+ $this->debugOutput('HUB: Self Announcement: FINISHED');
+ }
+
+ /**
+ * Does a self-connect attempt on the public IP address. This should make
+ * it sure, we are reachable from outside world. For this kind of package we
+ * don't need that overload we have in the announcement phase.
+ *
+ * @param $taskInstance The task instance running this announcement
+ * @return void
+ */
+ public function doSelfConnection (Taskable $taskInstance) {
+ // Debug output
+ $this->debugOutput('HUB: Self Connection: START (taskInstance=' . $taskInstance->__toString(). ')');
+
+ // Get a helper instance
+ $helperInstance = ObjectFactory::createObjectByConfiguredName('hub_self_connect_helper_class', array($this));
+
+ // And send the package away
+ $helperInstance->doSelfConnect();
+
+ // Debug output
+ $this->debugOutput('HUB: Self Connection: FINISHED');
}
/**