Dripline-Cpp  v2.4.2
Dripline Implementation in C++
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
msg_reply Class Reference

Reply message class. More...

#include <message.hh>

Inheritance diagram for msg_reply:
Inheritance graph

Public Member Functions

 msg_reply ()
 
virtual ~msg_reply ()
 
bool is_request () const
 
bool is_reply () const
 
bool is_alert () const
 
virtual msg_t message_type () const
 
 snake_case_mv_accessible_static_noset (msg_t, message_type)
 
 snake_case_mv_accessible (unsigned, return_code)
 
 snake_case_mv_referrable (std::string, return_message)
 
- Public Member Functions inherited from message
 message ()
 
virtual ~message ()
 
amqp_split_message_ptrs create_amqp_messages (unsigned a_max_size=10000)
 Converts a Dripline message object to a set of AMQP messages. More...
 
void encode_message_body (std::vector< std::string > &a_body_vec, unsigned a_max_size, const scarab::param_node &a_options=scarab::param_node()) const
 Converts the message-body to a strings (default encoding is JSON) for creating AMQP messages. More...
 
std::string encode_full_message (unsigned a_max_size, const scarab::param_node &a_options=scarab::param_node()) const
 Converts the entire message into a single string (default encoding is JSON) More...
 
 snake_case_mv_accessible (bool, is_valid)
 Flag indicating whether the message was correctly converted from one or more AMQP messages. More...
 
 snake_case_mv_referrable (std::string, routing_key)
 
 snake_case_mv_referrable (std::string, correlation_id)
 
 snake_case_mv_referrable (std::string, message_id)
 
 snake_case_mv_referrable (std::string, reply_to)
 
 snake_case_mv_accessible (encoding, encoding)
 
 snake_case_mv_referrable (std::string, timestamp)
 
 snake_case_mv_referrable (std::string, sender_exe)
 
 snake_case_mv_referrable (std::string, sender_hostname)
 
 snake_case_mv_referrable (std::string, sender_username)
 
 snake_case_mv_referrable (std::string, sender_service_name)
 
 snake_case_mv_referrable (sender_version_map_t, sender_versions)
 
specifierparsed_specifier ()
 
const specifierparsed_specifier () const
 
scarab::param_node get_sender_info () const
 Creates and returns a new param_node object to contain the sender info. More...
 
void set_sender_info (const scarab::param_node &a_sender_info)
 Copies the sender info out of a param_node. More...
 
scarab::param_node get_message_param (bool a_include_payload=true) const
 Creates and returns a new param_node object to contain the full message. More...
 
scarab::param & payload ()
 
const scarab::param & payload () const
 
void set_payload (scarab::param_ptr_t a_payload)
 
const scarab::param_ptr_t & get_payload_ptr () const
 

Static Public Member Functions

static reply_ptr_t create (const return_code &a_return_code, const std::string &a_ret_msg, scarab::param_ptr_t a_payload, const std::string &a_routing_key, const std::string &a_specifier="", message::encoding a_encoding=encoding::json)
 Create a reply message using a return_code object and manually specifying the destination. More...
 
static reply_ptr_t create (unsigned a_return_code_value, const std::string &a_ret_msg, scarab::param_ptr_t a_payload, const std::string &a_routing_key, const std::string &a_specifier="", message::encoding a_encoding=encoding::json)
 Create a reply message using an integer return code and manually specifying the destination. More...
 
static reply_ptr_t create (const return_code &a_return_code, const std::string &a_ret_msg, scarab::param_ptr_t a_payload, const msg_request &a_request)
 Create a reply message using a return_code object and a request message for the destination and correlation ID. More...
 
static reply_ptr_t create (unsigned a_return_code, const std::string &a_ret_msg, scarab::param_ptr_t a_payload, const msg_request &a_request)
 Create a reply message using an integer return code and a request message for the destination and correlation ID. More...
 
- Static Public Member Functions inherited from message
static std::tuple< std::string, unsigned, unsigned > parse_message_id (const std::string &a_message_id)
 Parses the message ID, which should be of the form [UUID]/[chunk]/[total chunks]. More...
 
