ANNA Suite  2020b
Multipurpose development suite for Telco applications
Classes | Public Member Functions | Protected Member Functions | Friends | List of all members
anna::diameter::comm::Message Class Reference

#include <Message.hpp>

Inheritance diagram for anna::diameter::comm::Message:
Inheritance graph
[legend]
Collaboration diagram for anna::diameter::comm::Message:
Collaboration graph
[legend]

Classes

struct  OnExpiry
 

Public Member Functions

 Message (const OnExpiry::_v onExpiry=OnExpiry::Ignore)
 
const ClassCode::_vgetClassCode () const
 
OnExpiry::_v getOnExpiry () const
 
void setOnExpiry (const OnExpiry::_v onExpiry)
 
void setClassCode (const ClassCode::_v &classCode)
 
virtual std::string asString () const
 
virtual anna::xml::NodeasXML (anna::xml::Node *parent) const
 
HopByHop getHopByHop () const
 
EndToEnd getEndToEnd () const
 
HopByHop getRequestHopByHop () const
 
EndToEnd getRequestEndToEnd () const
 
void setRequestHopByHop (HopByHop hbh)
 
void setRequestEndToEnd (EndToEnd ete)
 
CommandId getCommandId (bool &isRequest) const
 
CommandId getCommandId () const
 
ApplicationId getApplicationId () const
 
bool fixRequestSequence (HopByHop hbh, EndToEnd ete)
 
bool endToEndSequenced () const
 
void forwardEndToEnd ()
 
void sequenceEndToEnd ()
 
void updateRequestTimestampMs (void)
 
const anna::MillisecondgetRequestTimestampMs () const
 
int getRetries () const
 
void setRetries (int value)
 
int getRequestServerSessionKey () const
 
void setRequestServerSessionKey (int value)
 
const std::string & getRequestClientSessionKey () const
 
void setRequestClientSessionKey (const std::string &value)
 
void initialize ()
 
- Public Member Functions inherited from anna::comm::Message
 Message ()
 
virtual ~Message ()
 
const DataBlockgetBody () const
 
MessagesetBody (const DataBlock &body) noexcept(false)
 
MessagesetBody (const char *buffer, const int size) noexcept(false)
 
virtual MessagesetBody (const xml::Node *node) noexcept(false)
 
void clearBody ()
 
virtual const DataBlockcode () noexcept(false)
 
- Public Member Functions inherited from anna::DataBlock
 DataBlock (const bool deepCopy=false)
 
 DataBlock (const char *buffer, const int size, const bool deepCopy=false) noexcept(false)
 
 DataBlock (const DataBlock &other) noexcept(false)
 
virtual ~DataBlock ()
 
int getMaxSize () const
 
int getSize () const
 
const char * getData () const
 
bool isEmpty () const
 
bool deepCopy () const
 
void setSize (const int size) noexcept(false)
 
DataBlockoperator+= (const char c) noexcept(false)
 
DataBlockoperator+= (const DataBlock &right) noexcept(false)
 
DataBlockoperator+= (const std::string &str) noexcept(false)
 
const char operator[] (const int pos) const noexcept(false)
 
char & operator[] (const int pos) noexcept(false)
 
void append (const char *data, const int len) noexcept(false)
 
void append (const DataBlock &other) noexcept(false)
 
void assign (const DataBlock &right) noexcept(false)
 
void assign (const char *buffer, const int size) noexcept(false)
 
DataBlockoperator= (const DataBlock &right) noexcept(false)
 
DataBlockoperator= (const char c) noexcept(false)
 
DataBlockoperator= (const std::string &str) noexcept(false)
 
void allocate (const int nbytes) noexcept(false)
 
void clear () noexcept(false)
 
void remove (const int pos, const int nbytes) noexcept(false)
 
void remove (const int nbytes) noexcept(false)
 
std::string asString (const int characterByLine=24) const
 

Protected Member Functions

 Message (const ClassCode::_v &classCode, const OnExpiry::_v onExpiry=OnExpiry::Ignore)
 
- Protected Member Functions inherited from anna::comm::Message
 Message (const StatusCodeBuffer::_v statusCodeBuffer)
 
 Message (DataBlock &codeBuffer)
 
