XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_SESSION_ID => '',
XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_TCP_PORT => 9060,
XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_UDP_PORT => 9060,
- XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_ANSWER_STATUS => '',
+ NetworkPackage::MESSAGE_DATA_ANSWER_STATUS => '',
);
}
// Init array
$this->dataXmlNodes = array(
- XmlRequestNodeListAnswerTemplateEngine::REQUEST_DATA_SESSION_ID => '',
- XmlRequestNodeListAnswerTemplateEngine::REQUEST_DATA_NODE_LIST => '',
- XmlRequestNodeListAnswerTemplateEngine::REQUEST_DATA_ANSWER_STATUS => '',
+ XmlRequestNodeListAnswerTemplateEngine::REQUEST_DATA_SESSION_ID => '',
+ XmlRequestNodeListAnswerTemplateEngine::REQUEST_DATA_NODE_LIST => '',
+ NetworkPackage::MESSAGE_DATA_ANSWER_STATUS => '',
);
}
*/
public function addArrayToDataSet (StoreableCriteria $dataSetInstance, array $messageData) {
// Add some generic data all messageData arrays provide
- $dataSetInstance->addCriteria(NodeListDatabaseWrapper::DB_COLUMN_ANSWER_STATUS, $messageData[XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_ANSWER_STATUS]);
+ $dataSetInstance->addCriteria(NodeListDatabaseWrapper::DB_COLUMN_ANSWER_STATUS, $messageData[NetworkPackage::MESSAGE_DATA_ANSWER_STATUS]);
$dataSetInstance->addCriteria(NodeListDatabaseWrapper::DB_COLUMN_MESSAGE_TYPE , $messageData[NetworkPackage::MESSAGE_ARRAY_TYPE]);
}
}
* @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);
const MESSAGE_ARRAY_DATA = 'message_data';
const MESSAGE_ARRAY_TYPE = 'message_type';
+ /**
+ * Generic answer status field
+ */
+ const MESSAGE_DATA_ANSWER_STATUS = 'answer_status';
+
/**
* Tags separator
*/
const ANNOUNCEMENT_DATA_INTERNAL_IP = 'my-internal-ip';
const ANNOUNCEMENT_DATA_TCP_PORT = 'my-tcp-port';
const ANNOUNCEMENT_DATA_UDP_PORT = 'my-udp-port';
- const ANNOUNCEMENT_DATA_ANSWER_STATUS = 'answer-status';
/**
* Protected constructor
'your-external-ip',
'your-internal-ip',
'your-session-id',
- // Answer status (code)
- self::ANNOUNCEMENT_DATA_ANSWER_STATUS
);
}
$this->getStackerInstance()->popNamed('node_announcement_answer');
}
- /**
- * Starts the answer-status
- *
- * @return void
- */
- protected function startAnswerStatus () {
- // Push the node name on the stacker
- $this->getStackerInstance()->pushNamed('node_announcement_answer', self::ANNOUNCEMENT_DATA_ANSWER_STATUS);
- }
-
- /**
- * Finishes the answer-status
- *
- * @return void
- */
- protected function finishAnswerStatus () {
- // Pop the last entry
- $this->getStackerInstance()->popNamed('node_announcement_answer');
- }
-
/**
* Finishes the announcement-answer
*
// Constants for array elements
const REQUEST_DATA_SESSION_ID = 'session-id';
const REQUEST_DATA_NODE_LIST = 'node-list';
- const REQUEST_DATA_ANSWER_STATUS = 'answer-status';
/**
* Protected constructor