From df8d41e984d8a2fd5f58e4c95f0b7d5820fca8e8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sun, 5 Jul 2009 21:24:12 +0000 Subject: [PATCH] Classes and interfaces for queue connectors (a la wrapper) added --- .gitattributes | 11 ++++ application/hub/config.php | 3 ++ .../hub/interfaces/connectors/.htaccess | 1 + .../connectors/class_Connectable.php | 28 ++++++++++ application/hub/interfaces/queues/.htaccess | 1 + .../hub/interfaces/queues/class_Queueable.php | 28 ++++++++++ application/hub/main/connectors/.htaccess | 1 + .../main/connectors/class_BaseConnector.php | 42 +++++++++++++++ .../hub/main/connectors/queues/.htaccess | 1 + application/hub/main/connectors/queues/class_ | 51 +++++++++++++++++++ .../queues/class_BaseQueueConnector.php | 38 ++++++++++++++ .../main/connectors/queues/local/.htaccess | 1 + .../local/class_LocalQueueConnector.php | 51 +++++++++++++++++++ 13 files changed, 257 insertions(+) create mode 100644 application/hub/interfaces/connectors/.htaccess create mode 100644 application/hub/interfaces/connectors/class_Connectable.php create mode 100644 application/hub/interfaces/queues/.htaccess create mode 100644 application/hub/interfaces/queues/class_Queueable.php create mode 100644 application/hub/main/connectors/.htaccess create mode 100644 application/hub/main/connectors/class_BaseConnector.php create mode 100644 application/hub/main/connectors/queues/.htaccess create mode 100644 application/hub/main/connectors/queues/class_ create mode 100644 application/hub/main/connectors/queues/class_BaseQueueConnector.php create mode 100644 application/hub/main/connectors/queues/local/.htaccess create mode 100644 application/hub/main/connectors/queues/local/class_LocalQueueConnector.php diff --git a/.gitattributes b/.gitattributes index 8d83ab097..468e6ab41 100644 --- a/.gitattributes +++ b/.gitattributes @@ -10,10 +10,21 @@ application/hub/exceptions.php -text application/hub/exceptions/.htaccess -text application/hub/init.php -text application/hub/interfaces/.htaccess -text +application/hub/interfaces/connectors/.htaccess -text +application/hub/interfaces/connectors/class_Connectable.php -text application/hub/interfaces/nodes/.htaccess -text application/hub/interfaces/nodes/class_NodeHelper.php -text +application/hub/interfaces/queues/.htaccess -text +application/hub/interfaces/queues/class_Queueable.php -text application/hub/loader.php -text application/hub/main/.htaccess -text +application/hub/main/connectors/.htaccess -text +application/hub/main/connectors/class_BaseConnector.php -text +application/hub/main/connectors/queues/.htaccess -text +application/hub/main/connectors/queues/class_ -text +application/hub/main/connectors/queues/class_BaseQueueConnector.php -text +application/hub/main/connectors/queues/local/.htaccess -text +application/hub/main/connectors/queues/local/class_LocalQueueConnector.php -text application/hub/main/database/.htaccess -text application/hub/main/database/wrapper/.htaccess -text application/hub/main/database/wrapper/class_NodeInformationDatabaseWrapper.php -text diff --git a/application/hub/config.php b/application/hub/config.php index 558b8ac23..c52c6dbe7 100644 --- a/application/hub/config.php +++ b/application/hub/config.php @@ -48,5 +48,8 @@ $cfg->setConfigEntry('node_info_db_wrapper_class', "NodeInformationDatabaseWrapp // CFG: WEB-CONTENT-TYPE $cfg->setConfigEntry('web_content_type', ""); +// CFG: QUEUE-CONNECTOR +$cfg->setConfigEntry('queue_connector', "LocalQueueConnector"); + // [EOF] ?> diff --git a/application/hub/interfaces/connectors/.htaccess b/application/hub/interfaces/connectors/.htaccess new file mode 100644 index 000000000..3a4288278 --- /dev/null +++ b/application/hub/interfaces/connectors/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/hub/interfaces/connectors/class_Connectable.php b/application/hub/interfaces/connectors/class_Connectable.php new file mode 100644 index 000000000..37ee9c1e5 --- /dev/null +++ b/application/hub/interfaces/connectors/class_Connectable.php @@ -0,0 +1,28 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Core 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 . + */ +interface Connectable extends FrameworkInterface { +} + +// +?> diff --git a/application/hub/interfaces/queues/.htaccess b/application/hub/interfaces/queues/.htaccess new file mode 100644 index 000000000..3a4288278 --- /dev/null +++ b/application/hub/interfaces/queues/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/hub/interfaces/queues/class_Queueable.php b/application/hub/interfaces/queues/class_Queueable.php new file mode 100644 index 000000000..0d5261978 --- /dev/null +++ b/application/hub/interfaces/queues/class_Queueable.php @@ -0,0 +1,28 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Core 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 . + */ +interface Queueable extends FrameworkInterface { +} + +// +?> diff --git a/application/hub/main/connectors/.htaccess b/application/hub/main/connectors/.htaccess new file mode 100644 index 000000000..3a4288278 --- /dev/null +++ b/application/hub/main/connectors/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/hub/main/connectors/class_BaseConnector.php b/application/hub/main/connectors/class_BaseConnector.php new file mode 100644 index 000000000..592a6ba7e --- /dev/null +++ b/application/hub/main/connectors/class_BaseConnector.php @@ -0,0 +1,42 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Core 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 . + */ +class BaseConnector extends BaseFrameworkSystem { + /** + * Protected constructor + * + * @param $className Name of the class + * @return void + */ + protected function __construct ($className) { + // Call parent constructor + parent::__construct($className); + + // Clean up a little + $this->removeNumberFormaters(); + $this->removeSystemArray(); + } +} + +// [EOF] +?> diff --git a/application/hub/main/connectors/queues/.htaccess b/application/hub/main/connectors/queues/.htaccess new file mode 100644 index 000000000..3a4288278 --- /dev/null +++ b/application/hub/main/connectors/queues/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/hub/main/connectors/queues/class_ b/application/hub/main/connectors/queues/class_ new file mode 100644 index 000000000..c9d1d522f --- /dev/null +++ b/application/hub/main/connectors/queues/class_ @@ -0,0 +1,51 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Core 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 . + */ +class ???QueueConnector extends BaseQueueConnector implements Connectable, Queueable { + /** + * Protected constructor + * + * @param $className Name of the class + * @return void + */ + protected function __construct ($className) { + // Call parent constructor + parent::__construct($className); + } + + /** + * Creates an instance of this queue connector class + * + * @return $connectorInstance An instance of this queue connector class + */ + public final static function create???QueueConnector () { + // Create the instance + $connectorInstance = new ???QueueConnector(); + + // Finally return it + return $connectorInstance; + } +} + +// [EOF] +?> diff --git a/application/hub/main/connectors/queues/class_BaseQueueConnector.php b/application/hub/main/connectors/queues/class_BaseQueueConnector.php new file mode 100644 index 000000000..31d34b8e9 --- /dev/null +++ b/application/hub/main/connectors/queues/class_BaseQueueConnector.php @@ -0,0 +1,38 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Core 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 . + */ +class BaseQueueConnector extends BaseConnector { + /** + * Protected constructor + * + * @param $className Name of the class + * @return void + */ + protected function __construct ($className) { + // Call parent constructor + parent::__construct($className); + } +} + +// [EOF] +?> diff --git a/application/hub/main/connectors/queues/local/.htaccess b/application/hub/main/connectors/queues/local/.htaccess new file mode 100644 index 000000000..3a4288278 --- /dev/null +++ b/application/hub/main/connectors/queues/local/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/hub/main/connectors/queues/local/class_LocalQueueConnector.php b/application/hub/main/connectors/queues/local/class_LocalQueueConnector.php new file mode 100644 index 000000000..29f30077d --- /dev/null +++ b/application/hub/main/connectors/queues/local/class_LocalQueueConnector.php @@ -0,0 +1,51 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Core 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 . + */ +class LocalQueueConnector extends BaseQueueConnector implements Connectable, Queueable { + /** + * Protected constructor + * + * @param $className Name of the class + * @return void + */ + protected function __construct ($className) { + // Call parent constructor + parent::__construct($className); + } + + /** + * Creates an instance of this queue connector class + * + * @return $connectorInstance An instance of this queue connector class + */ + public final static function createLocalQueueConnector () { + // Create the instance + $connectorInstance = new LocalQueueConnector(); + + // Finally return it + return $connectorInstance; + } +} + +// [EOF] +?> -- 2.39.5