public enum MqttClientState extends Enum<MqttClientState>
MqttClient.
+--------------+ +------------------------+
| DISCONNECTED <-+ +-> DISCONNECTED_RECONNECT |
+-------+------+ \ / +-----------+------------+
| \ / |
| \ / |
+-------v------+ \ / +-----------v------------+
| CONNECTING +------x------+ CONNECTING_RECONNECT |
+-------+------+ | +-----------+------------+
| | |
| | |
| +------+------+ |
+------> CONNECTED <-----------+
+-------------+
| Enum Constant and Description |
|---|
CONNECTED
The client is connected.
|
CONNECTING
The client is connecting.
|
CONNECTING_RECONNECT
The client is reconnecting.
|
DISCONNECTED
The client is disconnected.
|
DISCONNECTED_RECONNECT
The client is disconnected but will reconnect.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
isConnected() |
boolean |
isConnectedOrReconnect() |
static MqttClientState |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static MqttClientState[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final MqttClientState DISCONNECTED
public static final MqttClientState CONNECTING
This means the client was DISCONNECTED, a Connect message is sent, but the ConnAck message is not
received yet.
public static final MqttClientState CONNECTED
public static final MqttClientState DISCONNECTED_RECONNECT
public static final MqttClientState CONNECTING_RECONNECT
This means the client was DISCONNECTED_RECONNECT, a Connect message is sent, but the ConnAck message is
not received yet.
public static MqttClientState[] values()
for (MqttClientState c : MqttClientState.values()) System.out.println(c);
public static MqttClientState valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic boolean isConnected()
public boolean isConnectedOrReconnect()