X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;f=example%2Fdiameter%2Flauncher%2FLauncher.hpp;h=c7181ee2eccd37bd005d85f235bb9c022d2df805;hb=5a6cba5fde2b2f538a7515f8293cc0a8d9589dfa;hp=e420a1b6eaa3af7b1fd16335e85b99a1d2fcdba4;hpb=74730c7d0e4f713c932d6b06a07644d1c3c6c6c1;p=anna.git diff --git a/example/diameter/launcher/Launcher.hpp b/example/diameter/launcher/Launcher.hpp index e420a1b..c7181ee 100644 --- a/example/diameter/launcher/Launcher.hpp +++ b/example/diameter/launcher/Launcher.hpp @@ -18,10 +18,12 @@ #include #include #include +#include // Process -#include "MyCommunicator.hpp" -#include "MyCounterRecorder.hpp" +#include +#include +#include namespace anna { @@ -32,68 +34,101 @@ namespace anna { namespace codec { class Engine; } + namespace comm { + class OriginHost; + } } } -// 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 MyDiameterEntity; +class MyLocalServer; +class MyDiameterEngine; + +// OriginHost resources +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; + anna::diameter::comm::OriginHost *a_workingNode; + anna::diameter::comm::OriginHost *a_operatedHost; // auxiliary for eventOperation // comm resources: anna::comm::ServerSocket* a_httpServerSocket; // HTTP + std::string getSignalUSR2InputFile() const ; + std::string getSignalUSR2OutputFile() const ; + + void servicesFromXML(const anna::xml::Node* servicesNode, bool bindResources) noexcept(false); + void initialize() noexcept(false); // HTTP + void run() noexcept(false); - void servicesFromXML(const anna::xml::Node* servicesNode) throw(anna::RuntimeException); - anna::Millisecond checkTimeMeasure(const std::string ¶meter, const std::string &value) throw(anna::RuntimeException); - void initialize() throw(anna::RuntimeException); // HTTP - void run() throw(anna::RuntimeException); public: Launcher(); + //~Launcher(); TODO + + anna::Millisecond checkTimeMeasure(const std::string ¶meter, const std::string &value) noexcept(false); - void loadServices(const std::string & xmlPathFile) throw(anna::RuntimeException); - void startServices() throw(anna::RuntimeException); + void loadServicesFromFile(const std::string & xmlPathFile, bool bindResources) noexcept(false); + void loadServicesFromXMLString(const std::string & xmlString, bool bindResources) noexcept(false); + void startServices() noexcept(false); - anna::diameter::codec::Engine *getCodecEngine() const throw() { return a_codecEngine; } - RealmNode *getWorkingNode() const throw() { return a_workingNode; } // 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) ; + void setNodeAuto() { a_workingNode = NULL; a_operatedHost = NULL; } + anna::diameter::comm::OriginHost *getOriginHost(const std::string &name) const noexcept(false); + anna::diameter::comm::OriginHost *getOriginHost(const anna::diameter::codec::Message &message) const noexcept(false); + anna::diameter::comm::OriginHost *getOriginHost(const anna::DataBlock &messageDataBlock) const noexcept(false); - RealmNode *getRealmNode(const std::string &realmName) const throw(); + bool uniqueOriginHost() const ; + // Operated host for communication resources smart assignment //////////////////////////////////////////////////////////// + void updateOperatedOriginHostWithMessage(const anna::diameter::codec::Message &message) noexcept(false); + void updateOperatedOriginHostWithMessage(const anna::DataBlock &messageDataBlock) noexcept(false); + anna::diameter::comm::OriginHost *getWorkingNode() const noexcept(false); + anna::diameter::comm::OriginHost *getOperatedHost() const noexcept(false); + void setOperatedHost(anna::diameter::comm::OriginHost *); + MyDiameterEntity *getOperatedEntity() const noexcept(false); + MyLocalServer *getOperatedServer() const noexcept(false); + MyDiameterEngine *getOperatedEngine() const noexcept(false); + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - 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(); } + const std::string & getInitialWorkingDirectory() const { return a_initialWorkingDirectory; } - 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(); + MyCommunicator *getCommunicator() { return a_communicator; } + bool eventOperation(const std::string &, std::string &) noexcept(false); // returns success/failed + void forceCountersRecord() noexcept(false) { if (a_counterRecorderClock) a_counterRecorderClock->tick(); } + void logStatisticsSamples(const std::string &conceptsList) ; + + + anna::xml::Node* asXML(anna::xml::Node* parent) const ; + void resetStatistics() ; + void resetCounters() ; + void signalUSR2() noexcept(false); + void signalTerminate() noexcept(false); + anna::xml::Node* oamAsXML(anna::xml::Node* parent) const ; + anna::xml::Node* statsAsXML(anna::xml::Node* parent) const ; // helpers - bool getDataBlockFromHexFile(const std::string &pathfile, anna::DataBlock &db) const throw(); + bool getDataBlockFromHexFile(const std::string &pathfile, anna::DataBlock &db) const noexcept(false); + + friend class TestManager; }; #endif