*
* @return $hasAnnounced Whether this node has attempted to announce itself
*/
- function ifNodeHasAnnounced ();
+ function ifNodeIsAnnouncing ();
/**
* Checks whether this node has attempted to announce itself and completed it
$nodeInstance = Registry::getRegistry()->getInstance('node');
// Has this node attempted to announce itself?
- if (!$nodeInstance->ifNodeHasAnnounced()) {
+ if (!$nodeInstance->ifNodeIsAnnouncing()) {
/*
* This node has never announced itself, so it doesn't expect
* announcement answer messages.
*/
public function sendPackage (NodeHelper $nodeInstance) {
// Sanity check: Is the node in the approx. state? (active)
- $nodeInstance->getStateInstance()->validateNodeStateIsActiveOrAnnounced();
+ $nodeInstance->getStateInstance()->validateNodeStateIsActiveOrAnnouncing();
// Compile the template, this inserts the loaded node data into the gaps.
$this->getTemplateInstance()->compileTemplate();
* @return $hasAnnounced Whether this node has attempted to announce itself
* @todo Add checking if this node has been announced to the sender node
*/
- public function ifNodeHasAnnounced () {
+ public function ifNodeIsAnnouncing () {
// Debug message
- //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NODE[' . __METHOD__ . ':' . __LINE__ . ']: ifNodeHasAnnounced(): state=' . $this->getStateInstance()->getStateName());
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NODE[' . __METHOD__ . ':' . __LINE__ . ']: ifNodeIsAnnouncing(): state=' . $this->getStateInstance()->getStateName());
// Simply check the state of this node
- $hasAnnounced = ($this->getStateInstance() instanceof NodeAnnouncedState);
+ $hasAnnounced = ($this->getStateInstance() instanceof NodeAnnouncingState);
// Debug message
- //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NODE[' . __METHOD__ . ':' . __LINE__ . ']: ifNodeHasAnnounced(): hasAnnounced=' . intval($hasAnnounced));
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NODE[' . __METHOD__ . ':' . __LINE__ . ']: ifNodeIsAnnouncing(): hasAnnounced=' . intval($hasAnnounced));
// Return it
return $hasAnnounced;
* @return void
* @throws InvalidStateException If the state is not 'active' and not 'announcing'
*/
- public function validateNodeStateIsActiveOrAnnounced () {
+ public function validateNodeStateIsActiveOrAnnouncing () {
// Just compare it...
- if ((!$this instanceof NodeActiveState) && (!$this instanceof NodeAnnouncedState)) {
+ if ((!$this instanceof NodeActiveState) && (!$this instanceof NodeAnnouncingState)) {
// Throw the exception
throw new InvalidStateException($this, self::EXCEPTION_INVALID_STATE);
} // END - if