AWS SDK for C++  1.8.95
AWS SDK for C++
Public Types | Public Member Functions | Static Public Member Functions | List of all members
Aws::Utils::Event::Message Class Reference

#include <EventMessage.h>

Public Types

enum  MessageType { MessageType::UNKNOWN, MessageType::EVENT, MessageType::REQUEST_LEVEL_ERROR, MessageType::REQUEST_LEVEL_EXCEPTION }
 
enum  ContentType { ContentType::UNKNOWN, ContentType::APPLICATION_OCTET_STREAM, ContentType::APPLICATION_JSON, ContentType::TEXT_PLAIN }
 

Public Member Functions

void Reset ()
 
void SetTotalLength (size_t length)
 
size_t GetTotalLength () const
 
void SetHeadersLength (size_t length)
 
size_t GetHeadersLength () const
 
void SetPayloadLength (size_t length)
 
size_t GetPayloadLength () const
 
void InsertEventHeader (const Aws::String &headerName, const EventHeaderValue &eventHeaderValue)
 
const Aws::Utils::Event::EventHeaderValueCollectionGetEventHeaders () const
 
void WriteEventPayload (const unsigned char *data, size_t length)
 
void WriteEventPayload (const Aws::Vector< unsigned char > &bits)
 
void WriteEventPayload (const Aws::String &bits)
 
Aws::Vector< unsigned char > && GetEventPayloadWithOwnership ()
 
const Aws::Vector< unsigned char > & GetEventPayload () const
 
Aws::Vector< unsigned char > & GetEventPayload ()
 
Aws::String GetEventPayloadAsString ()
 

Static Public Member Functions

static MessageType GetMessageTypeForName (const Aws::String &name)
 
static Aws::String GetNameForMessageType (MessageType value)
 
static ContentType GetContentTypeForName (const Aws::String &name)
 
static Aws::String GetNameForContentType (ContentType value)
 

Detailed Description

A typical message in event stream consists of two parts: Prelude and Data, as well as the prelude CRC and message CRC. Prelude consists of total byte length and headers byte length. Data consists of headers and payload.

Definition at line 29 of file EventMessage.h.

Member Enumeration Documentation

◆ ContentType

Enumerator
UNKNOWN 
APPLICATION_OCTET_STREAM 
APPLICATION_JSON 
TEXT_PLAIN 

Definition at line 40 of file EventMessage.h.

◆ MessageType

Enumerator
UNKNOWN 
EVENT 
REQUEST_LEVEL_ERROR 
REQUEST_LEVEL_EXCEPTION 

Definition at line 32 of file EventMessage.h.

Member Function Documentation

◆ GetContentTypeForName()

static ContentType Aws::Utils::Event::Message::GetContentTypeForName ( const Aws::String name)
static

◆ GetEventHeaders()

const Aws::Utils::Event::EventHeaderValueCollection& Aws::Utils::Event::Message::GetEventHeaders ( ) const
inline

Definition at line 92 of file EventMessage.h.

◆ GetEventPayload() [1/2]

const Aws::Vector<unsigned char>& Aws::Utils::Event::Message::GetEventPayload ( ) const
inline

Definition at line 104 of file EventMessage.h.

◆ GetEventPayload() [2/2]

Aws::Vector<unsigned char>& Aws::Utils::Event::Message::GetEventPayload ( )
inline

Definition at line 105 of file EventMessage.h.

◆ GetEventPayloadAsString()

Aws::String Aws::Utils::Event::Message::GetEventPayloadAsString ( )
inline

Convert byte array of the payload to string without transferring ownership.

Definition at line 109 of file EventMessage.h.

◆ GetEventPayloadWithOwnership()

Aws::Vector<unsigned char>&& Aws::Utils::Event::Message::GetEventPayloadWithOwnership ( )
inline

Get the byte array of the payload with transferring ownership.

Definition at line 103 of file EventMessage.h.

◆ GetHeadersLength()

size_t Aws::Utils::Event::Message::GetHeadersLength ( ) const
inline

Definition at line 76 of file EventMessage.h.

◆ GetMessageTypeForName()

static MessageType Aws::Utils::Event::Message::GetMessageTypeForName ( const Aws::String name)
static

◆ GetNameForContentType()

static Aws::String Aws::Utils::Event::Message::GetNameForContentType ( ContentType  value)
static

◆ GetNameForMessageType()

static Aws::String Aws::Utils::Event::Message::GetNameForMessageType ( MessageType  value)
static

◆ GetPayloadLength()

size_t Aws::Utils::Event::Message::GetPayloadLength ( ) const
inline

Definition at line 82 of file EventMessage.h.

◆ GetTotalLength()

size_t Aws::Utils::Event::Message::GetTotalLength ( ) const
inline

Definition at line 69 of file EventMessage.h.

◆ InsertEventHeader()

void Aws::Utils::Event::Message::InsertEventHeader ( const Aws::String headerName,
const EventHeaderValue eventHeaderValue 
)
inline

Set/get event headers.

Definition at line 87 of file EventMessage.h.

◆ Reset()

void Aws::Utils::Event::Message::Reset ( )

Clean up the message, including the metadata, headers and payload received.

◆ SetHeadersLength()

void Aws::Utils::Event::Message::SetHeadersLength ( size_t  length)
inline

Get/set the length of the headers. Each header consists of: header name byte-length(1 byte) + header name + header value type(1 byte) + header value.

Definition at line 75 of file EventMessage.h.

◆ SetPayloadLength()

void Aws::Utils::Event::Message::SetPayloadLength ( size_t  length)
inline

Get/set the length of payload.

Definition at line 81 of file EventMessage.h.

◆ SetTotalLength()

void Aws::Utils::Event::Message::SetTotalLength ( size_t  length)
inline

Get/set the total length of this message: prelude(8 bytes) + prelude CRC(4 bytes) + Data(headers length + payload length) + message CRC(4 bytes).

Definition at line 63 of file EventMessage.h.

◆ WriteEventPayload() [1/3]

void Aws::Utils::Event::Message::WriteEventPayload ( const unsigned char *  data,
size_t  length 
)

Set event payload.

◆ WriteEventPayload() [2/3]

void Aws::Utils::Event::Message::WriteEventPayload ( const Aws::Vector< unsigned char > &  bits)

◆ WriteEventPayload() [3/3]

void Aws::Utils::Event::Message::WriteEventPayload ( const Aws::String bits)

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