X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;f=example%2Fdiameter%2Flauncher%2FMyDiameterEntity.hpp;h=73494b5c133099bc9b6962b0a60f60aac7e1a087;hb=97a93101fb874a3237083d72c6d6f8c8df8dcfba;hp=9453d647df25067cc06eb2cf89dbe7fb2710f92f;hpb=84c30c372cf2926a138a6d51a52d56f3b2a63804;p=anna.git diff --git a/example/diameter/launcher/MyDiameterEntity.hpp b/example/diameter/launcher/MyDiameterEntity.hpp index 9453d64..73494b5 100644 --- a/example/diameter/launcher/MyDiameterEntity.hpp +++ b/example/diameter/launcher/MyDiameterEntity.hpp @@ -13,7 +13,7 @@ #include // Process -#include "ProgrammedAnswers.hpp" +#include namespace anna { namespace diameter { @@ -25,7 +25,8 @@ namespace anna { class MyDiameterEntity : public anna::diameter::comm::Entity { - anna::diameter::codec::Engine * a_codecEngine; // for automatic answers (failed-avp), write logs, etc. + bool a_balance; // Balance over entity servers instead of doing standard behaviour (first primary, secondary if fails, etc.). Default: false. + std::string a_sessionBasedModelsType; void eventRequestRetransmission(const anna::diameter::comm::ClientSession *, anna::diameter::comm::Message*) throw(); void eventResponse(const anna::diameter::comm::Response&) throw(anna::RuntimeException); @@ -38,9 +39,19 @@ class MyDiameterEntity : public anna::diameter::comm::Entity { public: + MyDiameterEntity() { + a_balance = false; + a_sessionBasedModelsType = "SessionIdLowPart"; + } + ProgrammedAnswers a_reactingAnswers; - void setCodecEngine(anna::diameter::codec::Engine *codecEngine) throw() { a_codecEngine = codecEngine; a_reactingAnswers.setCodecEngine(codecEngine); } ProgrammedAnswers *getReactingAnswers() throw() { return (ProgrammedAnswers *)&a_reactingAnswers; } + + // Additional configuration parameters: + void setSessionBasedModelsType(const std::string &type) throw() { a_sessionBasedModelsType = type; } + void setBalance(bool balance) throw() { a_balance = balance; } + const std::string & getSessionBasedModelsType() const throw() { return a_sessionBasedModelsType; } + bool getBalance() const throw() { return a_balance; } }; #endif