AWS IoT Device SDK C++ v2  1.34.0
AWS IoT Device SDK C++ v2
Public Member Functions | List of all members
Aws::Crt::Mqtt5::PublishPacket Class Reference

#include <Mqtt5Packets.h>

Inheritance diagram for Aws::Crt::Mqtt5::PublishPacket:
Aws::Crt::Mqtt5::IPacket

Public Member Functions

 PublishPacket (const aws_mqtt5_packet_publish_view &raw_options, Allocator *allocator=ApiAllocator()) noexcept
 
 PublishPacket (Allocator *allocator=ApiAllocator()) noexcept
 
 PublishPacket (Crt::String topic, ByteCursor payload, Mqtt5::QOS qos, Allocator *allocator=ApiAllocator()) noexcept
 
PacketType getType () override
 
PublishPacketWithPayload (ByteCursor payload) noexcept
 
PublishPacketWithQOS (Mqtt5::QOS packetQOS) noexcept
 
PublishPacketWithRetain (bool retain) noexcept
 
PublishPacketWithTopic (Crt::String topic) noexcept
 
PublishPacketWithPayloadFormatIndicator (PayloadFormatIndicator payloadFormat) noexcept
 
PublishPacketWithMessageExpiryIntervalSec (uint32_t second) noexcept
 
PublishPacketWithTopicAlias (uint16_t topicAlias) noexcept
 
PublishPacketWithResponseTopic (ByteCursor responseTopic) noexcept
 
PublishPacketWithCorrelationData (ByteCursor correlationData) noexcept
 
PublishPacketWithUserProperties (const Vector< UserProperty > &userProperties) noexcept
 
PublishPacketWithUserProperties (Vector< UserProperty > &&userProperties) noexcept
 
PublishPacketWithUserProperty (UserProperty &&property) noexcept
 
bool initializeRawOptions (aws_mqtt5_packet_publish_view &raw_options) noexcept
 
const ByteCursorgetPayload () const noexcept
 
Mqtt5::QOS getQOS () const noexcept
 
bool getRetain () const noexcept
 
const Crt::StringgetTopic () const noexcept
 
const Crt::Optional< PayloadFormatIndicator > & getPayloadFormatIndicator () const noexcept
 
const Crt::Optional< uint32_t > & getMessageExpiryIntervalSec () const noexcept
 
const Crt::Optional< uint16_t > & getTopicAlias () const noexcept
 
const Crt::Optional< ByteCursor > & getResponseTopic () const noexcept
 
const Crt::Optional< ByteCursor > & getCorrelationData () const noexcept
 
const Crt::Vector< uint32_t > & getSubscriptionIdentifiers () const noexcept
 
const Crt::Optional< ByteCursor > & getContentType () const noexcept
 
const Crt::Vector< UserProperty > & getUserProperties () const noexcept
 
virtual ~PublishPacket ()
 
 PublishPacket (const PublishPacket &)=delete
 
 PublishPacket (PublishPacket &&) noexcept=delete
 
PublishPacketoperator= (const PublishPacket &)=delete
 
PublishPacketoperator= (PublishPacket &&) noexcept=delete
 

Detailed Description

Data model of an MQTT5 PUBLISH packet

Constructor & Destructor Documentation

◆ PublishPacket() [1/5]

Aws::Crt::Mqtt5::PublishPacket::PublishPacket ( const aws_mqtt5_packet_publish_view &  raw_options,
Allocator allocator = ApiAllocator() 
)
noexcept

◆ PublishPacket() [2/5]

Aws::Crt::Mqtt5::PublishPacket::PublishPacket ( Allocator allocator = ApiAllocator())
noexcept

◆ PublishPacket() [3/5]

Aws::Crt::Mqtt5::PublishPacket::PublishPacket ( Crt::String  topic,
ByteCursor  payload,
Mqtt5::QOS  qos,
Allocator allocator = ApiAllocator() 
)
noexcept

◆ ~PublishPacket()

Aws::Crt::Mqtt5::PublishPacket::~PublishPacket ( )
virtual

◆ PublishPacket() [4/5]

Aws::Crt::Mqtt5::PublishPacket::PublishPacket ( const PublishPacket )
delete

◆ PublishPacket() [5/5]

Aws::Crt::Mqtt5::PublishPacket::PublishPacket ( PublishPacket &&  )
deletenoexcept

Member Function Documentation

◆ getContentType()

const Crt::Optional< ByteCursor > & Aws::Crt::Mqtt5::PublishPacket::getContentType ( ) const
noexcept

Property specifying the content type of the payload. Not internally meaningful to MQTT5.

See MQTT5 Content Type

Returns
ByteCursor to opaque binary data to the content type of the payload.

◆ getCorrelationData()

