XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_INTERNAL_IP => 'your_internal_ip',
XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_SESSION_ID => 'your_session_id'
);
+
+ // Init config-copy array
+ $this->configCopy = array(
+ XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_EXTERNAL_IP => 'external_ip',
+ XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_INTERNAL_IP => 'internal_ip',
+ XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_NODE_STATUS => 'node_status',
+ XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_SESSION_ID => 'session_id',
+ XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_TCP_PORT => 'node_tcp_listen_port',
+ XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_UDP_PORT => 'node_udp_listen_port'
+ );
}
/**
* @return void
*/
protected function initMessageConfigurationData (array $messageData) {
+ // Debug message
+ //* NOISY-DEBUG: */ $this->debugOutput('ANNOUNCEMENT-HANDLER: messageData=' . print_r($messageData, true));
+
// "Walk" throught the translation array
foreach ($this->messageToConfig as $messageKey => $configKey) {
+ // Debug message
+ /* NOISY-DEBUG: */ $this->debugOutput('ANNOUNCEMENT-HANDLER: Setting messageKey=' . $messageKey . ',configKey=' . $configKey . ':' . $messageData[$messageKey]);
+
// Set the element in configuration
$this->getConfigInstance()->setConfigEntry($configKey, $messageData[$messageKey]);
} // END - foreach
+ // "Walk" throught the config-copy array
+ foreach ($this->configCopy as $targetKey => $sourceKey) {
+ // Debug message
+ /* NOISY-DEBUG: */ $this->debugOutput('ANNOUNCEMENT-HANDLER: Copying from sourceKey=' . $sourceKey . ' to targetKey=' . $targetKey . '...');
+
+ // Copy from source to targetKey
+ $this->setConfigEntry($targetKey, $this->getConfigInstance()->getConfigEntry($sourceKey));
+ } // END - foreach
+
// Translate last exception into a status code
$statusCode = $this->getTranslatedStatusFromLastException();
$this->getConfigInstance()->unsetConfigEntry($configKey);
} // END - foreach
+ // "Walk" throught the config-copy array again
+ foreach ($this->configCopy as $configKey => $dummy) {
+ // Now unset this configuration entry (to save some memory again)
+ $this->getConfigInstance()->unsetConfigEntry($configKey);
+ } // END - foreach
+
// Remove 'answer_status' as well
$this->getConfigInstance()->unsetConfigEntry('answer_status');
}