Enum Class ReasonCode
- All Implemented Interfaces:
Serializable, Comparable<ReasonCode>, Constable
MQTT 5.0 reason codes shared by acknowledgements, disconnection, and authentication.
Each distinct wire value has one constant. In particular, SUCCESS represents 0x00:
Success in acknowledgements and AUTH, Normal disconnection in DISCONNECT, and Granted
QoS 0 in SUBACK. The packet determines which meaning applies.
A value defined here is not necessarily valid for every packet type. An MQTT 3.1.1 connection reports its return codes as the corresponding values here.
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionAn administrative decision causes disconnection.The authentication method is unsupported or inconsistent with the exchange.The server rejects the supplied user name or password.The server has banned the client.The server rejects the client identifier.The rate of new connections exceeds the server's limit.Authentication requires another exchange.The client requests disconnection and publication of its Will.The subscription is accepted with a maximum QoS of 1.The subscription is accepted with a maximum QoS of 2.The implementation declines an otherwise valid packet.The server received no packet within the permitted keep-alive interval.The packet cannot be parsed according to the protocol's format.The connection has reached the server's permitted lifetime.The publication rate exceeds the receiver's capacity or policy.The publication is accepted but has no matching subscribers.Unsubscription completed without finding a matching subscription.The operation is not permitted for this client.The packet identifier is already assigned to an unfinished exchange.The receiver has no exchange for the packet identifier.The packet exceeds the receiver's permitted size.The payload does not conform to its declared format.The packet violates a protocol rule or the expected exchange sequence.The requested QoS exceeds what the server supports.A resource or administrative quota has been exhausted.The client starts authentication again on an existing connection.Too many QoS 1 or 2 publications are awaiting acknowledgement.The server does not support retained publications.The server cannot currently accept work because it is busy.The server has moved to a different address.The server is closing the connection as part of its shutdown.The server cannot currently accept a connection.Another connection using the same client identifier has replaced this connection.The server does not support shared subscriptions.The server does not support subscription identifiers.Success, normal disconnection, or granted QoS 0, depending on the packet.The topic alias is zero or exceeds the negotiated maximum.The receiver does not accept the topic filter.The receiver does not accept the topic name.The operation failed without a more specific reason.The server does not support the requested MQTT version.The client should try a different server.The server does not support wildcard subscriptions. -
Method Summary
Modifier and TypeMethodDescriptionstatic ReasonCodeof(int value) Resolves an unsigned MQTT 5.0 wire value to its reason code.intvalue()Returns the unsigned byte value used by MQTT 5.0 on the wire.static ReasonCodeReturns the enum constant of this class with the specified name.static ReasonCode[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
SUCCESS
Success, normal disconnection, or granted QoS 0, depending on the packet. -
GRANTED_QOS_1
The subscription is accepted with a maximum QoS of 1. -
GRANTED_QOS_2
The subscription is accepted with a maximum QoS of 2. -
DISCONNECT_WITH_WILL_MESSAGE
The client requests disconnection and publication of its Will. -
NO_MATCHING_SUBSCRIBERS
The publication is accepted but has no matching subscribers. -
NO_SUBSCRIPTION_EXISTED
Unsubscription completed without finding a matching subscription. -
CONTINUE_AUTHENTICATION
Authentication requires another exchange. -
RE_AUTHENTICATE
The client starts authentication again on an existing connection. -
UNSPECIFIED_ERROR
The operation failed without a more specific reason. -
MALFORMED_PACKET
The packet cannot be parsed according to the protocol's format. -
PROTOCOL_ERROR
The packet violates a protocol rule or the expected exchange sequence. -
IMPLEMENTATION_SPECIFIC_ERROR
The implementation declines an otherwise valid packet. -
UNSUPPORTED_PROTOCOL_VERSION
The server does not support the requested MQTT version. -
CLIENT_IDENTIFIER_NOT_VALID
The server rejects the client identifier. -
BAD_USER_NAME_OR_PASSWORD
The server rejects the supplied user name or password. -
NOT_AUTHORIZED
The operation is not permitted for this client. -
SERVER_UNAVAILABLE
The server cannot currently accept a connection. -
SERVER_BUSY
The server cannot currently accept work because it is busy. -
BANNED
The server has banned the client. -
SERVER_SHUTTING_DOWN
The server is closing the connection as part of its shutdown. -
BAD_AUTHENTICATION_METHOD
The authentication method is unsupported or inconsistent with the exchange. -
KEEP_ALIVE_TIMEOUT
The server received no packet within the permitted keep-alive interval. -
SESSION_TAKEN_OVER
Another connection using the same client identifier has replaced this connection. -
TOPIC_FILTER_INVALID
The receiver does not accept the topic filter. -
TOPIC_NAME_INVALID
The receiver does not accept the topic name. -
PACKET_IDENTIFIER_IN_USE
The packet identifier is already assigned to an unfinished exchange. -
PACKET_IDENTIFIER_NOT_FOUND
The receiver has no exchange for the packet identifier. -
RECEIVE_MAXIMUM_EXCEEDED
Too many QoS 1 or 2 publications are awaiting acknowledgement. -
TOPIC_ALIAS_INVALID
The topic alias is zero or exceeds the negotiated maximum. -
PACKET_TOO_LARGE
The packet exceeds the receiver's permitted size. -
MESSAGE_RATE_TOO_HIGH
The publication rate exceeds the receiver's capacity or policy. -
QUOTA_EXCEEDED
A resource or administrative quota has been exhausted. -
ADMINISTRATIVE_ACTION
An administrative decision causes disconnection. -
PAYLOAD_FORMAT_INVALID
The payload does not conform to its declared format. -
RETAIN_NOT_SUPPORTED
The server does not support retained publications. -
QOS_NOT_SUPPORTED
The requested QoS exceeds what the server supports. -
USE_ANOTHER_SERVER
The client should try a different server. -
SERVER_MOVED
The server has moved to a different address. -
SHARED_SUBSCRIPTIONS_NOT_SUPPORTED
The server does not support shared subscriptions. -
CONNECTION_RATE_EXCEEDED
The rate of new connections exceeds the server's limit. -
MAXIMUM_CONNECT_TIME
The connection has reached the server's permitted lifetime. -
SUBSCRIPTION_IDENTIFIERS_NOT_SUPPORTED
The server does not support subscription identifiers. -
WILDCARD_SUBSCRIPTIONS_NOT_SUPPORTED
The server does not support wildcard subscriptions.
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
value
public int value()Returns the unsigned byte value used by MQTT 5.0 on the wire.- Returns:
- the unsigned byte value used by MQTT 5.0 on the wire
-
of
Resolves an unsigned MQTT 5.0 wire value to its reason code.
Zero always resolves to SUCCESS, including for DISCONNECT and SUBACK. The caller must separately check whether the code is permitted for the packet being decoded.
- Parameters:
value- the unsigned byte value, represented as anint- Returns:
the reason code for that value- Throws:
IllegalArgumentException-if `value` is outside 0 to 255 or is undefined
-