Class PlccomMqttPublishMessage


  • public final class PlccomMqttPublishMessage
    extends Object
    MQTT publish message.
    • Method Detail

      • getTopic

        public String getTopic()
        Returns the publish topic.
        Returns:
        MQTT topic name
      • getPayload

        public byte[] getPayload()
        Returns a defensive copy of the payload.
        Returns:
        publish payload, never null
      • getQualityOfService

        public PlccomMqttQualityOfService getQualityOfService()
        Returns the requested publish QoS.
        Returns:
        QoS level used for the outgoing publish
      • isRetain

        public boolean isRetain()
        Returns whether the broker should retain the publish.
        Returns:
        true when the MQTT retain flag is set
      • getPayloadFormatUtf8

        public Boolean getPayloadFormatUtf8()
        Returns the MQTT 5 Payload Format Indicator property.

        A value of Boolean.TRUE means the sender declared the payload to be UTF-8 encoded character data. A value of Boolean.FALSE means the sender declared the payload to be unspecified binary data. null means the property was not present and receivers should apply their normal application rules.

        Returns:
        payload format hint, or null when none was set
      • getContentType

        public String getContentType()
        Returns the MQTT 5 content type property.
        Returns:
        content type, or null when none was set
      • getMessageExpiryIntervalSeconds

        public Long getMessageExpiryIntervalSeconds()
        Returns the MQTT 5 message expiry interval.
        Returns:
        expiry interval in seconds, or null when the broker should use its default behavior
      • getResponseTopic

        public String getResponseTopic()
        Returns the MQTT 5 response topic property.
        Returns:
        response topic, or null when none was set
      • getCorrelationData

        public byte[] getCorrelationData()
        Returns a defensive copy of the MQTT 5 correlation data property.
        Returns:
        correlation data, or null when none was set
      • getUserProperties

        public List<PlccomMqttUserProperty> getUserProperties()
        Returns the MQTT 5 user properties.
        Returns:
        immutable list of user properties, never null
      • getSubscriptionIdentifiers

        public List<Integer> getSubscriptionIdentifiers()
        Returns MQTT 5 Subscription Identifiers carried by an inbound PUBLISH.

        A broker can include one or more identifiers when the PUBLISH matches subscriptions that were created with MQTT 5 Subscription Identifiers. The list is empty when no identifier was present. The client-side PUBLISH encoder does not send these values because MQTT 5 only allows this property on server-to-client PUBLISH packets.

        Returns:
        immutable list of Subscription Identifiers, never null