Class DefaultDatabaseConnectionStateService
java.lang.Object
com.atlassian.confluence.internal.diagnostics.ipd.db.DefaultDatabaseConnectionStateService
- All Implemented Interfaces:
DatabaseConnectionStateService
public class DefaultDatabaseConnectionStateService
extends Object
implements DatabaseConnectionStateService
Stores cached database connection latency and state information.
- Since:
- 8.1.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.atlassian.confluence.internal.diagnostics.ipd.db.DatabaseConnectionStateService
DatabaseConnectionStateService.DatabaseConnectionState
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultDatabaseConnectionStateService
(DatabaseLatencyMeter databaseLatencyMeter) -
Method Summary
Modifier and TypeMethodDescriptionReturns database latency, the result might be cached for optimization reasons.getState()
Returns database connection state, the result might be cached for optimization reasons.
-
Constructor Details
-
DefaultDatabaseConnectionStateService
-
-
Method Details
-
getLatency
Description copied from interface:DatabaseConnectionStateService
Returns database latency, the result might be cached for optimization reasons.- Specified by:
getLatency
in interfaceDatabaseConnectionStateService
- Returns:
- database latency when database can be reached, empty optional otherwise
-
getState
Description copied from interface:DatabaseConnectionStateService
Returns database connection state, the result might be cached for optimization reasons.- Specified by:
getState
in interfaceDatabaseConnectionStateService
- Returns:
DatabaseConnectionStateService.DatabaseConnectionState.CONNECTED
when database can be reached,DatabaseConnectionStateService.DatabaseConnectionState.DISCONNECTED
otherwise
-