]> git.mxchange.org Git - hub.git/commitdiff
Added missing node state 'reachable'
authorRoland Häder <roland@mxchange.org>
Thu, 17 May 2012 19:26:44 +0000 (19:26 +0000)
committerRoland Häder <roland@mxchange.org>
Thu, 17 May 2012 19:26:44 +0000 (19:26 +0000)
.gitattributes
application/hub/config.php
application/hub/main/states/node/seniors/.htaccess [new file with mode: 0644]
application/hub/main/states/node/seniors/class_NodeReachableState.php [new file with mode: 0644]

index 8c66ae5529b83608a3c32fa66812816a09cbbc66..45c7020e07ac85b00301af9d1348014678c2e768 100644 (file)
@@ -477,6 +477,8 @@ application/hub/main/states/node/class_ svneol=native#text/plain
 application/hub/main/states/node/class_BaseNodeState.php svneol=native#text/plain
 application/hub/main/states/node/init/.htaccess -text svneol=unset#text/plain
 application/hub/main/states/node/init/class_NodeInitState.php svneol=native#text/plain
+application/hub/main/states/node/seniors/.htaccess -text svneol=unset#text/plain
+application/hub/main/states/node/seniors/class_NodeReachableState.php svneol=native#text/plain
 application/hub/main/states/node/virgin/.htaccess -text svneol=unset#text/plain
 application/hub/main/states/node/virgin/class_NodeVirginState.php svneol=native#text/plain
 application/hub/main/states/peer/.htaccess -text svneol=unset#text/plain
index 7bec78aa8d9c6a952247a661a46f7ada3da3bcf3..49bee6e908cc197ef87144c67b4887a336793001 100644 (file)
@@ -516,6 +516,9 @@ $cfg->setConfigEntry('node_active_state_class', 'NodeActiveState');
 // CFG: NODE-ANNOUNCED-STATE-CLASS
 $cfg->setConfigEntry('node_announced_state_class', 'NodeAnnouncedState');
 
+// CFG: NODE-REACHABLE-STATE-CLASS
+$cfg->setConfigEntry('node_reachable_state_class', 'NodeReachableState');
+
 // CFG: NETWORK-PACKAGE-CLASS
 $cfg->setConfigEntry('network_package_class', 'NetworkPackage');
 
diff --git a/application/hub/main/states/node/seniors/.htaccess b/application/hub/main/states/node/seniors/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/hub/main/states/node/seniors/class_NodeReachableState.php b/application/hub/main/states/node/seniors/class_NodeReachableState.php
new file mode 100644 (file)
index 0000000..f4b8965
--- /dev/null
@@ -0,0 +1,60 @@
+<?php
+/**
+ * A Reachable node state class
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 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 NodeReachableState extends BaseNodeState implements Stateable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+
+               // Set state name
+               $this->setStateName('reachable');
+       }
+
+       /**
+        * Creates an instance of this class
+        *
+        * @param       $nodeInstance   An instance of a NodeHelper class
+        * @return      $stateInstance  An instance of a Stateable class
+        */
+       public final static function createNodeReachableState (NodeHelper $nodeInstance) {
+               // Get new instance
+               $stateInstance = new NodeReachableState();
+
+               // Debug message
+               $stateInstance->debugOutput('NODE-STATE: Has changed from ' . $nodeInstance->getPrintableState() . ' to ' . $stateInstance->getStateName() . '.');
+
+               // Set the node instance
+               $stateInstance->setNodeInstance($nodeInstance);
+
+               // Return the prepared instance
+               return $stateInstance;
+       }
+}
+
+// [EOF]
+?>