X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;f=example%2Fdiameter%2Flauncher%2FLauncher.hpp;h=dcc684d5e451169371e7e89bde77ad7eb4537773;hb=61f1340da3cae5159d2e3bc14fc47c6d4bf9453e;hp=c8417fb900456cc8f9c609a59a20f2f1a9db8f84;hpb=ea14381cada0d7173fd19eaaf781f82eb714325e;p=anna.git diff --git a/example/diameter/launcher/Launcher.hpp b/example/diameter/launcher/Launcher.hpp index c8417fb..dcc684d 100644 --- a/example/diameter/launcher/Launcher.hpp +++ b/example/diameter/launcher/Launcher.hpp @@ -18,10 +18,17 @@ #include #include #include +#include // Process -#include "MyCommunicator.hpp" -#include "MyCounterRecorder.hpp" +#include +#include +#include + + +#define SH_COMMAND_TAG_FOR_REPLACE__CYCLE_ID "##cycleid##" +#define SH_COMMAND_TAG_FOR_REPLACE__TESTCASE_ID "##testcaseid##" +#define SH_COMMAND_TAG_FOR_REPLACE__TESTSTEP_ID "##teststepid##" namespace anna { @@ -35,32 +42,44 @@ namespace anna { } } -// RealmNode resources -class RealmNode; -typedef std::map realm_nodes_t; -typedef std::map::const_iterator realm_nodes_it; -typedef std::map::iterator realm_nodes_nc_it; +class TestManager; +class OriginHost; +class MyDiameterEntity; +class MyLocalServer; +class MyDiameterEngine; + +// OriginHost resources +class OriginHost; +typedef std::map origin_hosts_t; +typedef std::map::const_iterator origin_hosts_it; +typedef std::map::iterator origin_hosts_nc_it; class Launcher : public anna::comm::Application { // Start time: anna::time::Date a_start_time; + std::string a_initialWorkingDirectory; // Core engines: MyCommunicator *a_communicator; - anna::diameter::codec::Engine *a_codecEngine; anna::timex::Engine* a_timeEngine; MyCounterRecorder *a_counterRecorder; + anna::Millisecond a_admlMinResolution; MyCounterRecorderClock *a_counterRecorderClock; // Nodes deployment: - realm_nodes_t a_nodes; - RealmNode *a_workingNode; + origin_hosts_t a_originHosts; + OriginHost *a_workingNode; + OriginHost *a_operatedHost; // auxiliary for eventOperation // comm resources: anna::comm::ServerSocket* a_httpServerSocket; // HTTP + const anna::Millisecond &getADMLMinResolution() const throw() { return a_admlMinResolution; } + + std::string getSignalUSR2InputFile() const throw(); + std::string getSignalUSR2OutputFile() const throw(); void servicesFromXML(const anna::xml::Node* servicesNode, bool eventOperation) throw(anna::RuntimeException); anna::Millisecond checkTimeMeasure(const std::string ¶meter, const std::string &value) throw(anna::RuntimeException); @@ -68,32 +87,46 @@ class Launcher : public anna::comm::Application { void run() throw(anna::RuntimeException); + public: Launcher(); + //~Launcher(); TODO void loadServices(const std::string & xmlPathFile, bool eventOperation = false) throw(anna::RuntimeException); void startServices() throw(anna::RuntimeException); - anna::diameter::codec::Engine *getCodecEngine() const throw() { return a_codecEngine; } - RealmNode *getWorkingNode() const throw(anna::RuntimeException); // management operations working node - bool setWorkingNode(const std::string &name) throw(); // we could update ignoreFlagsOnValidation/integrationAndDebugging over the global codec engine - // but finally, that configuration issues will be global to the process. + bool setWorkingNode(const std::string &name) throw(); + OriginHost *getOriginHost(const std::string &oh) const throw(anna::RuntimeException); + OriginHost *getOriginHost(const anna::diameter::codec::Message &message) const throw(anna::RuntimeException); + bool uniqueOriginHost() const throw() { return (a_originHosts.size() == 1); } - RealmNode *getRealmNode(const std::string &realmName) const throw(); + // Operated host for communication resources smart assignment //////////////////////////////////////////////////////////// + void updateOperatedOriginHostWithMessage(const anna::diameter::codec::Message &message) throw(anna::RuntimeException); + OriginHost *getOperatedHost() const throw(anna::RuntimeException); + MyDiameterEntity *getOperatedEntity() const throw(anna::RuntimeException); + MyLocalServer *getOperatedServer() const throw(anna::RuntimeException); + MyDiameterEngine *getOperatedEngine() const throw(anna::RuntimeException); + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// MyCommunicator *getCommunicator() throw() { return a_communicator; } void eventOperation(const std::string &, std::string &) throw(anna::RuntimeException); void forceCountersRecord() throw(anna::RuntimeException) { if (a_counterRecorderClock) a_counterRecorderClock->tick(); } + void logStatisticsSamples(const std::string &conceptsList) throw(); + anna::xml::Node* asXML(anna::xml::Node* parent) const throw(); void resetStatistics() throw(); void resetCounters() throw(); void signalUSR2() throw(anna::RuntimeException); std::string help() const throw(); + anna::xml::Node* oamAsXML(anna::xml::Node* parent) const throw(); + anna::xml::Node* statsAsXML(anna::xml::Node* parent) const throw(); // helpers bool getDataBlockFromHexFile(const std::string &pathfile, anna::DataBlock &db) const throw(); + + friend class TestManager; }; #endif