Class PublishPacket


  • public class PublishPacket
    extends java.lang.Object
    Data model of an MQTT5 PUBLISH packet
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getContentType()
      Returns a property specifying the content type of the payload.
      byte[] getCorrelationData()
      Returns a opaque binary data used to correlate between publish messages, as a potential method for request-response implementation.
      java.lang.Long getMessageExpiryIntervalSeconds()
      Sent publishes - Returns the maximum amount of time allowed to elapse for message delivery before the server should instead delete the message (relative to a recipient).
      byte[] getPayload()
      Returns the payload of the publish message.
      PublishPacket.PayloadFormatIndicator getPayloadFormat()
      Returns the property specifying the format of the payload data.
      QOS getQOS()
      Sent publishes - Returns the MQTT quality of service level this message should be delivered with.
      java.lang.String getResponseTopic()
      Returns a opaque topic string intended to assist with request/response implementations.
      java.lang.Boolean getRetain()
      Returns true if this is a retained message, false otherwise.
      java.util.List<java.lang.Long> getSubscriptionIdentifiers()
      Sent publishes - Ignored Received publishes - Returns the subscription identifiers of all the subscriptions this message matched.
      java.lang.String getTopic()
      Sent publishes - Returns the topic this message should be published to.
      java.lang.Long getTopicAlias()
      Sent publishes - topic alias to use, if possible, when encoding this packet.
      java.util.List<UserProperty> getUserProperties()
      Returns a list of MQTT5 user properties included with the packet.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getPayload

        public byte[] getPayload()
        Returns the payload of the publish message. See MQTT5 Publish Payload
        Returns:
        The payload of the publish message.
      • getQOS

        public QOS getQOS()
        Sent publishes - Returns the MQTT quality of service level this message should be delivered with. Received publishes - Returns 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.
      • getRetain

        public java.lang.Boolean getRetain()
        Returns true if this is a retained message, false otherwise. Always set on received publishes; on sent publishes, null implies false. See MQTT5 Retain
        Returns:
        True if this is a retained message, false otherwise.
      • getTopic

        public java.lang.String getTopic()
        Sent publishes - Returns the topic this message should be published to. Received publishes - Returns the topic this message was published to. See MQTT5 Topic Name
        Returns:
        The topic associated with this PUBLISH packet.
      • getMessageExpiryIntervalSeconds

        public java.lang.Long getMessageExpiryIntervalSeconds()
        Sent publishes - Returns 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 - Returns 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 PublishPacket.
      • getTopicAlias

        public java.lang.Long getTopicAlias()
        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 associated with this PublishPacket.
      • getResponseTopic

        public java.lang.String getResponseTopic()
        Returns a opaque topic string intended to assist with request/response implementations. Not internally meaningful to MQTT5 or this client. See MQTT5 Response Topic
        Returns:
        Opaque topic string intended to assist with request/response implementations.
      • getCorrelationData

        public byte[] getCorrelationData()
        Returns a 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:
        Opaque binary data used to correlate between publish messages.
      • getContentType

        public java.lang.String getContentType()
        Returns a property specifying the content type of the payload. Not internally meaningful to MQTT5. See MQTT5 Content Type
        Returns:
        Property specifying the content type of the payload.
      • getUserProperties

        public java.util.List<UserProperty> getUserProperties()
        Returns a list of MQTT5 user properties included with the packet. See MQTT5 User Property
        Returns:
        List of MQTT5 user properties included with the packet.
      • getSubscriptionIdentifiers

        public java.util.List<java.lang.Long> getSubscriptionIdentifiers()
        Sent publishes - Ignored Received publishes - Returns 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.