X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;f=example%2Fdiameter%2Flauncher%2FMyDiameterEntity.hpp;h=73494b5c133099bc9b6962b0a60f60aac7e1a087;hb=97a93101fb874a3237083d72c6d6f8c8df8dcfba;hp=e69de29bb2d1d6434b8b29ae775ad8c2e48c5391;hpb=705d780f70b3596a222479ec7ad0dc3b3ab192cf;p=anna.git diff --git a/example/diameter/launcher/MyDiameterEntity.hpp b/example/diameter/launcher/MyDiameterEntity.hpp index e69de29..73494b5 100644 --- a/example/diameter/launcher/MyDiameterEntity.hpp +++ b/example/diameter/launcher/MyDiameterEntity.hpp @@ -0,0 +1,57 @@ +// 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_MyDiameterEntity_hpp +#define example_diameter_launcher_MyDiameterEntity_hpp + +// Project +#include + +// Process +#include + +namespace anna { + namespace diameter { + namespace codec { + class Engine; + } + } +} + +class MyDiameterEntity : public anna::diameter::comm::Entity { + + 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); + void eventDPA(anna::diameter::comm::ClientSession *, const anna::DataBlock&) throw(anna::RuntimeException); + + // Reimplementation + int readSocketId(const anna::diameter::comm::Message* message, int maxClientSessions) const throw(); + +public: + + MyDiameterEntity() { + a_balance = false; + a_sessionBasedModelsType = "SessionIdLowPart"; + } + + ProgrammedAnswers a_reactingAnswers; + 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