X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;f=example%2Fdiameter%2Flauncher%2FLauncher.hpp;h=af8a07a75417826526f399d6e09754aa2540792d;hb=75e01e90ae4e1f29813eabe40c3e6b5eea8457bf;hp=9ac09af9e4b98b20bac6db21c75bf328cf98cc37;hpb=f9534159f3b43cbf74eccf88723ee740c69eb204;p=anna.git diff --git a/example/diameter/launcher/Launcher.hpp b/example/diameter/launcher/Launcher.hpp index 9ac09af..af8a07a 100644 --- a/example/diameter/launcher/Launcher.hpp +++ b/example/diameter/launcher/Launcher.hpp @@ -18,6 +18,7 @@ #include #include #include +#include // Process #include @@ -42,12 +43,16 @@ namespace anna { } class TestManager; +class OriginHost; +class MyDiameterEntity; +class MyLocalServer; +class MyDiameterEngine; -// 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; +// 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 { @@ -57,16 +62,15 @@ class Launcher : public anna::comm::Application { // Core engines: MyCommunicator *a_communicator; - anna::diameter::codec::Engine *a_codecEngine; - anna::diameter::stack::Dictionary *a_baseProtocolDictionary; 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 @@ -80,17 +84,23 @@ class Launcher : public anna::comm::Application { 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; } - //anna::diameter::stack::Dictionary *getBaseProtocolDictionary() const throw() { return a_baseProtocolDictionary; } - 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; } @@ -102,6 +112,8 @@ public: 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();