Package com.hivemq.client.mqtt
Enum Class MqttClientState
- All Implemented Interfaces:
Serializable,Comparable<MqttClientState>,Constable
State of an
MqttClient.
+--------------+ +------------------------+
| DISCONNECTED <-+ +-> DISCONNECTED_RECONNECT |
+-------+------+ \ / +-----------+------------+
| \ / |
| \ / |
+-------v------+ \ / +-----------v------------+
| CONNECTING +------x------+ CONNECTING_RECONNECT |
+-------+------+ | +-----------+------------+
| | |
| | |
| +------+------+ |
+------> CONNECTED <-----------+
+-------------+
- Since:
- 1.0
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe client is connected.The client is connecting.The client is reconnecting.The client is disconnected.The client is disconnected but will reconnect. -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanstatic MqttClientStateReturns the enum constant of this class with the specified name.static MqttClientState[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
DISCONNECTED
The client is disconnected. -
CONNECTING
The client is connecting.This means the client was
DISCONNECTED, a Connect message is sent, but the ConnAck message is not received yet. -
CONNECTED
The client is connected. -
DISCONNECTED_RECONNECT
The client is disconnected but will reconnect. -
CONNECTING_RECONNECT
The client is reconnecting.This means the client was
DISCONNECTED_RECONNECT, a Connect message is sent, but the ConnAck message is not received yet.
-
-
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
-
isConnected
public boolean isConnected()- Returns:
- whether the client is connected.
-
isConnectedOrReconnect
public boolean isConnectedOrReconnect()- Returns:
- whether the client is connected or will reconnect.
-