Package software.amazon.awssdk.crt.mqtt5
Class PublishResult
java.lang.Object
software.amazon.awssdk.crt.mqtt5.PublishResult
The type of data returned after calling Publish on an Mqtt5Client. The data contained varies depending
on the publish and its configuration. Use
getType()
to figure out what type of data is contained and either
getData()
to get the data and cast it, or call getResult[Type name here]()
to get the data already cast.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
The type of data returned after calling Publish on an MQTT5 client. -
Method Summary
-
Method Details
-
getType
Returns the type of data that was returned after calling Publish on the Mqtt5Client. You can use this information to determine what type of data is contained and eithergetData()
to get the data and cast it, or callgetResult[Type name here]()
to get the data already cast.- Returns:
- The type of data contained in the PublishResult
-
getValue
Returns the data contained in the PubAck result. This is based on the PublishResultType, which is determined by the QoS setting in the published message. Note: To get the data type from this function, you will need to cast. For example, to get the PubAck from result type of PUBACK, you will need to use the following:PubAckPacket packet = (PubAckPacket)getValue()
- Returns:
- The data contained in the PublishResult result
-
getResultPubAck
Returns the data contained in the PublishResult for a PublishResultType of PUBACK. This occurs for QoS 1 and will return a PubAckPacket.- Returns:
- the data contained in the PublishResult for a PublishResultType of PUBACK.
-