]> git.mxchange.org Git - hub.git/commitdiff
Added missing interface
authorRoland Häder <roland@mxchange.org>
Sun, 29 May 2011 02:36:36 +0000 (02:36 +0000)
committerRoland Häder <roland@mxchange.org>
Sun, 29 May 2011 02:36:36 +0000 (02:36 +0000)
application/hub/interfaces/chat/class_Chatter.php
application/hub/interfaces/cruncher/class_CruncherHelper.php
application/hub/main/chat/class_
application/hub/main/chat/class_BaseNodeChat.php
application/hub/main/chat/console/class_NodeConsoleChat.php
application/hub/main/source/units/class_TestUnitSource.php

index f92865e77407b869d861051cd0ba60a2eecc237f..ee00bc1d80384eecb084331475de94c5e0ff4ff1 100644 (file)
@@ -1,12 +1,13 @@
 <?php
 /**
- * An interface for chatter
+ * An interface for chatter classes
  *
  * @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
+ * @todo               We need to find a better name for this interface
  *
  * 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
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 interface Chatter extends FrameworkInterface {
+       /**
+        * Method to "bootstrap" the chatter. This step does also apply provided
+        * command-line arguments stored in the request instance. You should now
+        * get it from calling $this->getRequestInstance().
+        *
+        * @return      void
+        */
+       function doBootstrapping ();
+
+       /**
+        * Outputs the console teaser. This should only be executed on startup or
+        * full restarts. This method generates some space around the teaser.
+        *
+        * @return      void
+        */
+       function outputConsoleTeaser ();
+
+       /**
+        * Add some chatter-specific filters
+        *
+        * @param       $controllerInstance             An object of a Controller instance
+        * @param       $responseInstance               An object of a Responseable instance
+        * @return      void
+        */
+       function addExtraFilters (Controller $controllerInstance, Responseable $responseInstance);
+
+       /**
+        * Enables/disables the chatter (just sets a flag)
+        *
+        * @param       $version        Version number of this chatter
+        * @return      void
+        */
+       function enableIsActive ($isActive = true);
+
+       /**
+        * Determines wether the chatter is active
+        *
+        * @return      $isActive       Wether the chatter is active
+        */
+       function isActive ();
 }
 
 // [EOF]
index 68b791d11c800d34338b22e7b607362f03a9a29b..b5fafe4f7703f9ff636f2dc9f7f4109b45280dbf 100644 (file)
@@ -24,7 +24,7 @@
  */
 interface CruncherHelper extends FrameworkInterface {
        /**
-        * Method to "bootstrap" the node. This step does also apply provided
+        * Method to "bootstrap" the cruncher. This step does also apply provided
         * command-line arguments stored in the request instance. You should now
         * get it from calling $this->getRequestInstance().
         *
index 7d7325b7d77b9c19d384fced8766502cb66a9769..960e53d4f668b7f24cb09c40a334d97db29a003c 100644 (file)
@@ -44,6 +44,38 @@ class Node???Chat extends BaseNodeChat implements Chatter {
                // Return the prepared instance
                return $chatInstance;
        }
+
+       /**
+        * Method to "bootstrap" the chatter. This step does also apply provided
+        * command-line arguments stored in the request instance. You should now
+        * get it from calling $this->getRequestInstance().
+        *
+        * @return      void
+        */
+       public function doBootstrapping () {
+               $this->partialStub('Please implement this method.');
+       }
+
+       /**
+        * Outputs the console teaser. This should only be executed on startup or
+        * full restarts. This method generates some space around the teaser.
+        *
+        * @return      void
+        */
+       public function outputConsoleTeaser () {
+               $this->partialStub('Please implement this method.');
+       }
+
+       /**
+        * Add some chatter-specific filters
+        *
+        * @param       $controllerInstance             An object of a Controller instance
+        * @param       $responseInstance               An object of a Responseable instance
+        * @return      void
+        */
+       public function addExtraFilters (Controller $controllerInstance, Responseable $responseInstance) {
+               $this->partialStub('Please implement this method.');
+       }
 }
 
 // [EOF]
index 3620b2b3ac7a51afdfcfc0cbda3be30421bed81c..99d47ba0bea53700d7349be769ff84dcd6eb7f8b 100644 (file)
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 class BaseNodeChat extends BaseHubSystem {
+       /**
+        * Wether this Chatter is active
+        */
+       private $isActive = false;
+
        /**
         * Protected constructor
         *
@@ -32,6 +37,25 @@ class BaseNodeChat extends BaseHubSystem {
                // Call parent constructor
                parent::__construct($className);
        }
+
+       /**
+        * Enables/disables the chatter (just sets a flag)
+        *
+        * @param       $version        Version number of this chatter
+        * @return      void
+        */
+       public final function enableIsActive ($isActive = true) {
+               $this->isActive = (bool) $isActive;
+       }
+
+       /**
+        * Determines wether the chatter is active
+        *
+        * @return      $isActive       Wether the chatter is active
+        */
+       public final function isActive () {
+               return $this->isActive;
+       }
 }
 
 // [EOF]
index c0bf80a4e474fb7bad4ee0d4302c706b7fad31f6..46bb5b742bcfb60a91ecb188eb4c0175e106b1e0 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * A node Console chat
+ * A node console chat
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
@@ -44,6 +44,38 @@ class NodeConsoleChat extends BaseNodeChat implements Chatter, Registerable {
                // Return the prepared instance
                return $chatInstance;
        }
+
+       /**
+        * Method to "bootstrap" the chatter. This step does also apply provided
+        * command-line arguments stored in the request instance. You should now
+        * get it from calling $this->getRequestInstance().
+        *
+        * @return      void
+        */
+       public function doBootstrapping () {
+               $this->partialStub('Please implement this method.');
+       }
+
+       /**
+        * Outputs the console teaser. This should only be executed on startup or
+        * full restarts. This method generates some space around the teaser.
+        *
+        * @return      void
+        */
+       public function outputConsoleTeaser () {
+               $this->partialStub('Please implement this method.');
+       }
+
+       /**
+        * Add some chatter-specific filters
+        *
+        * @param       $controllerInstance             An object of a Controller instance
+        * @param       $responseInstance               An object of a Responseable instance
+        * @return      void
+        */
+       public function addExtraFilters (Controller $controllerInstance, Responseable $responseInstance) {
+               $this->partialStub('Please implement this method.');
+       }
 }
 
 // [EOF]
index 0de4ac22be0642109a69cc3ac7744304f9d6f07d..f100c13f1f3505579abc06b277f04afad05d532c 100644 (file)
@@ -21,7 +21,7 @@
  * 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 TestUnitSource extends BaseSource implements Sourceable {
+class TestUnitSource extends BaseSource implements Sourceable, Registerable {
        /**
         * Protected constructor
         *