public class MqttException
extends java.lang.Exception
Modifier and Type | Field and Description |
---|---|
static short |
REASON_CODE_BROKER_UNAVAILABLE
The broker was not available to handle the request.
|
static short |
REASON_CODE_CLIENT_ALREADY_DISCONNECTED
The client is already disconnected.
|
static short |
REASON_CODE_CLIENT_CLOSED
The client is closed - no operations are permitted on the client in this
state.
|
static short |
REASON_CODE_CLIENT_CONNECTED
The client is already connected.
|
static short |
REASON_CODE_CLIENT_DISCONNECT_PROHIBITED
Thrown when an attempt to call
MqttClient.disconnect() has been
made from within a method on MqttCallback . |
static short |
REASON_CODE_CLIENT_DISCONNECTING
The client is currently disconnecting and cannot accept any new work.
|
static short |
REASON_CODE_CLIENT_EXCEPTION
Client encountered an exception.
|
static short |
REASON_CODE_CLIENT_NOT_CONNECTED
The client is not connected to the server.
|
static short |
REASON_CODE_CLIENT_TIMEOUT
Client timed out while waiting for a response from the server.
|
static short |
REASON_CODE_CONNECT_IN_PROGRESS
A connect operation in already in progress, only one connect can happen
at a time.
|
static short |
REASON_CODE_CONNECTION_LOST
The client has been unexpectedly disconnected from the server.
|
static short |
REASON_CODE_DISCONNECTED_BUFFER_FULL
The Client has attempted to publish a message whilst in the 'resting' / offline
state with Disconnected Publishing enabled, however the buffer is full and
deleteOldestMessages is disabled, therefore no more messages can be published
until the client reconnects, or the application deletes buffered message
manually.
|
static short |
REASON_CODE_FAILED_AUTHENTICATION
Authentication with the server has failed, due to a bad user name or password.
|
static short |
REASON_CODE_INVALID_CLIENT_ID
The server has rejected the supplied client ID
|
static short |
REASON_CODE_INVALID_MESSAGE
Protocol error: the message was not recognized as a valid MQTT packet.
|
static short |
REASON_CODE_INVALID_PROTOCOL_VERSION
The protocol version requested is not supported by the server.
|
static short |
REASON_CODE_MAX_INFLIGHT
A request has been made to send a message but the maximum number of inflight
messages has already been reached.
|
static short |
REASON_CODE_NO_MESSAGE_IDS_AVAILABLE
Internal error, caused by no new message IDs being available.
|
static short |
REASON_CODE_NOT_AUTHORIZED
Not authorized to perform the requested operation
|
static short |
REASON_CODE_SERVER_CONNECT_ERROR
Unable to connect to server
|
static short |
REASON_CODE_SOCKET_FACTORY_MISMATCH
Server URI and supplied
SocketFactory do not match. |
static short |
REASON_CODE_SSL_CONFIG_ERROR
SSL configuration error.
|
static short |
REASON_CODE_SUBSCRIBE_FAILED
Error from subscribe - returned from the server.
|
static short |
REASON_CODE_TOKEN_INUSE
A request has been made to use a token that is already associated with
another action.
|
static short |
REASON_CODE_UNEXPECTED_ERROR
An unexpected error has occurred.
|
static short |
REASON_CODE_WRITE_TIMEOUT
Client timed out while waiting to write messages to the server.
|
Constructor and Description |
---|
MqttException(int reasonCode)
Constructs a new
MqttException with the specified code
as the underlying reason. |
MqttException(int reason,
java.lang.Throwable cause)
Constructs a new
MqttException with the specified
Throwable as the underlying reason. |
MqttException(java.lang.Throwable cause)
Constructs a new
MqttException with the specified
Throwable as the underlying reason. |
Modifier and Type | Method and Description |
---|---|
java.lang.Throwable |
getCause()
Returns the underlying cause of this exception, if available.
|
java.lang.String |
getMessage()
Returns the detail message for this exception.
|
int |
getReasonCode()
Returns the reason code for this exception.
|
java.lang.String |
toString()
Returns a
String representation of this exception. |
public static final short REASON_CODE_CLIENT_EXCEPTION
getCause()
method to get the underlying reason.public static final short REASON_CODE_INVALID_PROTOCOL_VERSION
public static final short REASON_CODE_INVALID_CLIENT_ID
public static final short REASON_CODE_BROKER_UNAVAILABLE
public static final short REASON_CODE_FAILED_AUTHENTICATION
public static final short REASON_CODE_NOT_AUTHORIZED
public static final short REASON_CODE_UNEXPECTED_ERROR
public static final short REASON_CODE_SUBSCRIBE_FAILED
public static final short REASON_CODE_CLIENT_TIMEOUT
public static final short REASON_CODE_NO_MESSAGE_IDS_AVAILABLE
public static final short REASON_CODE_WRITE_TIMEOUT
public static final short REASON_CODE_CLIENT_CONNECTED
public static final short REASON_CODE_CLIENT_ALREADY_DISCONNECTED
public static final short REASON_CODE_CLIENT_DISCONNECTING
public static final short REASON_CODE_SERVER_CONNECT_ERROR
public static final short REASON_CODE_CLIENT_NOT_CONNECTED
MqttClient.connect()
or MqttClient.connect(MqttConnectOptions)
method must be called
first. It is also possible that the connection was lost - see
MqttClient.setCallback(MqttCallback)
for a way to track lost
connections.public static final short REASON_CODE_SOCKET_FACTORY_MISMATCH
SocketFactory
do not match.
URIs beginning tcp://
must use a javax.net.SocketFactory
,
and URIs beginning ssl://
must use a javax.net.ssl.SSLSocketFactory
.public static final short REASON_CODE_SSL_CONFIG_ERROR
public static final short REASON_CODE_CLIENT_DISCONNECT_PROHIBITED
MqttClient.disconnect()
has been
made from within a method on MqttCallback
. These methods are invoked
by the client's thread, and must not be used to control disconnection.public static final short REASON_CODE_INVALID_MESSAGE
public static final short REASON_CODE_CONNECTION_LOST
cause
will provide more details.public static final short REASON_CODE_CONNECT_IN_PROGRESS
public static final short REASON_CODE_CLIENT_CLOSED
public static final short REASON_CODE_TOKEN_INUSE
public static final short REASON_CODE_MAX_INFLIGHT
public static final short REASON_CODE_DISCONNECTED_BUFFER_FULL
public MqttException(int reasonCode)
MqttException
with the specified code
as the underlying reason.reasonCode
- the reason code for the exception.public MqttException(java.lang.Throwable cause)
MqttException
with the specified
Throwable
as the underlying reason.cause
- the underlying cause of the exception.public MqttException(int reason, java.lang.Throwable cause)
MqttException
with the specified
Throwable
as the underlying reason.reason
- the reason code for the exception.cause
- the underlying cause of the exception.public int getReasonCode()
public java.lang.Throwable getCause()
getCause
in class java.lang.Throwable
null
.public java.lang.String getMessage()
getMessage
in class java.lang.Throwable
null
.public java.lang.String toString()
String
representation of this exception.toString
in class java.lang.Throwable
String
representation of this exception.