Interface ModifiablePublishPacket

    • Method Detail

      • setQos

        void setQos​(@NotNull Qos qos)
        This does not change the QoS to the publisher. Only for onward delivery.
        Parameters:
        qos - The QoS for the onward publish to subscribers.
        Throws:
        NullPointerException - If qos is null.
        IllegalArgumentException - If qos is greater than the configured maximum.
        Since:
        4.0.0, CE 2019.1
      • setRetain

        void setRetain​(boolean retain)
        Sets the retain flag.
        Parameters:
        retain - The new retain flag for the publish.
        Throws:
        IllegalArgumentException - If set to true and retained messages are disabled by HiveMQ.
        Since:
        4.0.0, CE 2019.1
      • setPayloadFormatIndicator

        void setPayloadFormatIndicator​(@Nullable PayloadFormatIndicator payloadFormatIndicator)
        Sets the payload format indicator.
        Parameters:
        payloadFormatIndicator - The new payload format indicator for the publish.
        Since:
        4.0.0, CE 2019.1
      • setMessageExpiryInterval

        void setMessageExpiryInterval​(long messageExpiryInterval)
        Sets the message expiry interval.
        Parameters:
        messageExpiryInterval - The new message expiry interval for the publish.
        Throws:
        IllegalArgumentException - If the message expiry interval is less than zero or more than the configured maximum by HiveMQ.
        Since:
        4.0.0, CE 2019.1
      • setResponseTopic

        void setResponseTopic​(@Nullable String responseTopic)
        Sets the response topic.
        Parameters:
        responseTopic - The new response topic for the publish.
        Throws:
        IllegalArgumentException - If the response topic is not a valid UTF-8 string.
        IllegalArgumentException - If the response topic exceeds the UTF-8 string length limit.
        Since:
        4.0.0, CE 2019.1
      • setCorrelationData

        void setCorrelationData​(@Nullable ByteBuffer correlationData)
        Sets the correlation data.
        Parameters:
        correlationData - The new correlation data for the publish.
        Since:
        4.0.0, CE 2019.1
      • setContentType

        void setContentType​(@Nullable String contentType)
        Sets the content type.
        Parameters:
        contentType - The new content type for the publish.
        Throws:
        IllegalArgumentException - If the content type is not a valid UTF-8 string.
        IllegalArgumentException - If the content type exceeds the UTF-8 string length limit.
        Since:
        4.0.0, CE 2019.1
      • setPayload

        void setPayload​(@NotNull ByteBuffer payload)
        Sets the payload.
        Parameters:
        payload - The new payload for the publish.
        Throws:
        NullPointerException - If payload is null.
        Since:
        4.0.0, CE 2019.1