]> git.mxchange.org Git - hub.git/blobdiff - application/hub/main/states/node/class_BaseNodeState.php
More debugging lines enabled (need to hunt down those bugs already :( ), added check...
[hub.git] / application / hub / main / states / node / class_BaseNodeState.php
index 3feeca035c1ff8bcc2481217d296c6115a35737f..2109465ebb63e6c339174d5d1234587dcae15657 100644 (file)
@@ -53,7 +53,7 @@ class BaseNodeState extends BaseState {
         * exception if it is every other state.
         *
         * @return      void
-        * @throws      InvalidStateException   If the state is not 'active'
+        * @throws      InvalidStateException   If the state is not 'active' and not 'announced'
         */
        public function validateNodeStateIsActiveOrAnnounced () {
                // Just compare it...
@@ -62,6 +62,21 @@ class BaseNodeState extends BaseState {
                        throw new InvalidStateException($this, self::EXCEPTION_INVALID_STATE);
                } // END - if
        }
+
+       /**
+        * Validates whether the state is 'active' or 'reachable' or throws an
+        * exception if it is every other state.
+        *
+        * @return      void
+        * @throws      InvalidStateException   If the state is not 'active' and not 'reachable'
+        */
+       public function validateNodeStateIsActiveOrReachable () {
+               // Just compare it...
+               if ((!$this instanceof NodeActiveState) && (!$this instanceof NodeReachableState)) {
+                       // Throw the exception
+                       throw new InvalidStateException($this, self::EXCEPTION_INVALID_STATE);
+               } // END - if
+       }
 }
 
 // [EOF]