Added all node types, moved iterator class:
authorRoland Häder <roland@mxchange.org>
Sun, 3 Apr 2011 00:57:05 +0000 (00:57 +0000)
committerRoland Häder <roland@mxchange.org>
Sun, 3 Apr 2011 00:57:05 +0000 (00:57 +0000)
- Added all types of (hub/cloud) nodes for easy coding
- Moved key producer iterator class to sub directory
- TODOs.txt updated

.gitattributes
application/hub/main/iterator/producer/class_TestUnitKeyProducerIterator.php
application/hub/main/iterator/producer/keys/.htaccess [new file with mode: 0644]
application/hub/main/iterator/producer/keys/class_TestUnitKeyProducerIterator.php [new file with mode: 0644]
application/hub/main/nodes/boot/class_HubBootNode.php
application/hub/main/nodes/class_BaseHubNode.php
application/hub/main/producer/cruncher/work_units/class_CruncherTestUnitProducer.php
docs/TODOs.txt

index 0cc3d8ac562d21929ad275a0cde044a6843c6d18..4217c86ded1a45b374bad6ac53454bce5d7dbf64 100644 (file)
@@ -318,6 +318,8 @@ application/hub/main/iterator/pool/tasks/.htaccess -text svneol=unset#text/plain
 application/hub/main/iterator/pool/tasks/class_TaskPoolIterator.php -text svneol=unset#text/plain
 application/hub/main/iterator/producer/.htaccess svneol=native#text/plain
 application/hub/main/iterator/producer/class_TestUnitKeyProducerIterator.php svneol=native#text/plain
+application/hub/main/iterator/producer/keys/.htaccess svneol=native#text/plain
+application/hub/main/iterator/producer/keys/class_TestUnitKeyProducerIterator.php svneol=native#text/plain
 application/hub/main/listener/.htaccess -text svneol=unset#text/plain
 application/hub/main/listener/class_ -text svneol=unset#text/plain
 application/hub/main/listener/class_BaseListener.php -text svneol=unset#text/plain
index 189eb0ee8277189e076417567f1ff6094c7f50cb..f551ef47b7591c74e7b59193e56a1fa6505a87ab 100644 (file)
@@ -1,103 +1,3 @@
 <?php
-/**
- * A TestUnitKeyProducer iterator
- *
- * @author             Roland Haeder <webmaster@ship-simu.org>
- * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 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 TestUnitKeyProducerIterator 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 createTestUnitKeyProducerIterator () {
-               // Get new instance
-               $iteratorInstance = new TestUnitKeyProducerIterator();
-
-               // 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
-        * @throws      UnsupportedOperationException   This method should not be called
-        */
-       public function key () {
-               throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
-       }
-
-       /**
-        * 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
-        * @throws      UnsupportedOperationException   This method should not be called
-        */
-       public function rewind () {
-               throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
-       }
-
-       /**
-        * 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]
+// @DEPRECATED
 ?>
diff --git a/application/hub/main/iterator/producer/keys/.htaccess b/application/hub/main/iterator/producer/keys/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/hub/main/iterator/producer/keys/class_TestUnitKeyProducerIterator.php b/application/hub/main/iterator/producer/keys/class_TestUnitKeyProducerIterator.php
new file mode 100644 (file)
index 0000000..189eb0e
--- /dev/null
@@ -0,0 +1,103 @@
+<?php
+/**
+ * A TestUnitKeyProducer iterator
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 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 TestUnitKeyProducerIterator 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 createTestUnitKeyProducerIterator () {
+               // Get new instance
+               $iteratorInstance = new TestUnitKeyProducerIterator();
+
+               // 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
+        * @throws      UnsupportedOperationException   This method should not be called
+        */
+       public function key () {
+               throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
+       }
+
+       /**
+        * 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
+        * @throws      UnsupportedOperationException   This method should not be called
+        */
+       public function rewind () {
+               throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
+       }
+
+       /**
+        * 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]
+?>
index ee6faf45409933c80ac58f7892a356371f453bd8..9b7de39253c5cace26aa371ec0bd61595954341c 100644 (file)
@@ -71,13 +71,13 @@ class HubBootNode extends BaseHubNode implements NodeHelper, Registerable {
                                // It is the same!
                                $this->debugOutput('BOOTSTRAP: IP/port matches bootstrapping node ' . $this->getBootIpPort() . '.');
 
-                               // Now, does the mode match (should be 'boot'!)
-                               if ($this->getRequestInstance()->getRequestElement('mode') == 'boot') {
+                               // Now, does the mode match
+                               if ($this->getRequestInstance()->getRequestElement('mode') == BaseHubNode::NODE_TYPE_BOOT) {
                                        // Output debug message
                                        $this->debugOutput('BOOTSTRAP: Our node is a valid bootstrapping node.');
                                } else {
                                        // Output warning
-                                       $this->debugOutput('BOOTSTRAP: WARNING: Mismatching mode ' . $this->getRequestInstance()->getRequestElement('mode') . '!=boot detected.');
+                                       $this->debugOutput('BOOTSTRAP: WARNING: Mismatching mode ' . $this->getRequestInstance()->getRequestElement('mode') . '!=' . BaseHubNode::NODE_TYPE_BOOT . ' detected.');
                                }
                        } else {
                                // IP does match, but no port
index f60f1fc79bf1fde9f4bce631319926f2a4148e05..0b95a0a357c66c1fe99e4e8fbe1d0d9f2a6572d0 100644 (file)
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 class BaseHubNode extends BaseHubSystem implements Updateable {
+       /**
+        * Node types
+        */
+       const NODE_TYPE_BOOT    = 'boot';
+       const NODE_TYPE_MASTER  = 'master';
+       const NODE_TYPE_LIST    = 'list';
+       const NODE_TYPE_REGULAR = 'regular';
+
        // Exception constants
        const EXCEPTION_HUB_ALREADY_ANNOUNCED = 0xe00;
 
