Class MqttBrokerDisconnectException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.mqtt4j.hato.MqttException
org.mqtt4j.hato.MqttBrokerDisconnectException
- All Implemented Interfaces:
Serializable
An MQTT 5.0 broker ended the connection with DISCONNECT. This is the cause in the
Disconnection of that connection, and pending operations fail with
MqttConnectionLostException that carries it as its cause. The reason code decides whether
the client reconnects; see ReconnectPolicy. With ReasonCode.USE_ANOTHER_SERVER or
ReasonCode.SERVER_MOVED, the broker can name another server in serverReference(). The
client does not follow it; an application that does creates a client for that server. MQTT
3.1.1 brokers close connections without DISCONNECT, so this exception appears only with
MQTT 5.0.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionMqttBrokerDisconnectException(ReasonCode reasonCode, @Nullable String reasonString, @Nullable String serverReference) A DISCONNECT from the broker, with the explanation and the server reference that it carried, if any. -
Method Summary
Modifier and TypeMethodDescriptionReturns the reason code of the broker's DISCONNECT.Returns the broker's explanation for people diagnosing the end, or empty when it sent none.Returns the server that the broker named for the client to use instead, or empty when it named none.Methods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
MqttBrokerDisconnectException
public MqttBrokerDisconnectException(ReasonCode reasonCode, @Nullable String reasonString, @Nullable String serverReference) A DISCONNECT from the broker, with the explanation and the server reference that it carried, if any.- Parameters:
reasonCode- the reason code of the broker's DISCONNECTreasonString- the broker's explanation, or null when it sent noneserverReference- the server that the broker named, or null when it named none
-
-
Method Details
-
reasonCode
Returns the reason code of the broker's DISCONNECT.- Returns:
- the reason code of the broker's DISCONNECT
-
reasonString
-
serverReference
-