]> git.mxchange.org Git - hub.git/blobdiff - application/hub/main/states/dht/class_BaseDhtState.php
Introduced Recipient implentation classes:
[hub.git] / application / hub / main / states / dht / class_BaseDhtState.php
index e70151cbe6df5265f3ba2e6859b50a5ea2b1d40e..8a1223acfa1eda16bea775ca0063f6a4c8382488 100644 (file)
@@ -32,6 +32,21 @@ class BaseDhtState extends BaseState {
                // Call parent constructor
                parent::__construct($className);
        }
+
+       /**
+        * Validates whether the DHT state is 'init' or throws an exception if it
+        * is every other state.
+        *
+        * @return      void
+        * @throws      InvalidStateException   If the state is not 'active'
+        */
+       public function validateDhtStateIsInitialized () {
+               // Just compare it...
+               if (!$this instanceof DhtInitState) {
+                       // Throw the exception
+                       throw new InvalidStateException($this, self::EXCEPTION_INVALID_STATE);
+               } // END - if
+       }
 }
 
 // [EOF]