index 172083521054447c8401ec9d63bbaa831718a536..673e9d037f47431af0ccc824fd2ab25d46ef25a9 100644 (file)
@@ -131,7 +131,7 @@ class CruncherTestUnitProducer extends BaseUnitProducer implements UnitProducer,
                                $iteratorInstance->next();
                        } // END - while
 
-                       die(__METHOD__.": Ended the key production.\n");
+                       die(__METHOD__ . ": Ended the key production.\n");
                }
        }
 }
index 189ba59a60326ca2f3035fda8c66213b2e8cc1e3..58dfcd9b6dbfe2f91c26cf104990516561ac4c82 100644 (file)
@@ -51,9 +51,9 @@
 ./application/hub/main/nodes/boot/class_HubBootNode.php:119:           // @TODO Add some filters here
 ./application/hub/main/nodes/boot/class_HubBootNode.php:58:     * @todo        add some more special bootstrap things for this boot node
 ./application/hub/main/nodes/boot/class_HubBootNode.php:99:     * @todo        Unfinished method
-./application/hub/main/nodes/class_BaseHubNode.php:444:         * @todo        Try to make this method more generic so we can move it in BaseFrameworkSystem
-./application/hub/main/nodes/class_BaseHubNode.php:484:         * @todo        Change the first if() block to check for a specific state
-./application/hub/main/nodes/class_BaseHubNode.php:659:                // @TODO Add some criteria, e.g. if the node is active or so
+./application/hub/main/nodes/class_BaseHubNode.php:452:         * @todo        Try to make this method more generic so we can move it in BaseFrameworkSystem
+./application/hub/main/nodes/class_BaseHubNode.php:492:         * @todo        Change the first if() block to check for a specific state
+./application/hub/main/nodes/class_BaseHubNode.php:667:                // @TODO Add some criteria, e.g. if the node is active or so
 ./application/hub/main/nodes/list/class_HubListNode.php:58:     * @todo        Implement more bootstrap steps
 ./application/hub/main/nodes/list/class_HubListNode.php:68:     * @todo        Unfinished method
 ./application/hub/main/nodes/list/class_HubListNode.php:91:            // @TODO Add some filters here
@@ -70,6 +70,7 @@
 ./application/hub/main/package/class_NetworkPackage.php:383:                   // @TODO Add some logging here
 ./application/hub/main/package/class_NetworkPackage.php:409:                   // @TODO Add some logging here
 ./application/hub/main/pools/peer/class_DefaultPeerPool.php:148:                       // @TODO Check for IP
