Interface ModifiableConnackPacket

    • Method Detail

      • setReasonString

        void setReasonString​(@Nullable String reasonString)
        Set the reason string.

        A reason must not be set for a successful connack.

        This setting is only respected for MQTT 5 clients. For MQTT 3.x clients this setting is ignored.

        Parameters:
        reasonString - The reason string to set.
        Throws:
        IllegalStateException - If reason code is ConnackReasonCode.SUCCESS.
        IllegalArgumentException - If the reason string is not a valid UTF-8 string.
        IllegalArgumentException - If the reason string exceeds the UTF-8 string length limit.
        Since:
        4.2.0, CE 2020.1
      • setResponseInformation

        void setResponseInformation​(@Nullable String responseInformation)
        Set the response information.

        This setting is only respected for MQTT 5 clients. For MQTT 3.x clients this setting is ignored.

        Parameters:
        responseInformation - The new response information for the CONNACK.
        Throws:
        IllegalArgumentException - If the response information is not a valid UTF-8 string.
        IllegalArgumentException - If the response information exceeds the UTF-8 string length limit.
        IllegalStateException - If the response information was not requested in the connect packet.
        Since:
        4.2.0, CE 2020.1
      • setServerReference

        void setServerReference​(@Nullable String serverReference)
        Set the server reference.

        This setting is only respected for MQTT 5 clients. For MQTT 3.x clients this setting is ignored.

        Parameters:
        serverReference - The new server reference for the CONNACK.
        Throws:
        IllegalArgumentException - If the server reference is not a valid UTF-8 string.
        IllegalArgumentException - If the server reference exceeds the UTF-8 string length limit.
        Since:
        4.2.0, CE 2020.1