static message_ptr_t process_message (amqp_split_message_ptrs a_message_ptrs, const std::string &a_routing_key)
 Converts a set of AMQP messages to a Dripline message object. More...
 

Private Member Functions

void derived_modify_amqp_message (amqp_message_ptr a_amqp_msg, AmqpClient::Table &a_properties) const
 
virtual void derived_modify_message_param (scarab::param_node &a_message_node) const
 

Private Attributes

std::string f_return_buffer
 

Additional Inherited Members

- Public Types inherited from message
enum  encoding { json }
 
typedef std::map< std::string, sender_package_versionsender_version_map_t
 
- Static Public Attributes inherited from message
static const char s_message_id_separator = '/'
 
- Protected Member Functions inherited from message
std::string interpret_encoding () const
 
- Protected Attributes inherited from message
specifier f_specifier
 

Detailed Description

Reply message class.

Author
N.S. Oblath

Adds the return code and return message.

Reply messages can be created with the create() functions. A variety of create() function overloads are available, depending on whether the return code is specified with a return_code object or as an int, and depending on whether a request message is used to fill out some of the header information or if it's done manually.

Definition at line 229 of file message.hh.

Constructor & Destructor Documentation

◆ msg_reply()

msg_reply ( )

Definition at line 514 of file message.cc.

◆ ~msg_reply()

~msg_reply ( )
virtual

Definition at line 522 of file message.cc.

Member Function Documentation

◆ create() [1/4]

static reply_ptr_t create ( const return_code a_return_code,
const std::string &  a_ret_msg,
scarab::param_ptr_t  a_payload,
const std::string &  a_routing_key,
const std::string &  a_specifier = "",
message::encoding  a_encoding = encoding::json 
)
static

Create a reply message using a return_code object and manually specifying the destination.

◆ create() [2/4]

static reply_ptr_t create ( unsigned  a_return_code_value,
const std::string &  a_ret_msg,
scarab::param_ptr_t  a_payload,
const std::string &  a_routing_key,
const std::string &  a_specifier = "",
message::encoding  a_encoding = encoding::json 
)
static

Create a reply message using an integer return code and manually specifying the destination.

◆ create() [3/4]

reply_ptr_t create ( const return_code a_return_code,
const std::string &  a_ret_msg,
scarab::param_ptr_t  a_payload,
const msg_request a_request 
)
inlinestatic

Create a reply message using a return_code object and a request message for the destination and correlation ID.

Definition at line 393 of file message.hh.

◆ create() [4/4]

reply_ptr_t create ( unsigned  a_return_code,
const std::string &  a_ret_msg,
scarab::param_ptr_t  a_payload,
const msg_request a_request 
)
inlinestatic

Create a reply message using an integer return code and a request message for the destination and correlation ID.

Definition at line 398 of file message.hh.

◆ derived_modify_amqp_message()

void derived_modify_amqp_message ( amqp_message_ptr  a_amqp_msg,
AmqpClient::Table &  a_properties 
) const
inlineprivatevirtual

Implements message.

Definition at line 418 of file message.hh.

◆ derived_modify_message_param()

void derived_modify_message_param ( scarab::param_node &  a_message_node) const
inlineprivatevirtual

Implements message.

Definition at line 425 of file message.hh.

◆ is_alert()

bool is_alert ( ) const
inlinevirtual

Implements message.

Definition at line 413 of file message.hh.

◆ is_reply()

bool is_reply ( ) const
inlinevirtual

Implements message.

Definition at line 409 of file message.hh.

◆ is_request()

bool is_request ( ) const
inlinevirtual

Implements message.

Definition at line 405 of file message.hh.

◆ message_type()

msg_t message_type ( ) const
virtual

Implements message.

Definition at line 546 of file message.cc.

◆ snake_case_mv_accessible()

snake_case_mv_accessible ( unsigned  ,
return_code   
)

◆ snake_case_mv_accessible_static_noset()

snake_case_mv_accessible_static_noset ( msg_t  ,
message_type   
)

◆ snake_case_mv_referrable()

snake_case_mv_referrable ( std::string  ,
return_message   
)

Member Data Documentation

◆ f_return_buffer

std::string f_return_buffer
mutableprivate

Definition at line 260 of file message.hh.


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