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 classBuilder for creatingConnectionEventinstances. -
Method Summary
Modifier and TypeMethodDescriptionstatic ConnectionEvent.Builderbuilder(ConnectionEventType type) Creates a new builder for constructing connection events.getCause()getType()static ConnectionEventhealthCheckFailure(Throwable cause) Creates a health check failure event.static ConnectionEventCreates a health check success event.static ConnectionEventreconnectionAttempt(int attemptNumber) Creates a reconnection attempt event.static ConnectionEventstateChanged(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
-