+./application/hub/main/producer/cruncher/work_units/class_CruncherTestUnitProducer.php:127:                            // @TODO Do something with it
 ./application/hub/main/producer/cruncher/work_units/class_CruncherTestUnitProducer.php:78:      * @todo        ~30% done
 ./application/hub/main/producer/cruncher/work_units/class_CruncherTestUnitProducer.php:98:                     // @TODO Unfinished work here
 ./application/hub/main/resolver/state/network/class_NetworkStateResolver.php:68:        * @todo        ~30% done
@@ -89,7 +90,7 @@
 ./application/hub/main/template/objects/class_XmlObjectRegistryTemplateEngine.php:324:  * @todo        Handle $objectCount
 ./application/hub/main/template/producer/test_units/class_XmlCruncherTestUnitTemplateEngine.php:10: * @todo            This template engine does not make use of setTemplateType()
 ./application/hub/main/template/producer/test_units/class_XmlCruncherTestUnitTemplateEngine.php:433:    * @todo        Handle $keyCount
-./application/hub/main/tools/class_HubTools.php:128:                           // @TODO We may want to encapsulate this PHP call into an own class
+./application/hub/main/tools/class_HubTools.php:129:                   // @TODO We may want to encapsulate this PHP call into an own class
 ./application/hub/main/visitor/tasks/class_ActiveTaskVisitor.php:105:   * @todo        Does a query needs to perform some actions as an active task?
 ./application/hub/main/visitor/tasks/class_ActiveTaskVisitor.php:116:   * @todo        Does a queue needs to perform some actions as an active task?
 ./application/hub/main/visitor/tasks/class_ShutdownTaskVisitor.php:100:         * @todo        Does a query needs to perform some actions as an active task?
 ./inc/classes/exceptions/main/class_MissingMethodException.php:13: * @todo             Try to rewrite user/guest login classes and mark this exception as deprecated
 ./inc/classes/exceptions/main/class_NoConfigEntryException.php:10: * @todo             Rename this class to NoFoundEntryException
 ./inc/classes/interfaces/class_FrameworkInterface.php:11: * @todo              Find a better name for this interface
-./inc/classes/main/class_BaseFrameworkSystem.php:1196:  * @todo        Write a logging mechanism for productive mode
-./inc/classes/main/class_BaseFrameworkSystem.php:1210:                 // @TODO Finish this part!
+./inc/classes/main/class_BaseFrameworkSystem.php:1197:  * @todo        Write a logging mechanism for productive mode
+./inc/classes/main/class_BaseFrameworkSystem.php:1211:                 // @TODO Finish this part!
 ./inc/classes/main/class_BaseFrameworkSystem.php:169:  // @todo Try to clean these constants up
-./inc/classes/main/class_BaseFrameworkSystem.php:367:   * @todo        SearchableResult and UpdateableResult shall have a super interface to use here
+./inc/classes/main/class_BaseFrameworkSystem.php:368:   * @todo        SearchableResult and UpdateableResult shall have a super interface to use here
 ./inc/classes/main/commands/web/class_WebLoginAreaCommand.php:64:       * @todo        Add some stuff here: Some personal data, app/game related data
 ./inc/classes/main/commands/web/class_WebProblemCommand.php:58:         * @todo        0% done
 ./inc/classes/main/commands/web/class_WebStatusCommand.php:58:  * @todo        0% done
 ./application/hub/main/filter/task/class_HubTaskHandlerInitializerFilter.php:2:// @DEPRECATED
 ./application/hub/main/filter/task/class_TaskHandlerInitializerFilter.php:2:// @DEPRECATED
 ./application/hub/main/helper/messages/crypto/class_CryptoRandomMessageHelper.php:2:// @DEPRECATED
-./application/hub/main/nodes/class_BaseHubNode.php:50:  * @deprecated
+./application/hub/main/iterator/producer/class_TestUnitKeyProducerIterator.php:2:// @DEPRECATED
+./application/hub/main/nodes/class_BaseHubNode.php:58:  * @deprecated
 ./application/hub/main/template/announcement/class_AnnouncementTemplateEngine.php:2:// @DEPRECATED
 ./application/hub/main/template/connect/class_SelfConnectTemplateEngine.php:2:// @DEPRECATED
 ./application/hub/main/template/objects/class_ObjectRegistryTemplateEngine.php:2:// @DEPRECATED