X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;f=example%2Fdiameter%2Flauncher%2FMyDiameterEntity.hpp;h=a9ad2c42f93235bcee29d73b47d5ba38cf1ff486;hb=74730c7d0e4f713c932d6b06a07644d1c3c6c6c1;hp=fe23cfad2b96efc910fe419fa3602350c80a4659;hpb=752438861433c3789eb1b0d9f2c15e15037595e6;p=anna.git diff --git a/example/diameter/launcher/MyDiameterEntity.hpp b/example/diameter/launcher/MyDiameterEntity.hpp index fe23cfa..a9ad2c4 100644 --- a/example/diameter/launcher/MyDiameterEntity.hpp +++ b/example/diameter/launcher/MyDiameterEntity.hpp @@ -15,9 +15,21 @@ // Process #include "ProgrammedAnswers.hpp" +namespace anna { + namespace diameter { + namespace codec { + class Engine; + } + } +} 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); void eventRequest(anna::diameter::comm::ClientSession *, const anna::DataBlock&) throw(anna::RuntimeException); void eventUnknownResponse(anna::diameter::comm::ClientSession *, const anna::DataBlock&) throw(anna::RuntimeException); @@ -28,8 +40,21 @@ class MyDiameterEntity : public anna::diameter::comm::Entity { public: + MyDiameterEntity() { + a_codecEngine = NULL; + 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