*/
public function sendPackage (NodeHelper $nodeInstance) {
// Sanity check: Is the node in the approx. state? (active)
- $nodeInstance->getStateInstance()->validateNodeStateIsActive();
+ $nodeInstance->getStateInstance()->validateNodeStateIsActiveOrAnnounced();
// Compile the template, this inserts the loaded node data into the gaps.
$this->getTemplateInstance()->compileTemplate();
throw new InvalidStateException($this, self::EXCEPTION_INVALID_STATE);
} // END - if
}
+
+ /**
+ * Validates whether the state is 'active' or 'announced' or throws an
+ * exception if it is every other state.
+ *
+ * @return void
+ * @throws InvalidStateException If the state is not 'active'
+ */
+ public function validateNodeStateIsActiveOrAnnounced () {
+ // Just compare it...
+ if ((!$this instanceof NodeActiveState) && (!$this instanceof NodeAnnouncedState) {
+ // Throw the exception
+ throw new InvalidStateException($this, self::EXCEPTION_INVALID_STATE);
+ } // END - if
+ }
}
// [EOF]