application/lfdb2/main/filter/bootstrap/server/.htaccess -text
application/lfdb2/main/filter/bootstrap/server/class_ServerBootstrap -text
application/lfdb2/main/filter/bootstrap/server/class_ServerBootstrapExtraBootstrappingFilter.php -text
+application/lfdb2/main/filter/bootstrap/server/class_ServerBootstrapListenerPoolFilter.php -text
application/lfdb2/main/filter/class_BaseLfdb2Filter.php -text
application/lfdb2/main/filter/class_BaseServerFilter.php -text
application/lfdb2/main/filter/server/.htaccess -text
application/lfdb2/main/filter/server/class_ServerInitializationFilter.php -text
application/lfdb2/main/filter/server/class_ServerPhpRequirementsFilter.php -text
application/lfdb2/main/filter/server/class_ServerWelcomeTeaserFilter.php -text
+application/lfdb2/main/filter/shutdown/.htaccess -text
+application/lfdb2/main/filter/shutdown/server/.htaccess -text
+application/lfdb2/main/filter/shutdown/server/class_ServerShutdown -text
+application/lfdb2/main/filter/shutdown/server/class_ServerShutdownServerFilter.php -text
+application/lfdb2/main/filter/shutdown/server/class_ServerShutdownTaskHandlerFilter.php -text
+application/lfdb2/main/filter/task/.htaccess -text
+application/lfdb2/main/filter/task/server/.htaccess -text
+application/lfdb2/main/filter/task/server/class_ServerTaskHandlerInitializerFilter.php -text
application/lfdb2/main/resolver/.htaccess -text
application/lfdb2/main/resolver/command/.htaccess -text
application/lfdb2/main/resolver/command/console/.htaccess -text
// CFG: NEWS-PROCESS-FILTER
$cfg->setConfigEntry('news_process_filter', 'NewsProcessFilter');
+// CFG: NEWS-READER-CLASS
+$cfg->setConfigEntry('news_reader_class', 'ConsoleNewsReader');
+
+// CFG: NEWS-SERVER-LIMIT
+$cfg->setConfigEntry('news_server_limit', 5);
+
// CFG: SERVER-PHP-REQUIREMENTS-FILTER
$cfg->setConfigEntry('node_php_requirements_filter', 'NodePhpRequirementsFilter');
// CFG: SERVER-WELCOME-TEASER-FILTER
$cfg->setConfigEntry('server_welcome_teaser_filter', 'ServerWelcomeTeaserFilter');
+// ----------------------------------------------------------------------------
+// Bootstrapping filters
+// ----------------------------------------------------------------------------
+
// CFG: SERVER-BOOTSTRAP-EXTRA-BOOTSTRAPPING-FILTER
$cfg->setConfigEntry('server_bootstrap_extra_bootstrapping_filter', 'ServerBootstrapExtraBootstrappingFilter');
+// CFG: SERVER-BOOTSTRAP-LISTENER-POOL-FILTER
+$cfg->setConfigEntry('server_bootstrap_listener_pool_filter', 'ServerBootstrapListenerPoolFilter');
+
+// ----------------------------------------------------------------------------
+// Shutdown filters
+// ----------------------------------------------------------------------------
+
+// CFG: SERVER-SHUTDOWN-TASK-HANDLER-FILTER
+$cfg->setConfigEntry('server_shutdown_task_handler_filter', 'ServerShutdownTaskHandlerFilter');
+
+// CFG: SERVER-SHUTDOWN-SERVER-FILTER
+$cfg->setConfigEntry('server_shutdown_server_filter', 'ServerShutdownServerFilter');
+
// [EOF]
?>
--- /dev/null
+<?php
+/**
+ * A ListenerPool filter for bootstrapping
+ *
+ * @author Roland Haeder <webmaster@ship-simu.org>
+ * @version 0.0.0
+ * @copyright Copyright (c) 2013 LFDB2 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 ServerBootstrapListenerPoolFilter extends BaseServerFilter implements Filterable {
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+ }
+
+ /**
+ * Creates an instance of this filter class
+ *
+ * @return $filterInstance An instance of this filter class
+ */
+ public static final function createServerBootstrapListenerPoolFilter () {
+ // Get a new instance
+ $filterInstance = new ServerBootstrapListenerPoolFilter();
+
+ // Return the instance
+ return $filterInstance;
+ }
+
+ /**
+ * Executes the filter with given request and response objects
+ *
+ * @param $requestInstance An instance of a class with an Requestable interface
+ * @param $responseInstance An instance of a class with an Responseable interface
+ * @return void
+ * @throws FilterChainException If $serverInstance is null (no NullPointerException here)
+ */
+ public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+ // Get server instance
+ $serverInstance = Registry::getRegistry()->getInstance('server');
+
+ // Now do something
+ $serverInstance->initializeListenerPool();
+ }
+}
+
+// [EOF]
+?>
--- /dev/null
+Deny from all
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ * A ??? filter for shutting down the server.
+ *
+ * @author Roland Haeder <webmaster@ship-simu.org>
+ * @version 0.0.0
+ * @copyright Copyright (c) 2013 LFDB2 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 ServerShutdown???Filter extends BaseNodeFilter implements Filterable {
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+ }
+
+ /**
+ * Creates an instance of this filter class
+ *
+ * @return $filterInstance An instance of this filter class
+ */
+ public final static function createServerShutdown???Filter () {
+ // Get a new instance
+ $filterInstance = new ServerShutdown???Filter();
+
+ // Return the instance
+ return $filterInstance;
+ }
+
+ /**
+ * Executes the filter with given request and response objects
+ *
+ * @param $requestInstance An instance of a class with an Requestable interface
+ * @param $responseInstance An instance of a class with an Responseable interface
+ * @return void
+ * @throws FilterChainException If $serverInstance is null (no NullPointerException here)
+ * @todo 0% done
+ */
+ public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+ // Get server instance
+ $serverInstance = Registry::getRegistry()->getInstance('server');
+
+ // Now do something
+ $this->partialStub('Please implement this step.');
+ }
+}
+
+// [EOF]
+?>
--- /dev/null
+<?php
+/**
+ * A ShutdownServer filter for shutting down the server. This filter should be the
+ * last one in 'shutdown' chain so the hub is shutted down at the very end of
+ * its life... R.I.P. little hub...
+ *
+ * @author Roland Haeder <webmaster@ship-simu.org>
+ * @version 0.0.0
+ * @copyright Copyright (c) 2013 LFDB2 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 ServerShutdownServerFilter extends BaseServerFilter implements Filterable {
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+ }
+
+ /**
+ * Creates an instance of this filter class
+ *
+ * @return $filterInstance An instance of this filter class
+ */
+ public static final function createServerShutdownServerFilter () {
+ // Get a new instance
+ $filterInstance = new ServerShutdownServerFilter();
+
+ // Return the instance
+ return $filterInstance;
+ }
+
+ /**
+ * Executes the filter with given request and response objects
+ *
+ * @param $requestInstance An instance of a class with an Requestable interface
+ * @param $responseInstance An instance of a class with an Responseable interface
+ * @return void
+ * @throws FilterChainException If $serverInstance is null (no NullPointerException please)
+ */
+ public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+ // Get server instance
+ $serverInstance = Registry::getRegistry()->getInstance('server');
+
+ // Shutdown the server. This should be the last line
+ $serverInstance->doShutdown();
+ }
+}
+
+// [EOF]
+?>
--- /dev/null
+<?php
+/**
+ * A TaskHandler filter for shutting down the node.
+ *
+ * @author Roland Haeder <webmaster@ship-simu.org>
+ * @version 0.0.0
+ * @copyright Copyright (c) 2013 LFDB2 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 ServerShutdownTaskHandlerFilter extends BaseServerFilter implements Filterable {
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+ }
+
+ /**
+ * Creates an instance of this filter class
+ *
+ * @return $filterInstance An instance of this filter class
+ */
+ public static final function createServerShutdownTaskHandlerFilter () {
+ // Get a new instance
+ $filterInstance = new ServerShutdownTaskHandlerFilter();
+
+ // Return the instance
+ return $filterInstance;
+ }
+
+ /**
+ * Executes the filter with given request and response objects
+ *
+ * @param $requestInstance An instance of a class with an Requestable interface
+ * @param $responseInstance An instance of a class with an Responseable interface
+ * @return void
+ * @throws FilterChainException If $nodeInstance is null (no NullPointerException here)
+ * @todo 0% done
+ */
+ public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+ // Get task handler instance
+ $handlerInstance = Registry::getRegistry()->getInstance('task_handler');
+
+ // Shutdown the task manager and all its registered tasks
+ $handlerInstance->doShutdown();
+ }
+}
+
+// [EOF]
+?>
--- /dev/null
+Deny from all
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ * A TaskHandlerInitializer filter for servers
+ *
+ * @author Roland Haeder <webmaster@ship-simu.org>
+ * @version 0.0.0
+ * @copyright Copyright (c) 2013 LFDB2 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 ServerTaskHandlerInitializerFilter extends BaseServerFilter implements Filterable {
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+ }
+
+ /**
+ * Creates an instance of this filter class
+ *
+ * @return $filterInstance An instance of this filter class
+ */
+ public static final function createServerTaskHandlerInitializerFilter () {
+ // Get a new instance
+ $filterInstance = new ServerTaskHandlerInitializerFilter();
+
+ // Return the instance
+ return $filterInstance;
+ }
+
+ /**
+ * Executes the filter with given request and response objects
+ *
+ * @param $requestInstance An instance of a class with an Requestable interface
+ * @param $responseInstance An instance of a class with an Responseable interface
+ * @return void
+ * @throws FilterChainException If we need to interrupt the filter chain
+ * @todo Maybe some more tasks needs to be added?
+ */
+ public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+ $this->partialStub('Unported.');
+ die();
+
+ // Get server instance
+ $serverInstance = Registry::getRegistry()->getInstance('server');
+
+ // Get a new task handler instance
+ $handlerInstance = ObjectFactory::createObjectByConfiguredName('task_handler_class');
+
+ // Generate socket listener task
+ $taskInstance = ObjectFactory::createObjectByConfiguredName('node_socket_listener_task_class');
+
+ // Network package reader, needs to be delayed a little
+ $handlerInstance->registerTask('socket_listener', $taskInstance);
+
+ // Generate package reader task
+ $taskInstance = ObjectFactory::createObjectByConfiguredName('node_package_reader_task_class', array($nodeInstance->getListenerPoolInstance()));
+
+ // Network package reader, needs to be delayed a little
+ $handlerInstance->registerTask('network_package_reader', $taskInstance);
+
+ // Generate package writer task
+ $taskInstance = ObjectFactory::createObjectByConfiguredName('node_package_writer_task_class');
+
+ // Register it as well
+ $handlerInstance->registerTask('network_package_writer', $taskInstance);
+
+ // Generate chunk assembler task
+ $taskInstance = ObjectFactory::createObjectByConfiguredName('node_chunk_assembler_task_class');
+
+ // Register it as well
+ $handlerInstance->registerTask('chunk_assembler', $taskInstance);
+
+ // Generate package decoder task
+ $taskInstance = ObjectFactory::createObjectByConfiguredName('node_package_decoder_task_class');
+
+ // Register it as well
+ $handlerInstance->registerTask('package_decoder', $taskInstance);
+
+ // Generate DHT initialization task
+ $taskInstance = ObjectFactory::createObjectByConfiguredName('node_dht_init_task_class');
+
+ // Register it as well
+ $handlerInstance->registerTask('dht_init', $taskInstance);
+
+ // Generate DHT query task
+ $taskInstance = ObjectFactory::createObjectByConfiguredName('node_dht_query_task_class');
+
+ // Register it as well
+ $handlerInstance->registerTask('dht_query', $taskInstance);
+
+ // Prepare a package-tags initialization task for the listeners
+ $taskInstance = ObjectFactory::createObjectByConfiguredName('node_package_tags_init_task_class');
+
+ // Register it
+ $handlerInstance->registerTask('package_tags_init', $taskInstance);
+
+ // Prepare a self-test task for the listeners
+ $taskInstance = ObjectFactory::createObjectByConfiguredName('node_selfconnect_task_class');
+
+ // Register it
+ $handlerInstance->registerTask('self_connect', $taskInstance);
+
+ // Prepare a update-check task
+ $taskInstance = ObjectFactory::createObjectByConfiguredName('node_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('node_ping_task_class', array($listInstance));
+
+ // Register it
+ $handlerInstance->registerTask('ping', $taskInstance);
+
+ // Put the task handler in registry
+ Registry::getRegistry()->addInstance('task_handler', $handlerInstance);
+ }
+}
+
+// [EOF]
+?>