Package com.lucimber.dbus.connection
Enum Class ConnectionState
- All Implemented Interfaces:
Serializable
,Comparable<ConnectionState>
,Constable
Represents the current state of a D-Bus connection.
The connection progresses through these states during its lifecycle:
DISCONNECTED
- Initial state, no connection establishedCONNECTING
- Connection attempt in progressAUTHENTICATING
- SASL authentication in progressCONNECTED
- Connected and operationalUNHEALTHY
- Connected but health checks are failingRECONNECTING
- Attempting to reconnect after failureFAILED
- Connection failed and cannot be recovered
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionSocket is connected but SASL authentication is in progress.Connection is fully established and operational.Connection establishment is in progress (socket connection, channel setup).No connection is established.Connection failed permanently and cannot be recovered.Connection was lost and automatic reconnection is in progress.Connection exists but health checks are failing. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Checks if the connection is in a state where it can handle requests.boolean
isFailed()
Checks if the connection is in a final failure state.boolean
Checks if the connection is attempting to establish or re-establish connectivity.static ConnectionState
Returns the enum constant of this class with the specified name.static ConnectionState[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
DISCONNECTED
No connection is established. This is the initial state. -
CONNECTING
Connection establishment is in progress (socket connection, channel setup). -
AUTHENTICATING
Socket is connected but SASL authentication is in progress. -
CONNECTED
Connection is fully established and operational. D-Bus name has been acquired and the connection is ready for use. -
UNHEALTHY
Connection exists but health checks are failing. The connection may still work but is considered unreliable. -
RECONNECTING
Connection was lost and automatic reconnection is in progress. -
FAILED
Connection failed permanently and cannot be recovered. Manual intervention or configuration changes may be required.
-
-
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
-
canHandleRequests
public boolean canHandleRequests()Checks if the connection is in a state where it can handle requests.- Returns:
- true if the connection can handle D-Bus requests
-
isTransitioning
public boolean isTransitioning()Checks if the connection is attempting to establish or re-establish connectivity.- Returns:
- true if the connection is in a transitional state
-
isFailed
public boolean isFailed()Checks if the connection is in a final failure state.- Returns:
- true if the connection has failed permanently
-