a_counterRecorderClock = NULL;
a_workingNode = NULL;
+ a_operatedHost = NULL;
a_httpServerSocket = NULL;
}
-std::string Launcher::getSignalUSR2InputFile() const throw() {
+std::string Launcher::getSignalUSR2InputFile() const {
return (getInitialWorkingDirectory() + "/" + SIGUSR2_TASKS_INPUT_FILENAME);
}
-std::string Launcher::getSignalUSR2OutputFile() const throw() {
+std::string Launcher::getSignalUSR2OutputFile() const {
return (getInitialWorkingDirectory() + "/" + SIGUSR2_TASKS_OUTPUT_FILENAME);
}
-void Launcher::servicesFromXML(const anna::xml::Node* servicesNode, bool bindResources) throw(anna::RuntimeException) {
+void Launcher::servicesFromXML(const anna::xml::Node* servicesNode, bool bindResources) noexcept(false) {
CommandLine& cl(anna::CommandLine::instantiate());
bool allLogsDisabled = cl.exists("disableLogs");
// We will register a scope per stack id registered. The counters will be dynamically registered at count method.
anna::diameter::comm::ApplicationMessageOamModule & appMsgOamModule = anna::diameter::comm::ApplicationMessageOamModule::instantiate();
appMsgOamModule.enableCounters(); // this special module is disabled by default (the only)
- static int scope_id = 3;
+ static int scope_id = 3 + appMsgOamModule.scopes();
+
unsigned int id_value;
std::string codecEngineName;
}
/////////////////////////////////////////////////////////////////////////////////////////////
- // Diameter communication engine:
+ // Diameter communication engine: ONE ENGINE PER OWN ORIGIN HOST
std::string commEngineName = originHost->getValue() + "_DiameterCommEngine";
MyDiameterEngine *commEngine = new MyDiameterEngine(commEngineName.c_str(), bpd);
commEngine->setAutoBind(false); // allow to create client-sessions without binding them, in order to set timeouts.
if (originRealm) commEngine->setOriginRealmName(originRealm->getValue());
// Origin host node:
- a_workingNode = new anna::diameter::comm::OriginHost((anna::diameter::comm::Engine*)commEngine, applicationId);
+ a_workingNode = new anna::diameter::comm::OriginHost((anna::diameter::comm::Engine*)commEngine, applicationId /* OriginHost constructor extracts corresponding stack codec engine */);
a_workingNode->setRequestRetransmissions(retransmissions);
/////////////////////////////////////////////////////////////////////////////////////////////
commEngine->setNumberOfClientSessionsPerServer(sessions);
// Client CER and DWR
- std::string cerPathfile = cer ? cer->getValue() : "";
- std::string dwrPathfile = dwr ? dwr->getValue() : "";
- commEngine->setClientCERandDWR(cerPathfile, dwrPathfile);
+ if (cer) { // pathfile provided
+ commEngine->setClientCER(cer->getValue());
+ }
+ else {
+ commEngine->setClientCER(applicationId); // default engine CER
+ }
+ commEngine->setClientDWR(dwr ? dwr->getValue() : "" /* default DWR */);
// Register one entity for this engine:
a_workingNode->createEntity(entity->getValue(), ceaTimeoutMs, answersTimeoutMs);
}
-void Launcher::loadServicesFromFile(const std::string & xmlPathFile, bool bindResources) throw(anna::RuntimeException) {
+void Launcher::loadServicesFromFile(const std::string & xmlPathFile, bool bindResources) noexcept(false) {
if (xmlPathFile == "null" || xmlPathFile == "") {
LOGWARNING(anna::Logger::warning("Ignoring services configuration on start: empty or 'null' string provided as xml file. Use management interface (operation 'services') in order to add services", ANNA_FILE_LOCATION));
}
-void Launcher::loadServicesFromXMLString(const std::string & xmlString, bool bindResources) throw(anna::RuntimeException) {
+void Launcher::loadServicesFromXMLString(const std::string & xmlString, bool bindResources) noexcept(false) {
anna::xml::DocumentMemory xmlDocument; // has private copy constructor defined but not implemented to avoid inhenrit/copy (is very heavy)
anna::xml::DTDMemory xmlDTD;
}
-anna::Millisecond Launcher::checkTimeMeasure(const std::string ¶meter, const std::string &value) throw(anna::RuntimeException) {
+anna::Millisecond Launcher::checkTimeMeasure(const std::string ¶meter, const std::string &value) noexcept(false) {
if(anna::functions::isLike("^[0-9]+$", value)) { // para incluir numeros decimales: ^[0-9]+(.[0-9]+)?$
int msecs;
throw RuntimeException(msg, ANNA_FILE_LOCATION);
}
-bool Launcher::setWorkingNode(const std::string &name) throw() {
+bool Launcher::setWorkingNode(const std::string &name) {
bool result = false;
anna::diameter::comm::OriginHostManager &ohm = anna::diameter::comm::OriginHostManager::instantiate();
return result;
}
-anna::diameter::comm::OriginHost *Launcher::getOriginHost(const std::string &name) const throw(anna::RuntimeException) {
+anna::diameter::comm::OriginHost *Launcher::getOriginHost(const std::string &name) const noexcept(false) {
anna::diameter::comm::OriginHostManager &ohm = anna::diameter::comm::OriginHostManager::instantiate();
anna::diameter::comm::OriginHost *result = ohm.getOriginHost(name);
return result;
}
-anna::diameter::comm::OriginHost *Launcher::getOriginHost(const anna::diameter::codec::Message &message) const throw(anna::RuntimeException) {
+anna::diameter::comm::OriginHost *Launcher::getOriginHost(const anna::diameter::codec::Message &message) const noexcept(false) {
std::string originHost = message.getAvp(anna::diameter::helpers::base::AVPID__Origin_Host)->getDiameterIdentity()->getValue();
return (getOriginHost(originHost));
}
-bool Launcher::uniqueOriginHost() const throw() {
+anna::diameter::comm::OriginHost *Launcher::getOriginHost(const anna::DataBlock &messageDataBlock) const noexcept(false) {
+ std::string originHost = anna::diameter::helpers::base::functions::getOriginHost(messageDataBlock);
+ return (getOriginHost(originHost));
+}
+
+bool Launcher::uniqueOriginHost() const {
anna::diameter::comm::OriginHostManager &ohm = anna::diameter::comm::OriginHostManager::instantiate();
return (ohm.size() == 1);
}
-
-void Launcher::updateOperatedOriginHostWithMessage(const anna::diameter::codec::Message &message) throw(anna::RuntimeException) {
+void Launcher::updateOperatedOriginHostWithMessage(const anna::diameter::codec::Message &message) noexcept(false) {
if (!a_operatedHost) // priority for working node by mean 'node' operation
a_operatedHost = getOriginHost(message);
}
-anna::diameter::comm::OriginHost *Launcher::getWorkingNode() const throw(anna::RuntimeException) {
+void Launcher::updateOperatedOriginHostWithMessage(const anna::DataBlock &messageDataBlock) noexcept(false) {
+ if (!a_operatedHost) // priority for working node by mean 'node' operation
+ a_operatedHost = getOriginHost(messageDataBlock);
+}
+
+anna::diameter::comm::OriginHost *Launcher::getWorkingNode() const noexcept(false) {
if(!a_workingNode)
throw anna::RuntimeException("Working node not identified (try to load services)", ANNA_FILE_LOCATION);
return a_workingNode;
}
-anna::diameter::comm::OriginHost *Launcher::getOperatedHost() const throw(anna::RuntimeException) {
+anna::diameter::comm::OriginHost *Launcher::getOperatedHost() const noexcept(false) {
if(!a_operatedHost)
throw anna::RuntimeException("Node not identified (try to force a specific Origin-Host with 'node' operation)", ANNA_FILE_LOCATION);
a_operatedHost = op;
}
-MyDiameterEntity *Launcher::getOperatedEntity() const throw(anna::RuntimeException) {
+MyDiameterEntity *Launcher::getOperatedEntity() const noexcept(false) {
MyDiameterEntity *result = (MyDiameterEntity *)(getOperatedHost()->getEntity());
if (!result)
throw anna::RuntimeException("No entity configured for the operated node", ANNA_FILE_LOCATION);
return result;
}
-MyLocalServer *Launcher::getOperatedServer() const throw(anna::RuntimeException) {
+MyLocalServer *Launcher::getOperatedServer() const noexcept(false) {
MyLocalServer *result = (MyLocalServer *)(getOperatedHost()->getDiameterServer());
if (!result)
throw anna::RuntimeException("No local server configured for the operated node", ANNA_FILE_LOCATION);
return result;
}
-MyDiameterEngine *Launcher::getOperatedEngine() const throw(anna::RuntimeException) {
+MyDiameterEngine *Launcher::getOperatedEngine() const noexcept(false) {
return (MyDiameterEngine *)getOperatedHost()->getCommEngine(); // never will be NULL
}
void Launcher::initialize()
-throw(anna::RuntimeException) {
+noexcept(false) {
anna::comm::Application::initialize();
CommandLine& cl(anna::CommandLine::instantiate());
anna::comm::Communicator::WorkMode::_v workMode(anna::comm::Communicator::WorkMode::Single);
}
void Launcher::run()
-throw(anna::RuntimeException) {
+noexcept(false) {
LOGMETHOD(anna::TraceMethod tm("Launcher", "run", ANNA_FILE_LOCATION));
CommandLine& cl(anna::CommandLine::instantiate());
anna::diameter::stack::Engine::instantiate();
a_communicator->accept();
}
-bool Launcher::getDataBlockFromHexFile(const std::string &pathfile, anna::DataBlock &db) const throw(anna::RuntimeException) {
+bool Launcher::getDataBlockFromHexFile(const std::string &pathfile, anna::DataBlock &db) const noexcept(false) {
// Get hex string
static char buffer[8192];
std::ifstream infile(pathfile.c_str(), std::ifstream::in);
return false;
}
-void Launcher::resetStatistics() throw() {
+void Launcher::resetStatistics() {
if (a_workingNode) {
a_workingNode->getCommEngine()->resetStatistics();
}
}
}
-void Launcher::resetCounters() throw() {
+void Launcher::resetCounters() {
anna::diameter::comm::OamModule::instantiate().resetCounters();
anna::diameter::comm::ApplicationMessageOamModule::instantiate().resetCounters();
anna::diameter::codec::OamModule::instantiate().resetCounters();
}
-void Launcher::signalTerminate() throw(anna::RuntimeException) {
+void Launcher::signalTerminate() noexcept(false) {
LOGMETHOD(anna::TraceMethod tm("Launcher", "signalTerminate", ANNA_FILE_LOCATION));
forceCountersRecord();
comm::Application::signalTerminate ();
}
-void Launcher::signalUSR2() throw(anna::RuntimeException) {
+void Launcher::signalUSR2() noexcept(false) {
std::string inputFile = getSignalUSR2InputFile();
std::string outputFile = getSignalUSR2OutputFile();
}
-void Launcher::logStatisticsSamples(const std::string &conceptsList) throw() {
+void Launcher::logStatisticsSamples(const std::string &conceptsList) {
anna::statistics::Engine &statEngine = anna::statistics::Engine::instantiate();
if(conceptsList == "all") {
}
-bool Launcher::eventOperation(const std::string &operation, std::string &response) throw(anna::RuntimeException) {
+bool Launcher::eventOperation(const std::string &operation, std::string &response) noexcept(false) {
bool result = true;
outfile.write(xmlString.c_str(), xmlString.size());
outfile.close();
} else if((opType == "hide") || (opType == "show") || (opType == "hidden") || (opType == "shown")) {
- return eop.visibility(opt_response, opType, param1, (param2 != "") ? atoi(param2.c_str()) : -1);
+ result = eop.visibility(opt_response, opType, param1, (param2 != "") ? atoi(param2.c_str()) : -1);
} else if((opType == "sendxml2e") || (opType == "sendhex2e")) {
anna::diameter::comm::Message *msg;
// Get DataBlock from file with hex content:
if(!getDataBlockFromHexFile(param1, db_aux))
throw anna::RuntimeException("Error reading hex file provided", ANNA_FILE_LOCATION);
+ updateOperatedOriginHostWithMessage(db_aux);
msg = getOperatedHost()->createCommMessage();
msg->setBody(db_aux);
try { if(getOperatedHost()->logEnabled()) codecMsg.decode(db_aux); } catch(anna::RuntimeException &ex) { ex.trace(); }
if(getOperatedHost()->logEnabled()) {
anna::diameter::comm::Server *usedServer = getOperatedEntity()->getLastUsedResource();
anna::diameter::comm::ClientSession *usedClientSession = usedServer ? usedServer->getLastUsedResource() : NULL;
- std::string detail = usedClientSession ? usedClientSession->asString() : "<null client session>"; // shouldn't happen
+ std::string detail = usedClientSession ? usedClientSession->asString() : "[null client session]"; // shouldn't happen
getOperatedHost()->writeLogFile(codecMsg, (success ? "sent2e" : "send2eError"), detail);
}
+ } else if((opType == "sendxml2c") || (opType == "sendhex2c")) {
+ anna::diameter::comm::Message *msg;
+
+ if(opType == "sendxml2c") {
+ codecMsg.loadXMLFile(param1);
+ updateOperatedOriginHostWithMessage(codecMsg);
+ msg = getOperatedHost()->createCommMessage();
+ msg->clearBody();
+ try { codecMsg.valid(); } catch(anna::RuntimeException &ex) { ex.trace(); } // at least we need to see validation errors although it will continue sending (see validation mode configured in launcher)
+
+ msg->setBody(codecMsg.code());
+ } else {
+ // Get DataBlock from file with hex content:
+ if(!getDataBlockFromHexFile(param1, db_aux))
+ throw anna::RuntimeException("Error reading hex file provided", ANNA_FILE_LOCATION);
+ updateOperatedOriginHostWithMessage(db_aux);
+ msg = getOperatedHost()->createCommMessage();
+ msg->setBody(db_aux);
+ }
+
+ bool success = getOperatedServer()->send(msg);
+ getOperatedHost()->releaseCommMessage(msg);
+
+ // Detailed log:
+ if(getOperatedHost()->logEnabled()) {
+ anna::diameter::comm::ServerSession *usedServerSession = getOperatedServer()->getLastUsedResource();
+ std::string detail = usedServerSession ? usedServerSession->asString() : "[null server session]"; // shouldn't happen
+ getOperatedHost()->writeLogFile(codecMsg, (success ? "sent2c" : "send2cError"), detail);
+ }
+ } else if(opType == "answerxml2e") {
+
+ if(param1 == "") { // programmed answers FIFO's to stdout
+ response = getOperatedHost()->getReactingAnswers()->asString("ANSWERS TO ENTITY");
+ return true; // OK
+ } else if (param1 == "rotate") {
+ getOperatedHost()->getReactingAnswers()->rotate(true);
+ } else if (param1 == "exhaust") {
+ getOperatedHost()->getReactingAnswers()->rotate(false);
+ } else if (param1 == "clear") {
+ getOperatedHost()->getReactingAnswers()->clear();
+ } else if (param1 == "dump") {
+ getOperatedHost()->getReactingAnswers()->dump("programmed_answer");
+ } else {
+ codecMsg.loadXMLFile(param1);
+ updateOperatedOriginHostWithMessage(codecMsg);
+ anna::diameter::codec::Message *message = getOperatedHost()->getCodecEngine()->createMessage(param1); // loads xml again, lesser of two evils
+ LOGDEBUG(anna::Logger::debug(message->asXMLString(), ANNA_FILE_LOCATION));
+
+ if(message->isRequest())
+ throw anna::RuntimeException("Cannot program diameter requests. Answer type must be provided", ANNA_FILE_LOCATION);
+
+ int code = message->getId().first;
+ LOGDEBUG(anna::Logger::debug("Adding a new programed 'answer to entity' to the FIFO queue corresponding to its message code ...", ANNA_FILE_LOCATION));
+ getOperatedHost()->getReactingAnswers()->addMessage(code, message);
+ }
+ } else if(opType == "answerxml2c") {
+
+ if(param1 == "") { // programmed answers FIFO's to stdout
+ response = getOperatedHost()->getReactingAnswers()->asString("ANSWERS TO CLIENT");
+ return true; // OK
+ } else if (param1 == "rotate") {
+ getOperatedHost()->getReactingAnswers()->rotate(true);
+ } else if (param1 == "exhaust") {
+ getOperatedHost()->getReactingAnswers()->rotate(false);
+ } else if (param1 == "clear") {
+ getOperatedHost()->getReactingAnswers()->clear();
+ } else if (param1 == "dump") {
+ getOperatedHost()->getReactingAnswers()->dump("programmed_answer");
+ } else {
+ codecMsg.loadXMLFile(param1);
+ updateOperatedOriginHostWithMessage(codecMsg);
+ anna::diameter::codec::Message *message = getOperatedHost()->getCodecEngine()->createMessage(param1); // loads xml again, lesser of two evils
+ LOGDEBUG(anna::Logger::debug(message->asXMLString(), ANNA_FILE_LOCATION));
+
+ if(message->isRequest())
+ throw anna::RuntimeException("Cannot program diameter requests. Answer type must be provided", ANNA_FILE_LOCATION);
+
+ int code = message->getId().first;
+ LOGDEBUG(anna::Logger::debug("Adding a new programed 'answer to client' to the FIFO queue corresponding to its message code ...", ANNA_FILE_LOCATION));
+ getOperatedHost()->getReactingAnswers()->addMessage(code, message);
+ }
} else if((opType == "burst")) {
if (!uniqueOriginHost())
limit = atoi(param2.c_str());
testManager.setInProgressLimit(limit);
opt_response = "new in-progress limit: ";
- opt_response += (limit != UINT_MAX) ? anna::functions::asString(limit) : "<no limit>";
+ opt_response += (limit != UINT_MAX) ? anna::functions::asString(limit) : "[no limit]";
}
else {
opt_response = "in-progress limit amount: ";
limit = testManager.getInProgressLimit();
- opt_response += (limit != UINT_MAX) ? anna::functions::asString(limit) : "<no limit>";
+ opt_response += (limit != UINT_MAX) ? anna::functions::asString(limit) : "[no limit]";
opt_response += "; currently there are ";
opt_response += anna::functions::asString(testManager.getInProgressCount());
opt_response += " test cases running";
if (numParams > 1)
throw anna::RuntimeException("Wrong body content format on HTTP Request. Check 'HELP.md' for more information.", ANNA_FILE_LOCATION);
- if (testManager.clearPool()) {
- opt_response = "all the programmed test cases have been dropped";
- }
- else {
- opt_response = "there are not programmed test cases to be removed";
- }
+ result = testManager.clearPool(opt_response);
}
else if(param1 == "junit") {
response = testManager.junitAsXMLString();
std::string::size_type pos, pos_1, pos_2;
pos = regexp.find("end-to-end-id=", 0u);
- pos = regexp.find("\"", pos);
- pos_1 = pos;
- pos = regexp.find("\"", pos+1);
- pos_2 = pos;
- regexp.replace(pos_1 + 1, pos_2 - pos_1 - 1, "[0-9]+");
+ if (pos != std::string::npos) {
+ pos = regexp.find("\"", pos);
+ pos_1 = pos;
+ pos = regexp.find("\"", pos+1);
+ pos_2 = pos;
+ regexp.replace(pos_1 + 1, pos_2 - pos_1 - 1, "[0-9]+");
+ }
pos = regexp.find("hop-by-hop-id=", 0u);
- pos = regexp.find("\"", pos);
- pos_1 = pos;
- pos = regexp.find("\"", pos+1);
- pos_2 = pos;
- regexp.replace(pos_1 + 1, pos_2 - pos_1 - 1, "[0-9]+");
+ if (pos != std::string::npos) {
+ pos = regexp.find("\"", pos);
+ pos_1 = pos;
+ pos = regexp.find("\"", pos+1);
+ pos_2 = pos;
+ regexp.replace(pos_1 + 1, pos_2 - pos_1 - 1, "[0-9]+");
+ }
// For this representation: <avp name="Origin-State-Id" data="1428633668"/>
//pos = regexp.find("Origin-State-Id", 0u);
//regexp.replace(pos_1 + 1, pos_2 - pos_1 - 1, "[0-9]+");
// But we have this one: <avp data="1428633668" name="Origin-State-Id"/>
pos = regexp.find("Origin-State-Id", 0u);
- pos = regexp.rfind("\"", pos);
- pos = regexp.rfind("\"", pos-1);
- pos = regexp.rfind("\"", pos-1);
- pos_1 = pos;
- pos = regexp.find("\"", pos+1);
- pos_2 = pos;
- regexp.replace(pos_1 + 1, pos_2 - pos_1 - 1, "[0-9]+");
+ if (pos != std::string::npos) {
+ pos = regexp.rfind("\"", pos);
+ pos = regexp.rfind("\"", pos-1);
+ pos = regexp.rfind("\"", pos-1);
+ pos_1 = pos;
+ pos = regexp.find("\"", pos+1);
+ pos_2 = pos;
+ regexp.replace(pos_1 + 1, pos_2 - pos_1 - 1, "[0-9]+");
+ }
//regexp.insert(0, "^");
//regexp += "$";
}
}
- } else if((opType == "sendxml2c") || (opType == "sendhex2c")) {
- anna::diameter::comm::Message *msg;
-
- if(opType == "sendxml2c") {
- codecMsg.loadXMLFile(param1);
- updateOperatedOriginHostWithMessage(codecMsg);
- msg = getOperatedHost()->createCommMessage();
- msg->clearBody();
- try { codecMsg.valid(); } catch(anna::RuntimeException &ex) { ex.trace(); } // at least we need to see validation errors although it will continue sending (see validation mode configured in launcher)
-
- msg->setBody(codecMsg.code());
- } else {
- // Get DataBlock from file with hex content:
- if(!getDataBlockFromHexFile(param1, db_aux))
- throw anna::RuntimeException("Error reading hex file provided", ANNA_FILE_LOCATION);
- msg = getOperatedHost()->createCommMessage();
- msg->setBody(db_aux);
- }
-
- bool success = getOperatedServer()->send(msg);
- getOperatedHost()->releaseCommMessage(msg);
-
- // Detailed log:
- if(getOperatedHost()->logEnabled()) {
- anna::diameter::comm::ServerSession *usedServerSession = getOperatedServer()->getLastUsedResource();
- std::string detail = usedServerSession ? usedServerSession->asString() : "<null server session>"; // shouldn't happen
- getOperatedHost()->writeLogFile(codecMsg, (success ? "sent2c" : "send2cError"), detail);
- }
} else if(opType == "loadxml") {
codecMsg.loadXMLFile(param1);
response = codecMsg.asXMLString();
int diameterServerSessions = atoi(param1.c_str());
getOperatedServer()->setMaxConnections(diameterServerSessions);
- } else if(opType == "answerxml2c") {
- if(param1 == "") { // programmed answers FIFO's to stdout
- response = getOperatedServer()->getReactingAnswers()->asString("ANSWERS TO CLIENT");
- return true; // OK
- } else if (param1 == "rotate") {
- getOperatedServer()->getReactingAnswers()->rotate(true);
- } else if (param1 == "exhaust") {
- getOperatedServer()->getReactingAnswers()->rotate(false);
- } else if (param1 == "clear") {
- getOperatedServer()->getReactingAnswers()->clear();
- } else if (param1 == "dump") {
- getOperatedServer()->getReactingAnswers()->dump("programmed_answer");
- } else {
- codecMsg.loadXMLFile(param1);
- updateOperatedOriginHostWithMessage(codecMsg);
- anna::diameter::codec::Message *message = getOperatedHost()->getCodecEngine()->createMessage(param1); // loads xml again, lesser of two evils
- LOGDEBUG(anna::Logger::debug(message->asXMLString(), ANNA_FILE_LOCATION));
-
- if(message->isRequest())
- throw anna::RuntimeException("Cannot program diameter requests. Answer type must be provided", ANNA_FILE_LOCATION);
-
- int code = message->getId().first;
- LOGDEBUG(anna::Logger::debug("Adding a new programed 'answer to client' to the FIFO queue corresponding to its message code ...", ANNA_FILE_LOCATION));
- getOperatedServer()->getReactingAnswers()->addMessage(code, message);
- }
- } else if(opType == "answerxml2e") {
-
- if(param1 == "") { // programmed answers FIFO's to stdout
- response = getOperatedEntity()->getReactingAnswers()->asString("ANSWERS TO ENTITY");
- return true; // OK
- } else if (param1 == "rotate") {
- getOperatedEntity()->getReactingAnswers()->rotate(true);
- } else if (param1 == "exhaust") {
- getOperatedEntity()->getReactingAnswers()->rotate(false);
- } else if (param1 == "clear") {
- getOperatedEntity()->getReactingAnswers()->clear();
- } else if (param1 == "dump") {
- getOperatedEntity()->getReactingAnswers()->dump("programmed_answer");
- } else {
- codecMsg.loadXMLFile(param1);
- updateOperatedOriginHostWithMessage(codecMsg);
- anna::diameter::codec::Message *message = getOperatedHost()->getCodecEngine()->createMessage(param1); // loads xml again, lesser of two evils
- LOGDEBUG(anna::Logger::debug(message->asXMLString(), ANNA_FILE_LOCATION));
- if(message->isRequest())
- throw anna::RuntimeException("Cannot program diameter requests. Answer type must be provided", ANNA_FILE_LOCATION);
- int code = message->getId().first;
- LOGDEBUG(anna::Logger::debug("Adding a new programed 'answer to entity' to the FIFO queue corresponding to its message code ...", ANNA_FILE_LOCATION));
- getOperatedEntity()->getReactingAnswers()->addMessage(code, message);
- }
} else {
throw anna::RuntimeException("Wrong body content format on HTTP Request. Check 'HELP.md' for more information.", ANNA_FILE_LOCATION);
}
+
+
// HTTP response
response = "Operation correctly processed: "; response += operation;
if (opt_response != "") {
}
anna::xml::Node* Launcher::asXML(anna::xml::Node* parent) const
-throw() {
+{
anna::xml::Node* result = parent->createChild("launcher");
anna::comm::Application::asXML(result);
// Timming:
}
anna::xml::Node* Launcher::oamAsXML(anna::xml::Node* parent) const
-throw() {
+{
anna::xml::Node* result = parent->createChild("Oam");
// OAM:
}
anna::xml::Node* Launcher::statsAsXML(anna::xml::Node* parent) const
-throw() {
+{
anna::xml::Node* result = parent->createChild("Statistics");
// Statistics: