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. 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.
  • 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 either getData() to get the data and cast it, or call getResult[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.