Interface DatabaseConnectionStateService
-
- All Known Implementing Classes:
DefaultDatabaseConnectionStateService
public interface DatabaseConnectionStateService
Service providing information about current database connection state.- Since:
- 8.1.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
DatabaseConnectionStateService.DatabaseConnectionState
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Optional<Duration>
getLatency()
Returns database latency, the result might be cached for optimization reasons.DatabaseConnectionStateService.DatabaseConnectionState
getState()
Returns database connection state, the result might be cached for optimization reasons.
-
-
-
Method Detail
-
getLatency
Optional<Duration> getLatency()
Returns database latency, the result might be cached for optimization reasons.- Returns:
- database latency when database can be reached, empty optional otherwise
-
getState
DatabaseConnectionStateService.DatabaseConnectionState getState()
Returns database connection state, the result might be cached for optimization reasons.- Returns:
DatabaseConnectionStateService.DatabaseConnectionState.CONNECTED
when database can be reached,DatabaseConnectionStateService.DatabaseConnectionState.DISCONNECTED
otherwise
-
-