// Process
#include <Launcher.hpp>
-#include <RealmNode.hpp>
+#include <OriginHost.hpp>
#include <MyDiameterEngine.hpp>
#include <TestManager.hpp>
#include <TestCase.hpp>
-->\n\
\n\
<!ELEMENT node EMPTY>\n\
-<!ATTLIST node originRealm CDATA #REQUIRED applicationId CDATA #REQUIRED originHost CDATA #IMPLIED cer CDATA #IMPLIED dwr CDATA #IMPLIED allowedInactivityTime CDATA #IMPLIED tcpConnectDelay CDATA #IMPLIED answersTimeout CDATA #IMPLIED ceaTimeout CDATA #IMPLIED watchdogPeriod CDATA #IMPLIED entity CDATA #IMPLIED entityServerSessions CDATA #IMPLIED diameterServer CDATA #IMPLIED diameterServerSessions CDATA #IMPLIED balance (yes | no) #IMPLIED sessionBasedModelsClientSocketSelection (SessionIdLowPart | SessionIdHighPart | SessionIdOptionalPart | RoundRobin) #IMPLIED retries CDATA #IMPLIED log CDATA #IMPLIED splitLog (yes | no) #IMPLIED detailedLog (yes | no) #IMPLIED dumpLog (yes | no) #IMPLIED burstLog (yes | no) #IMPLIED>\n\
+<!ATTLIST node originHost CDATA #REQUIRED applicationId CDATA #REQUIRED originRealm CDATA #IMPLIED cer CDATA #IMPLIED dwr CDATA #IMPLIED allowedInactivityTime CDATA #IMPLIED tcpConnectDelay CDATA #IMPLIED answersTimeout CDATA #IMPLIED ceaTimeout CDATA #IMPLIED watchdogPeriod CDATA #IMPLIED entity CDATA #IMPLIED entityServerSessions CDATA #IMPLIED diameterServer CDATA #IMPLIED diameterServerSessions CDATA #IMPLIED balance (yes | no) #IMPLIED sessionBasedModelsClientSocketSelection (SessionIdLowPart | SessionIdHighPart | SessionIdOptionalPart | RoundRobin) #IMPLIED retries CDATA #IMPLIED log CDATA #IMPLIED splitLog (yes | no) #IMPLIED detailedLog (yes | no) #IMPLIED dumpLog (yes | no) #IMPLIED burstLog (yes | no) #IMPLIED>\n\
<!--\n\
Node record\n\
\n\
- originRealm: Node identifier (Origin-Realm name).\n\
+ originHost: Node identifier as diameter application host name.\n\
applicationId: The Application-Id provided must exists as a registered 'stack id'.\n\
- originHost: Diameter application host name (system name). If missing, process sets o.s. hostname.\n\
- Note that if you have two or more realms, the names must be different.\n\
+ originRealm: Origin-Realm (domain-name internally used by default).\n\
cer: User defined CER path file to be encoded to establish diameter connections.\n\
If missing, will be harcoded.\n\
dwr: User defined DWR path file to be encoded for diameter protocol keep alive.\n\
analysis behaviour providing 'SessionIdHighPart', 'SessionIdOptionalPart' (atoi applied;\n\
usually subscriber id data, i.e. MSISDN or IMSI) and 'RoundRobin' (also 'SessionIdLowPart').\n\
retries: Expired responses will cause a number of request retransmissions. Disabled by default (0 retries).\n\
- log: Process log file (operations result, traffic log, etc.). By default '<originRealm>.launcher.log'.\n\
+ log: Process log file (operations result, traffic log, etc.). By default '<originHost>.launcher.log'.\n\
Empty string or \"null\" name, to disable. Warning: there is no rotation for log files\n\
(use logrotate or whatever you consider).\n\
splitLog: Splits log file (appends to log filename, extensions with the type of event: see help on\n\
detailedLog: Insert detailed information at log files. Should be disabled on automatic tests. Useful on\n\
'balance' mode to know messages flow along the sockets. Default value 'no'.\n\
dumpLog: Write to disk every incoming/outcoming message named as:\n\
- '<originRealm>.<hop by hop>.<end to end>.<message code>.<request|answer>.<type of event>.xml'\n\
+ '<originHost>.<hop by hop>.<end to end>.<message code>.<request|answer>.<type of event>.xml'\n\
Default value 'no'.\n\
- burstLog: Burst operations log file. By default '<originRealm>.launcher.burst'. Empty string or \"null\" name, to disable.\n\
+ burstLog: Burst operations log file. By default '<originHost>.launcher.burst'. Empty string or \"null\" name, to disable.\n\
Warning: there is no rotation for log files (use logrotate or whatever). Output: dot (.) for each\n\
burst message sent/pushed, cross (x) for popped ones, and order number when multiple of 1% of burst\n\
list size, plus OTA requests when changed.\n\
//a_admlMinResolution = (anna::Millisecond)100;
a_counterRecorderClock = NULL;
- // a_nodes.clear();
+ // a_originHosts.clear();
a_workingNode = NULL;
a_httpServerSocket = NULL;
//<!ATTLIST stack id CDATA #REQUIRED dictionary CDATA #REQUIRED>
const anna::xml::Attribute *id, *dictionary;
- // <!ATTLIST node originRealm CDATA #REQUIRED applicationId CDATA #REQUIRED originHost CDATA #IMPLIED cer CDATA #IMPLIED dwr CDATA #IMPLIED allowedInactivityTime CDATA #IMPLIED tcpConnectDelay CDATA #IMPLIED answersTimeout CDATA #IMPLIED ceaTimeout CDATA #IMPLIED watchdogPeriod CDATA #IMPLIED entity CDATA #IMPLIED entityServerSessions CDATA #IMPLIED diameterServer CDATA #IMPLIED diameterServerSessions CDATA #IMPLIED balance (yes | no) #IMPLIED sessionBasedModelsClientSocketSelection (SessionIdLowPart | SessionIdHighPart | SessionIdOptionalPart | RoundRobin) #IMPLIED retries CDATA #IMPLIED log CDATA #IMPLIED splitLog (yes | no) #IMPLIED detailedLog (yes | no) #IMPLIED dumpLog (yes | no) #IMPLIED burstLog (yes | no) #IMPLIED>
- const anna::xml::Attribute *originRealm, *appId, *originHost, *cer, *dwr, *allowedInactivityTime, *tcpConnectDelay,
+ // <!ATTLIST node originHost CDATA #REQUIRED applicationId CDATA #REQUIRED cer CDATA #IMPLIED dwr CDATA #IMPLIED allowedInactivityTime CDATA #IMPLIED tcpConnectDelay CDATA #IMPLIED answersTimeout CDATA #IMPLIED ceaTimeout CDATA #IMPLIED watchdogPeriod CDATA #IMPLIED entity CDATA #IMPLIED entityServerSessions CDATA #IMPLIED diameterServer CDATA #IMPLIED diameterServerSessions CDATA #IMPLIED balance (yes | no) #IMPLIED sessionBasedModelsClientSocketSelection (SessionIdLowPart | SessionIdHighPart | SessionIdOptionalPart | RoundRobin) #IMPLIED retries CDATA #IMPLIED log CDATA #IMPLIED splitLog (yes | no) #IMPLIED detailedLog (yes | no) #IMPLIED dumpLog (yes | no) #IMPLIED burstLog (yes | no) #IMPLIED>
+ const anna::xml::Attribute *originHost, *appId, *originRealm, *cer, *dwr, *allowedInactivityTime, *tcpConnectDelay,
*answersTimeout, *ceaTimeout, *watchdogPeriod, *entity, *entityServerSessions,
*diameterServer, *diameterServerSessions, *balance, *sessionBasedModelsClientSocketSelection,
*retries, *log, *splitLog, *detailedLog, *dumpLog, *burstLog;
if(nodeName == "node") {
// Input data:
- originRealm = (*it)->getAttribute("originRealm");
+ originHost = (*it)->getAttribute("originHost");
appId = (*it)->getAttribute("applicationId");
- originHost = (*it)->getAttribute("originHost", false /* no exception */);
+ originRealm = (*it)->getAttribute("originRealm", false /* no exception */);
cer = (*it)->getAttribute("cer", false /* no exception */);
dwr = (*it)->getAttribute("dwr", false /* no exception */);
allowedInactivityTime = (*it)->getAttribute("allowedInactivityTime", false /* no exception */);
burstLog = (*it)->getAttribute("burstLog", false /* no exception */); // (yes | no)
// Basic checkings:
- realm_nodes_it nodeIt = a_nodes.find(originRealm->getValue());
- if (nodeIt != a_nodes.end()) {
- std::string msg = "Already registered node name (Origin-Realm): "; msg += originRealm->getValue();
+ origin_hosts_it nodeIt = a_originHosts.find(originHost->getValue());
+ if (nodeIt != a_originHosts.end()) {
+ std::string msg = "Already registered such Origin-Host: "; msg += originHost->getValue();
throw anna::RuntimeException(msg, ANNA_FILE_LOCATION);
}
}
// Create new Node instance /////////////////////////////////////////////////////////////////
- a_workingNode = new RealmNode(originRealm->getValue(), applicationId, bpd);
+ a_workingNode = new OriginHost(originHost->getValue(), applicationId, bpd);
MyDiameterEngine *commEngine = a_workingNode->getMyDiameterEngine();
/////////////////////////////////////////////////////////////////////////////////////////////
commEngine->setWatchdogPeriod(watchdogPeriodMs);
// Realm information:
- if (originHost) commEngine->setHost(originHost->getValue());
- commEngine->setRealm(originRealm->getValue());
+ commEngine->setOriginHost(originHost->getValue());
+ if (originRealm) commEngine->setOriginRealm(originRealm->getValue());
// Diameter entity:
if(entity) {
// Logs:
if (!allLogsDisabled) {
- std::string realm = commEngine->getRealm();
- std::string s_log = realm + ".launcher.log"; if (log) s_log = log->getValue();
+ std::string host = commEngine->getOriginHost();
+ std::string s_log = host + ".launcher.log"; if (log) s_log = log->getValue();
bool b_splitLog = (splitLog ? (splitLog->getValue() == "yes") : false);
bool b_detailedLog = (detailedLog ? (detailedLog->getValue() == "yes") : false);
bool b_dumpLog = (dumpLog ? (dumpLog->getValue() == "yes") : false);
- std::string s_burstLog = realm + ".launcher.burst"; if (burstLog) s_burstLog = burstLog->getValue();
+ std::string s_burstLog = host + ".launcher.burst"; if (burstLog) s_burstLog = burstLog->getValue();
a_workingNode->setLogs(s_log, b_splitLog, b_detailedLog, b_dumpLog, s_burstLog);
}
if (eventOperation) commEngine->lazyInitialize();
// Node and Codec Engine registration ///////////////////////////////////////////////////////
- a_nodes[originRealm->getValue()] = a_workingNode;
+ a_originHosts[originHost->getValue()] = a_workingNode;
/////////////////////////////////////////////////////////////////////////////////////////////
}
}
- if (!uniqueRealm())
+ if (!uniqueOriginHost())
a_workingNode = NULL; // by default, mode auto
// Diameter comm engines which are loaded after application start (via management operation 'services') are not really started,
bool Launcher::setWorkingNode(const std::string &name) throw() {
bool result = false;
- realm_nodes_it nodeIt = a_nodes.find(name);
- if (nodeIt == a_nodes.end()) {
+ origin_hosts_it nodeIt = a_originHosts.find(name);
+ if (nodeIt == a_originHosts.end()) {
LOGWARNING(
std::string msg = "Unknown node with name '"; msg += name; msg += "'. Ignoring ...";
anna::Logger::warning(msg, ANNA_FILE_LOCATION);
);
}
else {
- a_workingNode = const_cast<RealmNode*>(nodeIt->second);
+ a_workingNode = const_cast<OriginHost*>(nodeIt->second);
result = true;
}
return result;
}
-RealmNode *Launcher::getRealmNode(const std::string &realmName) const throw(anna::RuntimeException) {
- realm_nodes_it it = a_nodes.find(realmName);
- if (it != a_nodes.end()) return it->second;
- throw anna::RuntimeException(anna::functions::asString("There is no realm node registered as '%s' (set Origin-Realm avp correctly or force a specific realm with 'node' operation)", realmName.c_str()), ANNA_FILE_LOCATION);
+OriginHost *Launcher::getOriginHost(const std::string &oh) const throw(anna::RuntimeException) {
+ origin_hosts_it it = a_originHosts.find(oh);
+ if (it != a_originHosts.end()) return it->second;
+ throw anna::RuntimeException(anna::functions::asString("There is no origin host registered as '%s' (set Origin-Host avp correctly or force a specific host with 'node' operation)", oh.c_str()), ANNA_FILE_LOCATION);
}
-RealmNode *Launcher::getRealmNode(const anna::diameter::codec::Message &message) const throw(anna::RuntimeException) {
- std::string originRealm = message.getAvp(anna::diameter::helpers::base::AVPID__Origin_Realm)->getDiameterIdentity()->getValue();
- return (getRealmNode(originRealm));
+OriginHost *Launcher::getOriginHost(const anna::diameter::codec::Message &message) const throw(anna::RuntimeException) {
+ std::string originHost = message.getAvp(anna::diameter::helpers::base::AVPID__Origin_Host)->getDiameterIdentity()->getValue();
+ return (getOriginHost(originHost));
}
-void Launcher::updateOperatedRealmNodeWithMessage(const anna::diameter::codec::Message &message) throw(anna::RuntimeException) {
- if (!a_operatedRealm) // priority for working node by mean 'node' operation
- a_operatedRealm = getRealmNode(message);
+void Launcher::updateOperatedOriginHostWithMessage(const anna::diameter::codec::Message &message) throw(anna::RuntimeException) {
+ if (!a_operatedHost) // priority for working node by mean 'node' operation
+ a_operatedHost = getOriginHost(message);
}
-RealmNode *Launcher::getOperatedRealm() const throw(anna::RuntimeException) {
- if(!a_operatedRealm)
- throw anna::RuntimeException("Realm Node not identified (try to force a specific realm with 'node' operation)", ANNA_FILE_LOCATION);
+OriginHost *Launcher::getOperatedHost() const throw(anna::RuntimeException) {
+ if(!a_operatedHost)
+ throw anna::RuntimeException("Node not identified (try to force a specific Origin-Host with 'node' operation)", ANNA_FILE_LOCATION);
- return a_operatedRealm;
+ return a_operatedHost;
}
MyDiameterEntity *Launcher::getOperatedEntity() const throw(anna::RuntimeException) {
- MyDiameterEntity *result = getOperatedRealm()->getEntity();
+ MyDiameterEntity *result = getOperatedHost()->getEntity();
if (!result)
- throw anna::RuntimeException("No entity configured for the operated Realm Node", ANNA_FILE_LOCATION);
+ throw anna::RuntimeException("No entity configured for the operated node", ANNA_FILE_LOCATION);
return result;
}
MyLocalServer *Launcher::getOperatedServer() const throw(anna::RuntimeException) {
- MyLocalServer *result = getOperatedRealm()->getDiameterServer();
+ MyLocalServer *result = getOperatedHost()->getDiameterServer();
if (!result)
- throw anna::RuntimeException("No local server configured for the operated Realm Node", ANNA_FILE_LOCATION);
+ throw anna::RuntimeException("No local server configured for the operated node", ANNA_FILE_LOCATION);
return result;
}
MyDiameterEngine *Launcher::getOperatedEngine() const throw(anna::RuntimeException) {
- return getOperatedRealm()->getMyDiameterEngine(); // never will be NULL
+ return getOperatedHost()->getMyDiameterEngine(); // never will be NULL
}
void Launcher::initialize()
// Start client connections //////////////////////////////////////////////////////////////////////////////////
MyDiameterEntity *entity;
- for (realm_nodes_it it = a_nodes.begin(); it != a_nodes.end(); it++) {
+ for (origin_hosts_it it = a_originHosts.begin(); it != a_originHosts.end(); it++) {
entity = it->second->getEntity();
if (entity) entity->bind();
}
a_workingNode->getMyDiameterEngine()->resetStatistics();
}
else {
- for (realm_nodes_it it = a_nodes.begin(); it != a_nodes.end(); it++) {
+ for (origin_hosts_it it = a_originHosts.begin(); it != a_originHosts.end(); it++) {
it->second->getMyDiameterEngine()->resetStatistics();
}
}
result += "\nOVERVIEW";
result += "\n--------";
result += "\n";
- result += "\nThe ADML (ANNA Diameter Multirealm Launcher) process is a multi-realm node with client and server";
+ result += "\nThe ADML (ANNA Diameter MultiHost Launcher) process is a multi-host node with client and server";
result += "\n capabilities as well as balancer (proxy) features. It could be used as diameter server (i.e. to";
result += "\n simulate PCRF nodes, OCS systems, etc.), as diameter client (GGSNs, DPIs, etc.), and balancer";
result += "\n systems to provide failover to external round-robin launchers. Also, auxiliary encoder/decoder/loader";
result += "\n establish as minimum), separate statistics analyzer per each resource, automatic CER/CEA and DWR/DWA";
result += "\n generation, expiration control and many more features.";
result += "\n";
- result += "\nThe ADML process can easily configure a many realm nodes as needed, which will have own endpoints.";
+ result += "\nThe ADML process can easily configure a many origin-host nodes as needed, which will have own endpoints.";
result += "\nYou should avoid loop configurations (client and server for that client) because automatic forwarding,";
result += "\n is implemented and this would get in a never ending cycle when a request is sent.";
result += "\n";
result += "\n <stack id=\"0\" dictionary=\"dictionary.xml\"/>";
result += "\n";
result += "\n <!-- Nodes -->";
- result += "\n <node originRealm=\"ADML-client\" applicationId=\"0\" entity=\"localhost:3868\"/>";
+ result += "\n <node originHost=\"ADML-client\" applicationId=\"0\" entity=\"localhost:3868\"/>";
result += "\n</services>";
result += "\n";
result += "\nServer configuration:";
result += "\n <stack id=\"0\" dictionary=\"dictionary.xml\"/>";
result += "\n";
result += "\n <!-- Nodes -->";
- result += "\n <node originRealm=\"ADML-server\" applicationId=\"0\" diameterServer=\"localhost:3868\"/>";
+ result += "\n <node originHost=\"ADML-server\" applicationId=\"0\" diameterServer=\"localhost:3868\"/>";
result += "\n</services>";
result += "\n";
result += "\nIf you act as a proxy or a translation agent, you need to combine both former setups, and probably";
result += "\n will need to program the answers to be replied through the operations interface. To balance the";
result += "\n traffic at your client side you shall use '--balance' and '--sessionBasedModelsClientSocketSelection'";
- result += "\n arguments in order to define the balancing behaviour. To make hybrid setups you only must mix the realms:";
+ result += "\n arguments in order to define the balancing behaviour. To make hybrid setups you only must mix the nodes:";
result += "\n";
result += "\nClient and server configuration:";
result += "\n";
result += "\n <stack id=\"0\" dictionary=\"dictionary_base.xml\"/>";
result += "\n";
result += "\n <!-- Nodes -->";
- result += "\n <node originRealm=\"ADML-Rx-client\" applicationId=\"16777236\" entity=\"localhost:3868\" cer=\"cer_Rx.xml\"/>";
- result += "\n <node originRealm=\"ADML-Gx-client\" applicationId=\"16777238\" entity=\"localhost:3868\" cer=\"cer_Gx.xml\"/>";
+ result += "\n <node originHost=\"ADML-Rx-client\" applicationId=\"16777236\" entity=\"localhost:3868\" cer=\"cer_Rx.xml\"/>";
+ result += "\n <node originHost=\"ADML-Gx-client\" applicationId=\"16777238\" entity=\"localhost:3868\" cer=\"cer_Gx.xml\"/>";
result += "\n</services>";
result += "\n";
result += "\n";
result += "\n";
result += "\n--------------------------------------------------------------------------------------- Node management";
result += "\n";
- result += "\nnode[|<name>] Selects a context working node by mean a registered name.";
+ result += "\nnode[|<name>] Selects a context working node by mean a registered name (origin-host).";
result += "\n All the subsequent operations will be forced to work with";
result += "\n this node, which makes possible some rare scenarios like";
result += "\n sending unexpected messages on remote peers. This is also";
result += "\n";
result += "\nnode_auto Returns to the default behaviour (smart node selection).";
result += "\n Depending on the operation, this could imply a global";
- result += "\n action scope, affecting to all the registered realms.";
+ result += "\n action scope, affecting to all the registered hosts.";
result += "\n This should be the normal configuration. Take into";
result += "\n account that if you fix the working node, this could";
result += "\n affect to things like test programming: communication";
result += "\n resources will override those which would be inferred";
- result += "\n from programmed messages Origin-Realm avps.";
+ result += "\n from programmed messages Origin-Host avps.";
result += "\n";
result += "\n------------------------------------------------------------------------------------ Parsing operations";
result += "\n";
result += "\n line '--services' parameter was used or not. Those services which";
result += "\n are not correctly loaded will be ignored to keep the process alive.";
result += "\n If you need to load services as deltas, you must firstly load the";
- result += "\n diameter base dictionary with stack id 0, because all the realms";
+ result += "\n diameter base dictionary with stack id 0, because all the nodes";
result += "\n will use this dictionary to encode/decode base protocol messages";
result += "\n managed by the communication engine.";
result += "\n";
result += "\n performance measurement. Context data can be written at";
result += "\n '/var/tmp/anna.context.<pid>' by mean 'kill -10 <pid>'.";
result += "\n or sending operation 'context|[target file]'.";
- result += "\n This operation applies over all the registered realm nodes";
+ result += "\n This operation applies over all the registered host nodes";
result += "\n except if one specific working node has been set.";
result += "\nforceCountersRecord Forces dump to file the current counters of the process.";
result += "\nshow-oam Dumps current counters of the process. This is also done at";
result += "\n";
result += "\n------------------------------------------------------------------------------------------- Burst tests";
result += "\n";
- result += "\nIn order to simplify user experience, burst category operations are only allowed in single realm node";
- result += "\n configuration. Indeed, you could send messages with incorrect Origin-Realm, and no warning is shown.";
- result += "\nAll the operations are performed through the unique realm: if you need to use more interfaces, you may";
- result += "\n launch different ADML instances. Is nonsense to allow burst in a multi-realm configured ADML, because";
+ result += "\nIn order to simplify user experience, burst category operations are only allowed in single host node";
+ result += "\n configuration. Indeed, you could send messages with unmatched Origin-Host, and no warning is shown.";
+ result += "\nAll the operations are performed through the unique host: if you need to use more interfaces, you may";
+ result += "\n launch different ADML instances. Is nonsense to allow burst in a multi-host configured ADML, because";
result += "\n this feature is not able to coordinate the messages.";
result += "\n";
result += "\nburst|<action>[|parameter] Used for performance testing, we first program diameter requests";
result += "\n-------------------------------------------------------------------------------------- Advanced testing";
result += "\n";
result += "\n Burst mode only allows single interface interaction. For multiple interface";
- result += "\n (realm) coordination, you could use the advanced test cases programming:";
+ result += "\n (origin-host) coordination, you could use the advanced test cases programming:";
result += "\n";
result += "\n";
result += "\n test|<id>|<command>[|parameters]";
result += "\n which fulfills that condition. This message is useful together with the peer";
result += "\n connection source in a further send step configured with the corresponding";
result += "\n response. You could also insert a delay between wait and send steps to be";
- result += "\n more realistic (processing time simulation in a specific ADML realm node).";
+ result += "\n more realistic (processing time simulation in a specific ADML host node).";
result += "\n Always, a response send step will get the needed information from the most";
result += "\n recent wait step finding in reverse order (note that some race conditions";
result += "\n could happen if your condition is not specific enough).";
result += "\n RFC says that a hop by hop must be unique for a specific connection, something that";
result += "\n could be difficult to manage if we have multiple available connections from client";
result += "\n side endpoint (entity or local server), even if we would have only one connection but";
- result += "\n several realm interfaces. It is enough to configure different hop-by-hop values within";
+ result += "\n several host interfaces. It is enough to configure different hop-by-hop values within";
result += "\n each test case, because on reception, the Session-Id is used to identify that test case.";
result += "\n";
result += "\n";
return;
}
- // Realm switch:
+ // Host switch:
if(opType == "node") {
if (param1 != "") {
if (setWorkingNode(param1)) response_content = anna::functions::asString("Forced node is now '%s'", param1.c_str());
return;
}
- // Operated realm from possible forced-working node:
- a_operatedRealm = a_workingNode ? a_workingNode /* priority */: NULL /* auto */;
+ // Operated host from possible forced-working node:
+ a_operatedHost = a_workingNode ? a_workingNode /* priority */: NULL /* auto */;
// Use later:
- // If any message is managed: updateOperatedRealmNodeWithMessage(codecMessage)
+ // If any message is managed: updateOperatedOriginHostWithMessage(codecMessage)
// To operate, use the exception-protected methods which never will return NULL:
- // getOperatedRealm(), getOperatedEntity(), getOperatedServer(), getOperatedEngine()
+ // getOperatedHost(), getOperatedEntity(), getOperatedServer(), getOperatedEngine()
if(opType == "code") {
if(opType == "sendxml2e") {
codecMsg.loadXML(param1);
- updateOperatedRealmNodeWithMessage(codecMsg);
- msg = getOperatedRealm()->createCommMessage();
+ 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());
// Get DataBlock from file with hex content:
if(!getDataBlockFromHexFile(param1, db_aux))
throw anna::RuntimeException("Error reading hex file provided", ANNA_FILE_LOCATION);
- msg = getOperatedRealm()->createCommMessage();
+ msg = getOperatedHost()->createCommMessage();
msg->setBody(db_aux);
- try { if(getOperatedRealm()->logEnabled()) codecMsg.decode(db_aux); } catch(anna::RuntimeException &ex) { ex.trace(); }
+ try { if(getOperatedHost()->logEnabled()) codecMsg.decode(db_aux); } catch(anna::RuntimeException &ex) { ex.trace(); }
}
bool success = getOperatedEntity()->send(msg, cl.exists("balance"));
- getOperatedRealm()->releaseCommMessage(msg);
+ getOperatedHost()->releaseCommMessage(msg);
// Detailed log:
- if(getOperatedRealm()->logEnabled()) {
+ 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
- getOperatedRealm()->writeLogFile(codecMsg, (success ? "sent2e" : "send2eError"), detail);
+ getOperatedHost()->writeLogFile(codecMsg, (success ? "sent2e" : "send2eError"), detail);
}
} else if((opType == "burst")) {
- if (!uniqueRealm())
- throw anna::RuntimeException("Burst category operations are only allowed in single realm node configuration. This is only to simplify user experience.", ANNA_FILE_LOCATION);
+ if (!uniqueOriginHost())
+ throw anna::RuntimeException("Burst category operations are only allowed in single host node configuration. This is only to simplify user experience.", ANNA_FILE_LOCATION);
// burst|clear clears all loaded burst messages.
// burst|load|<source_file> loads the next diameter message into launcher burst.
if(param1 == "clear") {
opt_response_content = "removed ";
- opt_response_content += anna::functions::asString(getOperatedRealm()->clearBurst());
+ opt_response_content += anna::functions::asString(getOperatedHost()->clearBurst());
opt_response_content += " elements";
} else if(param1 == "load") {
if(param2 == "") throw anna::RuntimeException("Missing xml path file for burst load operation", ANNA_FILE_LOCATION);
if(codecMsg.isAnswer()) throw anna::RuntimeException("Cannot load diameter answers for burst feature", ANNA_FILE_LOCATION);
try { codecMsg.valid(); } catch(anna::RuntimeException &ex) { ex.trace(); } // at least we need to see validation errors although it will continue loading (see validation mode configured in launcher)
- int position = getOperatedRealm()->loadBurstMessage(codecMsg.code());
+ int position = getOperatedHost()->loadBurstMessage(codecMsg.code());
opt_response_content = "loaded '";
opt_response_content += param2;
opt_response_content += "' file into burst list position ";
if(param2 == "") throw anna::RuntimeException("Missing initial load for burst start operation", ANNA_FILE_LOCATION);
int initialLoad = atoi(param2.c_str());
- int processed = getOperatedRealm()->startBurst(initialLoad);
+ int processed = getOperatedHost()->startBurst(initialLoad);
if(processed > 0) {
opt_response_content = "initial load completed for ";
} else if(param1 == "push") {
if(param2 == "") throw anna::RuntimeException("Missing load amount for burst push operation", ANNA_FILE_LOCATION);
- int pushed = getOperatedRealm()->pushBurst(atoi(param2.c_str()));
+ int pushed = getOperatedHost()->pushBurst(atoi(param2.c_str()));
if(pushed > 0) {
opt_response_content = "pushed ";
if(param2 == "") throw anna::RuntimeException("Missing amount for burst pop operation", ANNA_FILE_LOCATION);
int releaseLoad = atoi(param2.c_str());
- int popped = getOperatedRealm()->popBurst(releaseLoad);
+ int popped = getOperatedHost()->popBurst(releaseLoad);
if(popped > 0) {
opt_response_content = "burst popped for ";
opt_response_content += anna::functions::entriesAsString(popped, "message");
}
} else if(param1 == "stop") {
- int left = getOperatedRealm()->stopBurst();
+ int left = getOperatedHost()->stopBurst();
if(left != -1) {
opt_response_content += anna::functions::entriesAsString(left, "message");
if(param2 == "") param2 = "yes";
bool repeat = (param2 == "yes");
- getOperatedRealm()->repeatBurst(repeat);
+ getOperatedHost()->repeatBurst(repeat);
opt_response_content += (repeat ? "repeat enabled" : "repeat disabled");
} else if(param1 == "send") {
if(param2 == "") throw anna::RuntimeException("Missing amount for burst send operation", ANNA_FILE_LOCATION);
- int sent = getOperatedRealm()->sendBurst(atoi(param2.c_str()));
+ int sent = getOperatedHost()->sendBurst(atoi(param2.c_str()));
if(sent > 0) {
opt_response_content = "sent ";
} else if(param1 == "goto") {
if(param2 == "") throw anna::RuntimeException("Missing order position for burst goto operation", ANNA_FILE_LOCATION);
- opt_response_content = getOperatedRealm()->gotoBurst(atoi(param2.c_str()));
+ opt_response_content = getOperatedHost()->gotoBurst(atoi(param2.c_str()));
} else if(param1 == "look") {
int order = ((param2 != "") ? atoi(param2.c_str()) : -1);
opt_response_content = "\n\n";
- opt_response_content += getOperatedRealm()->lookBurst(order);
+ opt_response_content += getOperatedHost()->lookBurst(order);
} else {
throw anna::RuntimeException("Wrong body content format on HTTP Request for 'burst' operation (unexpected action parameter). See help", ANNA_FILE_LOCATION);
}
else {
if (param4 == "") LOGWARNING(anna::Logger::warning("Step number has not been provided. Take into account that this answer message will be sent 'as is' and sequence information could be wrong at the remote peer", ANNA_FILE_LOCATION));
}
- updateOperatedRealmNodeWithMessage(codecMsg);
+ updateOperatedOriginHostWithMessage(codecMsg);
int stepNumber = ((param4 != "") ? atoi(param4.c_str()):-1);
if (param2 == "sendxml2e")
- testManager.getTestCase(id)->addSendxml2e(codecMsg.code(), getOperatedRealm(), stepNumber); // creates / reuses
+ testManager.getTestCase(id)->addSendxml2e(codecMsg.code(), getOperatedHost(), stepNumber); // creates / reuses
else
- testManager.getTestCase(id)->addSendxml2c(codecMsg.code(), getOperatedRealm(), stepNumber); // creates / reuses
+ testManager.getTestCase(id)->addSendxml2c(codecMsg.code(), getOperatedHost(), stepNumber); // creates / reuses
}
else if (param2 == "delay") {
if (numParams > 3)
if(opType == "sendxml2c") {
codecMsg.loadXML(param1);
- updateOperatedRealmNodeWithMessage(codecMsg);
- msg = getOperatedRealm()->createCommMessage();
+ 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)
// Get DataBlock from file with hex content:
if(!getDataBlockFromHexFile(param1, db_aux))
throw anna::RuntimeException("Error reading hex file provided", ANNA_FILE_LOCATION);
- msg = getOperatedRealm()->createCommMessage();
+ msg = getOperatedHost()->createCommMessage();
msg->setBody(db_aux);
}
bool success = getOperatedServer()->send(msg);
- getOperatedRealm()->releaseCommMessage(msg);
+ getOperatedHost()->releaseCommMessage(msg);
// Detailed log:
- if(getOperatedRealm()->logEnabled()) {
+ if(getOperatedHost()->logEnabled()) {
anna::diameter::comm::ServerSession *usedServerSession = getOperatedServer()->getLastUsedResource();
std::string detail = usedServerSession ? usedServerSession->asString() : "<null server session>"; // shouldn't happen
- getOperatedRealm()->writeLogFile(codecMsg, (success ? "sent2c" : "send2cError"), detail);
+ getOperatedHost()->writeLogFile(codecMsg, (success ? "sent2c" : "send2cError"), detail);
}
} else if(opType == "loadxml") {
codecMsg.loadXML(param1);
getOperatedServer()->getReactingAnswers()->dump();
} else {
codecMsg.loadXML(param1);
- updateOperatedRealmNodeWithMessage(codecMsg);
- anna::diameter::codec::Message *message = getOperatedRealm()->getCodecEngine()->createMessage(param1); // loads xml again, lesser of two evils
+ 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())
getOperatedEntity()->getReactingAnswers()->dump();
} else {
codecMsg.loadXML(param1);
- updateOperatedRealmNodeWithMessage(codecMsg);
- anna::diameter::codec::Message *message = getOperatedRealm()->getCodecEngine()->createMessage(param1); // loads xml again, lesser of two evils
+ 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())
result->createAttribute("StartTime", a_start_time.asString());
result->createAttribute("SecondsLifeTime", anna::time::functions::lapsedMilliseconds() / 1000);
// Diameter:
- for (realm_nodes_it it = a_nodes.begin(); it != a_nodes.end(); it++) {
+ for (origin_hosts_it it = a_originHosts.begin(); it != a_originHosts.end(); it++) {
it->second->asXML(result);
}