- Protected Member Functions inherited from anna::DataBlock
void initialize (const char *buffer, const int size) noexcept(false)
 
void setBuffer (const char *buffer)
 
void setMaxSize (const int maxSize)
 

Friends

class Session
 
class ClientSession
 
class ServerSession
 

Additional Inherited Members

- Protected Attributes inherited from anna::comm::Message
DataBlocka_codeBuffer
 

Detailed Description

Messages launched to diameter servers Could be proxied (end-to-end kept) or not (by default).

Constructor & Destructor Documentation

◆ Message() [1/2]

anna::diameter::comm::Message::Message ( const OnExpiry::_v  onExpiry = OnExpiry::Ignore)
inline

Constructor.

Parameters
onExpiryIndica la acci�n a realizar si el temporizador de esta transaci�n expira.
58  a_classCode(ClassCode::ApplicationMessage),
59  a_onExpiry(onExpiry) { initialize(); }
void initialize()
Definition: Message.hpp:156
Definition: Message.hpp:26

◆ Message() [2/2]

anna::diameter::comm::Message::Message ( const ClassCode::_v classCode,
const OnExpiry::_v  onExpiry = OnExpiry::Ignore 
)
inlineprotected

Constructor.

Parameters
classCodeTipo de clase de esta peticion.
onExpiryIndica la acci�n a realizar si el temporizador de esta transaci�n expira.
173  a_classCode(classCode),
174  a_onExpiry(onExpiry) { initialize(); }
void initialize()
Definition: Message.hpp:156
Definition: Message.hpp:26

Member Function Documentation

◆ asString()

virtual std::string anna::diameter::comm::Message::asString ( ) const
virtual

Class string representation

Returns
String with relevant information for this instance.

◆ asXML()

virtual anna::xml::Node* anna::diameter::comm::Message::asXML ( anna::xml::Node parent) const
virtual

Class xml representation

Parameters
parentParent XML node on which hold this instance information.
Returns
XML document with relevant information for this instance.

◆ endToEndSequenced()

bool anna::diameter::comm::Message::endToEndSequenced ( ) const
inline

In general, diameter nodes will sequence the End-To-End value when sending new requests. A 'false' value stands for intermediate agents (must keep end-to-end during 4 minutes even upon reboots).

118 { return a_endToEndSequenced; }

◆ fixRequestSequence()

bool anna::diameter::comm::Message::fixRequestSequence ( HopByHop  hbh,
EndToEnd  ete 
)

◆ forwardEndToEnd()

void anna::diameter::comm::Message::forwardEndToEnd ( )
inline

By default, the diameter::comm message will sequence the end-to-end increasing the initial value created during session establishment. Anyway you could change this behaviour with this method.

See also
sequenceEndToEnd
126 { a_endToEndSequenced = false; }

◆ getApplicationId()

ApplicationId anna::diameter::comm::Message::getApplicationId ( ) const

◆ getClassCode()

const ClassCode::_v& anna::diameter::comm::Message::getClassCode ( ) const
inline

Devuelve el tipo de la clase de esta peticion indicada en el contructor.

Returns
El tipo de la clase de esta peticion indicada en el contructor.
65 { return a_classCode; }

◆ getCommandId() [1/2]

CommandId anna::diameter::comm::Message::getCommandId ( bool &  isRequest) const

◆ getCommandId() [2/2]

CommandId anna::diameter::comm::Message::getCommandId ( ) const
inline
107 { bool dummy; return getCommandId(dummy); }
CommandId getCommandId() const
Definition: Message.hpp:107
Here is the call graph for this function:

◆ getEndToEnd()

EndToEnd anna::diameter::comm::Message::getEndToEnd ( ) const

◆ getHopByHop()

HopByHop anna::diameter::comm::Message::getHopByHop ( ) const

◆ getOnExpiry()

OnExpiry::_v anna::diameter::comm::Message::getOnExpiry ( ) const
inline

Devuelve la acci�n a realizar en caso de que el temporizador asociado a esta petici�n expire.

