Package com.tbg.wms.db
Class DbConnectivityDiagnostics
java.lang.Object
com.tbg.wms.db.DbConnectivityDiagnostics
Diagnostic information returned by database connectivity tests.
Provides detailed metrics and status information about the database connection pool and the database itself.
-
Constructor Summary
ConstructorsConstructorDescriptionDbConnectivityDiagnostics(boolean isConnected, long durationMs, int activeConnections, int idleConnections, String databaseVersion, String errorMessage) Creates a new connectivity diagnostic record. -
Method Summary
Modifier and TypeMethodDescriptionintGets the number of active connections in the pool.Gets the database version string from metadata.longGets the duration of the connection test in milliseconds.booleanGets the error message from a failed connection test.inthashCode()intGets the number of idle connections in the pool.booleanGets whether the connection test succeeded.toString()
-
Constructor Details
-
DbConnectivityDiagnostics
public DbConnectivityDiagnostics(boolean isConnected, long durationMs, int activeConnections, int idleConnections, String databaseVersion, String errorMessage) Creates a new connectivity diagnostic record.- Parameters:
isConnected- whether the connection test succeededdurationMs- duration of the connection test in millisecondsactiveConnections- number of active connections in the poolidleConnections- number of idle connections in the pooldatabaseVersion- database version string from metadataerrorMessage- error message if connection failed, null if successful
-
-
Method Details
-
isConnected
public boolean isConnected()Gets whether the connection test succeeded.- Returns:
- true if connected successfully, false otherwise
-
durationMs
public long durationMs()Gets the duration of the connection test in milliseconds.- Returns:
- duration in milliseconds
-
activeConnections
public int activeConnections()Gets the number of active connections in the pool.- Returns:
- number of active connections
-
idleConnections
public int idleConnections()Gets the number of idle connections in the pool.- Returns:
- number of idle connections
-
databaseVersion
Gets the database version string from metadata.- Returns:
- database version string, or null if not available
-
errorMessage
Gets the error message from a failed connection test.- Returns:
- error message, or null if connection succeeded
-
equals
-
hashCode
public int hashCode() -
toString
-