const Crt::Optional< ByteCursor > & Aws::Crt::Mqtt5::PublishPacket::getCorrelationData ( ) const
noexcept

Opaque binary data used to correlate between publish messages, as a potential method for request-response implementation. Not internally meaningful to MQTT5.

See MQTT5 Correlation Data

Returns
ByteCursor to opaque binary data used to correlate between publish messages.

◆ getMessageExpiryIntervalSec()

const Crt::Optional< uint32_t > & Aws::Crt::Mqtt5::PublishPacket::getMessageExpiryIntervalSec ( ) const
noexcept

Sent publishes - indicates the maximum amount of time allowed to elapse for message delivery before the server should instead delete the message (relative to a recipient).

Received publishes - indicates the remaining amount of time (from the server's perspective) before the message would have been deleted relative to the subscribing client.

If left null, indicates no expiration timeout.

See MQTT5 Message Expiry Interval

Returns
The message expiry interval associated with this PUBLISH packet.

◆ getPayload()

const ByteCursor & Aws::Crt::Mqtt5::PublishPacket::getPayload ( ) const
noexcept

The payload of the publish message.

See MQTT5 Publish Payload

Returns
The payload of the publish message.

◆ getPayloadFormatIndicator()

const Crt::Optional< PayloadFormatIndicator > & Aws::Crt::Mqtt5::PublishPacket::getPayloadFormatIndicator ( ) const
noexcept

Property specifying the format of the payload data. The mqtt5 client does not enforce or use this value in a meaningful way.

See MQTT5 Payload Format Indicator

Returns
Property specifying the format of the payload data.

◆ getQOS()

Mqtt5::QOS Aws::Crt::Mqtt5::PublishPacket::getQOS ( ) const
noexcept

Sent publishes - The MQTT quality of service level this message should be delivered with.

Received publishes - The MQTT quality of service level this message was delivered at.

See MQTT5 QoS

Returns
The MQTT quality of service associated with this PUBLISH packet.

◆ getResponseTopic()

const Crt::Optional< ByteCursor > & Aws::Crt::Mqtt5::PublishPacket::getResponseTopic ( ) const
noexcept

Opaque topic string intended to assist with request/response implementations. Not internally meaningful to MQTT5 or this client.

See MQTT5 Response Topic

Returns
ByteCursor to topic string intended to assist with request/response implementations.

◆ getRetain()

bool Aws::Crt::Mqtt5::PublishPacket::getRetain ( ) const
noexcept

True if this is a retained message, false otherwise.

Always set on received publishes.

See MQTT5 Retain

Returns
True if this is a retained message, false otherwise.

◆ getSubscriptionIdentifiers()

const Crt::Vector< uint32_t > & Aws::Crt::Mqtt5::PublishPacket::getSubscriptionIdentifiers ( ) const
noexcept

Sent publishes - ignored

Received publishes - the subscription identifiers of all the subscriptions this message matched.

See MQTT5 Subscription Identifier

Returns
the subscription identifiers of all the subscriptions this message matched.

◆ getTopic()

const Crt::String & Aws::Crt::Mqtt5::PublishPacket::getTopic ( ) const
noexcept

Sent publishes - The topic this message should be published to.

Received publishes - The topic this message was published to.

See MQTT5 Topic Name

Returns
The topic associated with this PUBLISH packet.

◆ getTopicAlias()

const Crt::Optional< uint16_t > & Aws::Crt::Mqtt5::PublishPacket::getTopicAlias ( ) const
noexcept

Sent publishes - Topic alias to use, if possible, when encoding this packet. Only used if the client's outbound topic aliasing mode is set to Manual.

Received publishes - topic alias used by the server when transmitting the publish to the client.

See MQTT5 Topic Alias

Returns
the topic alias, if any, associated with this PUBLISH packet

◆ getType()

PacketType Aws::Crt::Mqtt5::PublishPacket::getType ( )
inlineoverridevirtual

◆ getUserProperties()

const Crt::Vector< UserProperty > & Aws::Crt::Mqtt5::PublishPacket::getUserProperties ( ) const
noexcept

List of MQTT5 user properties included with the packet.

See MQTT5 User Property

Returns
List of MQTT5 user properties included with the packet.

◆ initializeRawOptions()

bool Aws::Crt::Mqtt5::PublishPacket::initializeRawOptions ( aws_mqtt5_packet_publish_view &  raw_options)
noexcept

◆ operator=() [1/2]

PublishPacket& Aws::Crt::Mqtt5::PublishPacket::operator= ( const PublishPacket )
delete

◆ operator=() [2/2]

PublishPacket& Aws::Crt::Mqtt5::PublishPacket::operator= ( PublishPacket &&  )
deletenoexcept

◆ WithCorrelationData()

PublishPacket & Aws::Crt::Mqtt5::PublishPacket::WithCorrelationData ( ByteCursor  correlationData)
noexcept

Sets the opaque binary data used to correlate between publish messages, as a potential method for request-response implementation. Not internally meaningful to MQTT5.

See MQTT5 Correlation Data

Parameters
correlationDataOpaque binary data used to correlate between publish messages
Returns
The PublishPacket Object after setting the correlation data.

◆ WithMessageExpiryIntervalSec()

PublishPacket & Aws::Crt::Mqtt5::PublishPacket::WithMessageExpiryIntervalSec ( uint32_t  second)
noexcept

Sets the maximum amount of time allowed to elapse for message delivery before the server should instead delete the message (relative to a recipient).

See MQTT5 Message Expiry Interval

Parameters
secondThe maximum amount of time allowed to elapse for message delivery before the server should instead delete the message (relative to a recipient).
Returns
The PublishPacket Object after setting the message expiry interval.

◆ WithPayload()

PublishPacket & Aws::Crt::Mqtt5::PublishPacket::WithPayload ( ByteCursor  payload)
noexcept

Sets the payload for the publish message.

See MQTT5 Publish Payload

Parameters
payloadThe payload for the publish message.
Returns
The PublishPacket Object after setting the payload.

◆ WithPayloadFormatIndicator()

PublishPacket & Aws::Crt::Mqtt5::PublishPacket::WithPayloadFormatIndicator ( PayloadFormatIndicator  payloadFormat)
noexcept

Sets the property specifying the format of the payload data. The mqtt5 client does not enforce or use this value in a meaningful way.

See MQTT5 Payload Format Indicator

Parameters
payloadFormatProperty specifying the format of the payload data
Returns
The PublishPacket Object after setting the payload format.

◆ WithQOS()

PublishPacket & Aws::Crt::Mqtt5::PublishPacket::WithQOS ( Mqtt5::QOS  packetQOS)
noexcept

Sets the MQTT quality of service level the message should be delivered with.

See MQTT5 QoS

Parameters
packetQOSThe MQTT quality of service level the message should be delivered with.
Returns
The PublishPacket Object after setting the QOS.

◆ WithResponseTopic()

PublishPacket & Aws::Crt::Mqtt5::PublishPacket::WithResponseTopic ( ByteCursor  responseTopic)
noexcept

Sets the opaque topic string intended to assist with request/response implementations. Not internally meaningful to MQTT5 or this client.

See MQTT5 Response Topic

Parameters
responseTopic
Returns
The PublishPacket Object after setting the response topic.

◆ WithRetain()

PublishPacket & Aws::Crt::Mqtt5::PublishPacket::WithRetain ( bool  retain)
noexcept

Sets if this should be a retained message.

See MQTT5 Retain

Parameters
retainif this is a retained message.
Returns
The PublishPacket Object after setting the retain setting.

◆ WithTopic()

PublishPacket & Aws::Crt::Mqtt5::PublishPacket::WithTopic ( Crt::String  topic)
noexcept

Sets the topic this message should be published to. See MQTT5 Topic Name

Parameters
topicThe topic this message should be published to.
Returns
The PublishPacket Object after setting the topic.

◆ WithTopicAlias()

PublishPacket & Aws::Crt::Mqtt5::PublishPacket::WithTopicAlias ( uint16_t  topicAlias)
noexcept

Sets the opic alias to use, if possible, when encoding this packet. Only used if the client's outbound topic aliasing mode is set to Manual.

See MQTT5 Topic Alias

◆ WithUserProperties() [1/2]

PublishPacket & Aws::Crt::Mqtt5::PublishPacket::WithUserProperties ( const Vector< UserProperty > &  userProperties)
noexcept

Sets the list of MQTT5 user properties included with the packet.

See MQTT5 User Property

Parameters
userPropertiesList of MQTT5 user properties included with the packet.
Returns
The PublishPacket Object after setting the user properties

◆ WithUserProperties() [2/2]

PublishPacket & Aws::Crt::Mqtt5::PublishPacket::WithUserProperties ( Vector< UserProperty > &&  userProperties)
noexcept

Sets the list of MQTT5 user properties included with the packet.

See MQTT5 User Property

Parameters
userPropertiesList of MQTT5 user properties included with the packet.
Returns
The PublishPacket Object after setting the user properties

◆ WithUserProperty()

PublishPacket & Aws::Crt::Mqtt5::PublishPacket::WithUserProperty ( UserProperty &&  property)
noexcept

Put a MQTT5 user property to the back of the packet user property vector/list

See MQTT5 User Property

Parameters
propertyset of userProperty of MQTT5 user properties included with the packet.
Returns
The PublishPacket Object after setting the user property

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