Returns
la acci�n a realizar en caso de que el temporizador asociado a esta petici�n expire.
71 { return a_onExpiry; }

◆ getRequestClientSessionKey()

const std::string& anna::diameter::comm::Message::getRequestClientSessionKey ( ) const
inline
150 { return a_requestClientSessionKey; }

◆ getRequestEndToEnd()

EndToEnd anna::diameter::comm::Message::getRequestEndToEnd ( ) const
inline
103 { return a_requestEndToEnd; }

◆ getRequestHopByHop()

HopByHop anna::diameter::comm::Message::getRequestHopByHop ( ) const
inline
102 { return a_requestHopByHop; }

◆ getRequestServerSessionKey()

int anna::diameter::comm::Message::getRequestServerSessionKey ( ) const
inline
145 { return a_requestServerSessionKey; }

◆ getRequestTimestampMs()

const anna::Millisecond& anna::diameter::comm::Message::getRequestTimestampMs ( ) const
inline
139 { return (a_request_timestamp_ms); }

◆ getRetries()

int anna::diameter::comm::Message::getRetries ( ) const
inline
141 { return a_retries; }

◆ initialize()

void anna::diameter::comm::Message::initialize ( )
inline

Initializes class information

156  {
157  a_retries = 1;
158  a_requestServerSessionKey = -1; // means unknown/unset
159  a_requestClientSessionKey = ""; // means unknown/unset
160  a_requestHopByHop = 0;
161  a_requestEndToEnd = 0;
162  a_endToEndSequenced = true;
163  }

◆ sequenceEndToEnd()

void anna::diameter::comm::Message::sequenceEndToEnd ( )
inline

By default, the diameter::comm message will sequence the end-to-end increasing the initial value created during session establishment. Anyway you could set again this behaviour with this method.

See also
forwardEndToEnd
134 { a_endToEndSequenced = true; }

◆ setClassCode()

void anna::diameter::comm::Message::setClassCode ( const ClassCode::_v classCode)
inline
82 { a_classCode = classCode; }

◆ setOnExpiry()

void anna::diameter::comm::Message::setOnExpiry ( const OnExpiry::_v  onExpiry)
inline

Establece la acci�n a realizar en caso de que el temporizador asociado a esta petici�n expire.

Parameters
onExpiryIndica la acci�n a realizar en caso de que el temporizador asociado a esta petici�n expire.
Warning
Establecer el valor OnExpiry::Ignore podr�a causar p�rdida de memoria y uso innecesario de recursos.
79 { a_onExpiry = onExpiry; }

◆ setRequestClientSessionKey()

void anna::diameter::comm::Message::setRequestClientSessionKey ( const std::string &  value)
inline

Application specific socket id to keep origin track for request which came from a specific server (entity), at asyncronous contexts (process with both diameter interfaces: client & entities)

153 { a_requestClientSessionKey = value; }

◆ setRequestEndToEnd()

void anna::diameter::comm::Message::setRequestEndToEnd ( EndToEnd  ete)
inline
105 { a_requestEndToEnd = ete; }

◆ setRequestHopByHop()

void anna::diameter::comm::Message::setRequestHopByHop ( HopByHop  hbh)
inline
104 { a_requestHopByHop = hbh; }

◆ setRequestServerSessionKey()

void anna::diameter::comm::Message::setRequestServerSessionKey ( int  value)
inline

Application specific socket id to keep origin track for request which came from a specific client, at asyncronous contexts (process with both diameter interfaces: client & entities)

148 { a_requestServerSessionKey = value; }

◆ setRetries()

void anna::diameter::comm::Message::setRetries ( int  value)
inline
142 { a_retries = value; }

◆ updateRequestTimestampMs()

void anna::diameter::comm::Message::updateRequestTimestampMs ( void  )
inline
138 { a_request_timestamp_ms = anna::functions::millisecond(); }
static Millisecond millisecond()
Definition: functions.hpp:379
Here is the call graph for this function:

Friends And Related Function Documentation

◆ ClientSession

friend class ClientSession
friend

◆ ServerSession

friend class ServerSession
friend

◆ Session

friend class Session
friend

The documentation for this class was generated from the following file: