X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;f=example%2Fdiameter%2Flauncher%2FLauncher.hpp;h=21c3d25c41b3298ada7eb2663ded7d4162177b0a;hb=4c3f0a4d7e4db76996404d80c6f939548fca656f;hp=e69de29bb2d1d6434b8b29ae775ad8c2e48c5391;hpb=68a8fe342d8337ec1a86b57920bc7dcf7faf2413;p=anna.git diff --git a/example/diameter/launcher/Launcher.hpp b/example/diameter/launcher/Launcher.hpp index e69de29..21c3d25 100644 --- a/example/diameter/launcher/Launcher.hpp +++ b/example/diameter/launcher/Launcher.hpp @@ -0,0 +1,105 @@ +// ANNA - Anna is Not Nothingness Anymore // +// // +// (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo // +// // +// See project site at http://redmine.teslayout.com/projects/anna-suite // +// See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE // + + +#ifndef example_diameter_launcher_Launcher_hpp +#define example_diameter_launcher_Launcher_hpp + +// Standard +#include +#include +#include + +// Project +#include +#include +#include + +// Process +#include +#include +#include + + +namespace anna { + namespace timex { + class Engine; + } + namespace diameter { + namespace codec { + class Engine; + } + } +} + +class TestManager; + +// 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 Launcher : public anna::comm::Application { + + // Start time: + anna::time::Date a_start_time; + + // 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; + + // comm resources: + anna::comm::ServerSocket* a_httpServerSocket; // HTTP + + const anna::Millisecond &getADMLMinResolution() const throw() { return a_admlMinResolution; } + + 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); + void initialize() throw(anna::RuntimeException); // HTTP + void run() throw(anna::RuntimeException); + +public: + Launcher(); + + 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. + + RealmNode *getRealmNode(const std::string &realmName) const throw(); + + + 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(); } + + 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(); + + // helpers + bool getDataBlockFromHexFile(const std::string &pathfile, anna::DataBlock &db) const throw(); + + friend class TestManager; +}; + +#endif