Enum Class Mqtt5DisconnectReasonCode

java.lang.Object
java.lang.Enum<Mqtt5DisconnectReasonCode>
com.hivemq.client.mqtt.mqtt5.message.disconnect.Mqtt5DisconnectReasonCode
All Implemented Interfaces:
Mqtt5ReasonCode, Serializable, Comparable<Mqtt5DisconnectReasonCode>, Constable

public enum Mqtt5DisconnectReasonCode extends Enum<Mqtt5DisconnectReasonCode> implements Mqtt5ReasonCode
Reason Code of an MQTT 5 Disconnect message.
Since:
1.0
  • Enum Constant Details

    • NORMAL_DISCONNECTION

      public static final Mqtt5DisconnectReasonCode NORMAL_DISCONNECTION
      Disconnect normally. The server must not publish the Will message.
    • DISCONNECT_WITH_WILL_MESSAGE

      public static final Mqtt5DisconnectReasonCode DISCONNECT_WITH_WILL_MESSAGE
      Disconnect normally. The server must also publish the Will message.
    • UNSPECIFIED_ERROR

      public static final Mqtt5DisconnectReasonCode UNSPECIFIED_ERROR
      The sender either does not want to reveal the reason for the disconnect or none of the other reason codes apply.
    • MALFORMED_PACKET

      public static final Mqtt5DisconnectReasonCode MALFORMED_PACKET
      A packet could not be parsed correctly according to the MQTT specification.
    • PROTOCOL_ERROR

      public static final Mqtt5DisconnectReasonCode PROTOCOL_ERROR
      A packet contained data that is not allowed by the MQTT protocol or is inconsistent with the state of the receiver.
    • IMPLEMENTATION_SPECIFIC_ERROR

      public static final Mqtt5DisconnectReasonCode IMPLEMENTATION_SPECIFIC_ERROR
      A packet is valid but can not be processed by the implementation of the receiver.
    • NOT_AUTHORIZED

      public static final Mqtt5DisconnectReasonCode NOT_AUTHORIZED
      The client is not authorized to perform a request.
    • SERVER_BUSY

      public static final Mqtt5DisconnectReasonCode SERVER_BUSY
      The server is busy and can not continue processing requests from the client.
    • SERVER_SHUTTING_DOWN

      public static final Mqtt5DisconnectReasonCode SERVER_SHUTTING_DOWN
      The server is shutting down.
    • BAD_AUTHENTICATION_METHOD

      public static final Mqtt5DisconnectReasonCode BAD_AUTHENTICATION_METHOD
      The authentication method is not supported or does not match the authentication method currently in use.
    • KEEP_ALIVE_TIMEOUT

      public static final Mqtt5DisconnectReasonCode KEEP_ALIVE_TIMEOUT
      The connection is closed because no packet has been received for 1.5 times the keep alive time.
    • SESSION_TAKEN_OVER

      public static final Mqtt5DisconnectReasonCode SESSION_TAKEN_OVER
      Another client using the same client identifier has connected.
    • TOPIC_FILTER_INVALID

      public static final Mqtt5DisconnectReasonCode TOPIC_FILTER_INVALID
      A packet contained a topic filter that is formed correctly but is not accepted by the server.
    • TOPIC_NAME_INVALID

      public static final Mqtt5DisconnectReasonCode TOPIC_NAME_INVALID
      A packet contained a topic name that is formed correctly but is not accepted by the receiver.
    • RECEIVE_MAXIMUM_EXCEEDED

      public static final Mqtt5DisconnectReasonCode RECEIVE_MAXIMUM_EXCEEDED
      The receiver has received more publications for which it has not sent PUBACK or PUBCOMP than allowed by the receive maximum it sent in the CONNECT or CONNACK packet.
    • TOPIC_ALIAS_INVALID

      public static final Mqtt5DisconnectReasonCode TOPIC_ALIAS_INVALID
      The receiver has received a PUBLISH packet containing a topic alias which is greater than the maximum topic alias it sent in the CONNECT or CONNACK packet.
    • PACKET_TOO_LARGE

      public static final Mqtt5DisconnectReasonCode PACKET_TOO_LARGE
      The receiver has received a packet with a greater size than allowed by the maximum packet size it sent in the CONNECT or CONNACK packet.
    • MESSAGE_RATE_TOO_HIGH

      public static final Mqtt5DisconnectReasonCode MESSAGE_RATE_TOO_HIGH
      The received data rate is too high.
    • QUOTA_EXCEEDED

      public static final Mqtt5DisconnectReasonCode QUOTA_EXCEEDED
      An implementation or administrative imposed limit has been exceeded.
    • ADMINISTRATIVE_ACTION

      public static final Mqtt5DisconnectReasonCode ADMINISTRATIVE_ACTION
      The connection is closed due to an administrative action.
    • PAYLOAD_FORMAT_INVALID

      public static final Mqtt5DisconnectReasonCode PAYLOAD_FORMAT_INVALID
      A payload does not match the specified payload format indicator.
    • RETAIN_NOT_SUPPORTED

      public static final Mqtt5DisconnectReasonCode RETAIN_NOT_SUPPORTED
      The server does not support retained messages.
    • QOS_NOT_SUPPORTED

      public static final Mqtt5DisconnectReasonCode QOS_NOT_SUPPORTED
      The client specified a QoS greater than the maximum QoS the server sent in the CONNACK packet.
    • USE_ANOTHER_SERVER

      public static final Mqtt5DisconnectReasonCode USE_ANOTHER_SERVER
      The client should temporarily use another server.
    • SERVER_MOVED

      public static final Mqtt5DisconnectReasonCode SERVER_MOVED
      The client should permanently use another server.
    • SHARED_SUBSCRIPTIONS_NOT_SUPPORTED

      public static final Mqtt5DisconnectReasonCode SHARED_SUBSCRIPTIONS_NOT_SUPPORTED
      The server does not support shared subscriptions.
    • CONNECTION_RATE_EXCEEDED

      public static final Mqtt5DisconnectReasonCode CONNECTION_RATE_EXCEEDED
      The connection is closed because the connection rate is too high.
    • MAXIMUM_CONNECT_TIME

      public static final Mqtt5DisconnectReasonCode MAXIMUM_CONNECT_TIME
      The maximum connection time authorized for this connection has been exceeded.
    • SUBSCRIPTION_IDENTIFIERS_NOT_SUPPORTED

      public static final Mqtt5DisconnectReasonCode SUBSCRIPTION_IDENTIFIERS_NOT_SUPPORTED
      The server does not support subscription identifiers.
    • WILDCARD_SUBSCRIPTIONS_NOT_SUPPORTED

      public static final Mqtt5DisconnectReasonCode WILDCARD_SUBSCRIPTIONS_NOT_SUPPORTED
      The server does not support wildcard subscriptions.
  • Method Details

    • values

      public static Mqtt5DisconnectReasonCode[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Mqtt5DisconnectReasonCode valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getCode

      public int getCode()
      Specified by:
      getCode in interface Mqtt5ReasonCode
      Returns:
      the byte code of this Reason Code.
    • fromCode

      @Nullable public static @Nullable Mqtt5DisconnectReasonCode fromCode(int code)
      Returns the Disconnect Reason Code belonging to the given byte code.
      Parameters:
      code - the byte code.
      Returns:
      the Disconnect Reason Code belonging to the given byte code or null if the byte code is not a valid Disconnect Reason Code.
    • canBeSentByServer

      public boolean canBeSentByServer()
      Specified by:
      canBeSentByServer in interface Mqtt5ReasonCode
      Returns:
      whether this Reason Code can be sent by the server according to the MQTT 5 specification.
    • canBeSentByClient

      public boolean canBeSentByClient()
      Specified by:
      canBeSentByClient in interface Mqtt5ReasonCode
      Returns:
      whether this Reason Code can be sent by the client according to the MQTT 5 specification.
    • canBeSetByUser

      public boolean canBeSetByUser()
      Specified by:
      canBeSetByUser in interface Mqtt5ReasonCode
      Returns:
      whether this Reason Code can be set by the user.