application/hub/main/iterator/.htaccess -text
application/hub/main/iterator/class_ -text
application/hub/main/iterator/class_BaseIterator.php -text
+application/hub/main/iterator/hub/.htaccess -text
+application/hub/main/iterator/hub/class_HubPingIterator.php -text
application/hub/main/iterator/network/.htaccess -text
application/hub/main/iterator/network/class_NetworkListenIterator.php -text
application/hub/main/iterator/pool/.htaccess -text
application/hub/main/tasks/class_BaseTask.php -text
application/hub/main/tasks/hub/.htaccess -text
application/hub/main/tasks/hub/class_HubSelfConnectTask.php -text
+application/hub/main/tasks/hub/ping/.htaccess -text
+application/hub/main/tasks/hub/ping/class_HubPingTask.php -text
+application/hub/main/tasks/hub/update/.htaccess -text
+application/hub/main/tasks/hub/update/class_HubUpdateCheckTask.php -text
application/hub/main/tasks/idle/.htaccess -text
application/hub/main/tasks/idle/class_IdleLoopTask.php -text
application/hub/main/visitor/.htaccess -text
// CFG: TASK-SELF-CONNECT-INTERVAL-DELAY
$cfg->setConfigEntry('task_self_connect_interval_delay', 1000*60*30);
+// CFG: TASK-UPDATE-CHECK-STARTUP-DELAY
+$cfg->setConfigEntry('task_update_check_startup_delay', 1000*60*60*6);
+
+// CFG: TASK-UPDATE-CHECK-INTERVAL-DELAY
+$cfg->setConfigEntry('task_update_check_interval_delay', 1000*60*60*24);
+
+// CFG: TASK-PING-STARTUP-DELAY
+$cfg->setConfigEntry('task_ping_startup_delay', 1000*60);
+
+// CFG: TASK-PING-INTERVAL-DELAY
+$cfg->setConfigEntry('task_ping_interval_delay', 1000*60*60);
+
// CFG: IDLE-TASK-CLASS
$cfg->setConfigEntry('idle_task_class', 'IdleLoopTask');
// CFG: HUB-SELFCONNECT-TASK-CLASS
$cfg->setConfigEntry('hub_selfconnect_task_class', 'HubSelfConnectTask');
+// CFG: HUB-UPDATE-CHECK-TASK-CLASS
+$cfg->setConfigEntry('hub_update_check_task_class', 'HubUpdateCheckTask');
+
+// CFG: HUB-PING-TASK-CLASS
+$cfg->setConfigEntry('hub_ping_task_class', 'HubPingTask');
+
// CFG: TASK-LIST-CLASS
$cfg->setConfigEntry('task_list_class', 'TaskList');
// CFG: QUERY-ITERATOR-CLASS
$cfg->setConfigEntry('query_iterator_class', 'DefaultIterator');
+// CFG: HUB-PING-ITERATOR-CLASS
+$cfg->setConfigEntry('hub_ping_iterator_class', 'HubPingIterator');
+
// CFG: LOCAL-QUERY-LIST-CLASS
$cfg->setConfigEntry('local_query_list_class', 'LocalQueryList');
// Get a new task handler instance
$handlerInstance = ObjectFactory::createObjectByConfiguredName('task_handler_class');
- // Register some tasks and provide both instances for this:
- // 1.) Network package reader, needs to be delayed a little
+ // Network package reader, needs to be delayed a little
$handlerInstance->registerTask('network_package_reader', $nodeInstance->getListenerPoolInstance());
- // 2.) Query instance
+
+ // Query handler instance
$handlerInstance->registerTask('query_handler', $nodeInstance->getQueryConnectorInstance());
// Generate idle task
// Register it
$handlerInstance->registerTask('self_connect', $taskInstance);
+
+ // Prepare a update-check task
+ $taskInstance = ObjectFactory::createObjectByConfiguredName('hub_update_check_task_class');
+
+ // Register it
+ $handlerInstance->registerTask('update_check', $taskInstance);
+
+ // Get the list instance here
+ $listInstance = $nodeInstance->getListenerPoolInstance()->getPoolEntriesInstance();
+
+ // Prepare a ping task
+ $taskInstance = ObjectFactory::createObjectByConfiguredName('hub_ping_task_class', array($listInstance));
+
+ // Register it
+ $handlerInstance->registerTask('ping', $taskInstance);
}
}
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ * A HubPing iterator
+ *
+ * @author Roland Haeder <webmaster@ship-simu.org>
+ * @version 0.0.0
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @license GNU GPL 3.0 or any newer version
+ * @link http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class HubPingIterator extends BaseIterator implements Iterator {
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+ }
+
+ /**
+ * Creates an instance of this class
+ *
+ * @return $iteratorInstance An instance of a Iterator class
+ */
+ public final static function createHubPingIterator () {
+ // Get new instance
+ $iteratorInstance = new HubPingIterator();
+
+ // Return the prepared instance
+ return $iteratorInstance;
+ }
+
+ /**
+ * Getter for current value from group or generic
+ *
+ * @return $current Current value in iteration
+ */
+ public function current () {
+ // Default is null
+ $current = null;
+
+ $this->partialStub('Please implement this method.');
+
+ // Return it
+ return $current;
+ }
+
+ /**
+ * Getter for key from group or generic
+ *
+ * @return $key Current key in iteration
+ */
+ public function key () {
+ // Default is null
+ $key = null;
+
+ $this->partialStub('Please implement this method.');
+
+ // Return it
+ return $key;
+ }
+
+ /**
+ * Advances to the next entry
+ *
+ * @return void
+ */
+ public function next () {
+ $this->partialStub('Please implement this method.');
+ }
+
+ /**
+ * Rewinds to the beginning of the iteration
+ *
+ * @return void
+ */
+ public function rewind () {
+ $this->partialStub('Please implement this method.');
+ }
+
+ /**
+ * Checks wether the current entry is valid (not at the end of the list)
+ *
+ * @return void
+ */
+ public function valid () {
+ $this->partialStub('Please implement this method.');
+ }
+}
+
+// [EOF]
+?>
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ * A HubPing task
+ *
+ * @author Roland Haeder <webmaster@ship-simu.org>
+ * @version 0.0.0
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @license GNU GPL 3.0 or any newer version
+ * @link http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class HubPingTask extends BaseTask implements Visitable, Taskable {
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+ }
+
+ /**
+ * Creates an instance of this class
+ *
+ * @param $listInstance A Listable instance
+ * @return $taskInstance An instance of a Visitable class
+ */
+ public final static function createHubPingTask (Listable $listInstance) {
+ // Get new instance
+ $taskInstance = new HubPingTask();
+
+ // Se the list instance in this task
+ $taskInstance->setListInstance($listInstance);
+
+ // Init ping iterator instance
+ $iteratorInstance = ObjectFactory::createObjectByConfiguredName('hub_ping_iterator_class', array($listInstance));
+
+ // Set it as well
+ $taskInstance->setIteratorInstance($iteratorInstance);
+
+ // Return the prepared instance
+ return $taskInstance;
+ }
+
+ /**
+ * Accepts the visitor to rpocess the visit "request"
+ *
+ * @param $visitorInstance An instance of a Visitor class
+ * @return void
+ * @todo 0%
+ */
+ public function accept (Visitor $visitorInstance) {
+ $this->partialStub('Please implement this method. visitor='.$visitorInstance->__toString());
+ }
+
+ /**
+ * Executes the task
+ *
+ * @return void
+ */
+ public function execute () {
+ $this->partialStub('Unimplemented task.');
+ }
+}
+
+// [EOF]
+?>
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ * A HubUpdateCheck task
+ *
+ * @author Roland Haeder <webmaster@ship-simu.org>
+ * @version 0.0.0
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @license GNU GPL 3.0 or any newer version
+ * @link http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class HubUpdateCheckTask extends BaseTask implements Visitable, Taskable {
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+ }
+
+ /**
+ * Creates an instance of this class
+ *
+ * @return $taskInstance An instance of a Visitable class
+ */
+ public final static function createHubUpdateCheckTask () {
+ // Get new instance
+ $taskInstance = new HubUpdateCheckTask();
+
+ // Return the prepared instance
+ return $taskInstance;
+ }
+
+ /**
+ * Accepts the visitor to rpocess the visit "request"
+ *
+ * @param $visitorInstance An instance of a Visitor class
+ * @return void
+ * @todo 0%
+ */
+ public function accept (Visitor $visitorInstance) {
+ $this->partialStub('Please implement this method. visitor='.$visitorInstance->__toString());
+ }
+
+ /**
+ * Executes the task
+ *
+ * @return void
+ */
+ public function execute () {
+ $this->partialStub('Unimplemented task.');
+ }
+}
+
+// [EOF]
+?>