Package software.amazon.awssdk.crt.mqtt5
Class PublishResult
- java.lang.Object
-
- software.amazon.awssdk.crt.mqtt5.PublishResult
-
public class PublishResult extends Object
The type of data returned after calling Publish on an Mqtt5Client. The data contained varies depending on the publish and its configuration. UsegetType()
to figure out 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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PublishResult.PublishResultType
The type of data returned after calling Publish on an MQTT5 client.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PubAckPacket
getResultPubAck()
Returns the data contained in the PublishResult for a PublishResultType of PUBACK.PublishResult.PublishResultType
getType()
Returns the type of data that was returned after calling Publish on the Mqtt5Client.Object
getValue()
Returns the data contained in the PubAck result.
-
-
-
Method Detail
-
getType
public PublishResult.PublishResultType 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
public Object 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
public PubAckPacket 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.
-
-