Enum Class ConnectionState

java.lang.Object
java.lang.Enum<ConnectionState>
com.lucimber.dbus.connection.ConnectionState
All Implemented Interfaces:
Serializable, Comparable<ConnectionState>, Constable

public enum ConnectionState extends Enum<ConnectionState>
Represents the current state of a D-Bus connection.

The connection progresses through these states during its lifecycle:

  • Enum Constant Details

    • DISCONNECTED

      public static final ConnectionState DISCONNECTED
      No connection is established. This is the initial state.
    • CONNECTING

      public static final ConnectionState CONNECTING
      Connection establishment is in progress (socket connection, channel setup).
    • AUTHENTICATING

      public static final ConnectionState AUTHENTICATING
      Socket is connected but SASL authentication is in progress.
    • CONNECTED

      public static final ConnectionState CONNECTED
      Connection is fully established and operational. D-Bus name has been acquired and the connection is ready for use.
    • UNHEALTHY

      public static final ConnectionState UNHEALTHY
      Connection exists but health checks are failing. The connection may still work but is considered unreliable.
    • RECONNECTING

      public static final ConnectionState RECONNECTING
      Connection was lost and automatic reconnection is in progress.
    • FAILED

      public static final ConnectionState FAILED
      Connection failed permanently and cannot be recovered. Manual intervention or configuration changes may be required.
  • Method Details

    • values

      public static ConnectionState[] 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

      public static ConnectionState valueOf(String name)
      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 name
      NullPointerException - 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