Package com.lucimber.dbus.connection
Class ConnectionEvent
java.lang.Object
com.lucimber.dbus.connection.ConnectionEvent
Represents a connection lifecycle event.
Connection events are fired when the connection state changes, health checks succeed or fail, or other significant connection-related events occur.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
Builder for creatingConnectionEvent
instances. -
Method Summary
Modifier and TypeMethodDescriptionstatic ConnectionEvent.Builder
builder
(ConnectionEventType type) Creates a new builder for constructing connection events.getCause()
getType()
static ConnectionEvent
healthCheckFailure
(Throwable cause) Creates a health check failure event.static ConnectionEvent
Creates a health check success event.static ConnectionEvent
reconnectionAttempt
(int attemptNumber) Creates a reconnection attempt event.static ConnectionEvent
stateChanged
(ConnectionState oldState, ConnectionState newState) Creates a state change event.toString()
-
Method Details
-
builder
Creates a new builder for constructing connection events.- Parameters:
type
- The type of event- Returns:
- A new builder instance
-
stateChanged
Creates a state change event.- Parameters:
oldState
- The previous connection statenewState
- The new connection state- Returns:
- A state change event
-
healthCheckSuccess
Creates a health check success event.- Returns:
- A health check success event
-
healthCheckFailure
Creates a health check failure event.- Parameters:
cause
- The cause of the health check failure- Returns:
- A health check failure event
-
reconnectionAttempt
Creates a reconnection attempt event.- Parameters:
attemptNumber
- The reconnection attempt number- Returns:
- A reconnection attempt event
-
getType
-
getOldState
-
getNewState
-
getTimestamp
-
getMessage
-
getCause
-
toString
-