return $acceptAnnouncements;
}
+ /**
+ * Checks whether this node has attempted to announce itself
+ *
+ * @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 () {
+ // Debug message
+ /* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NODE: ifNodeHasAnnounced(): state=' . $this->getStateInstance()->getStateName());
+
+ // Simply check the state of this node
+ $hasAnnounced = ($this->getStateInstance() instanceof NodeAnnouncedState);
+
+ // Debug message
+ /* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NODE: ifNodeHasAnnounced(): hasAnnounced=' . intval($hasAnnounced));
+
+ // Return it
+ return $hasAnnounced;
+ }
+
/**
* Checks whether this node has attempted to announce itself and completed it
*
- * @return $hasAnnounced Whether this node has attempted to announce itself and completed it
+ * @return $hasAnnouncementCompleted Whether this node has attempted to announce itself and completed it
* @todo Add checking if this node has been announced to the sender node
*/
public function ifNodeHasAnnouncementCompleted () {
/* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NODE: ifNodeHasAnnouncementCompleted(): state=' . $this->getStateInstance()->getStateName());
// Simply check the state of this node
- $hasAnnounced = ($this->getStateInstance() instanceof NodeAnnouncementCompletedState);
+ $hasAnnouncementCompleted = ($this->getStateInstance() instanceof NodeAnnouncementCompletedState);
// Debug message
- /* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NODE: ifNodeHasAnnouncementCompleted(): hasAnnounced=' . intval($hasAnnounced));
+ /* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NODE: ifNodeHasAnnouncementCompleted(): hasAnnouncementCompleted=' . intval($hasAnnouncementCompleted));
// Return it
- return $hasAnnounced;
+ return $hasAnnouncementCompleted;
}
/**
* @todo Handle thrown exception
*/
public function handleAnswerStatusByMessageData (array $messageData, Receivable $packageInstance) {
+ // Is it not empty?
+ assert(!empty($messageData[NetworkPackage::MESSAGE_DATA_ANSWER_STATUS]));
+
// Construct configuration entry for handling class' name
- $classConfigEntry = strtolower($messageData[NetworkPackage::MESSAGE_ARRAY_TYPE] . '_status_' . $messageData[XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_ANSWER_STATUS]) . '_handler_class';
+ $classConfigEntry = strtolower($messageData[NetworkPackage::MESSAGE_ARRAY_TYPE] . '_status_' . $messageData[NetworkPackage::MESSAGE_DATA_ANSWER_STATUS]) . '_handler_class';
// Try to get a class
$handlerInstance = ObjectFactory::createObjectByConfiguredName($classConfigEntry);