Class DbConnectivityDiagnostics

java.lang.Object
com.tbg.wms.db.DbConnectivityDiagnostics

public final class DbConnectivityDiagnostics extends Object
Diagnostic information returned by database connectivity tests.

Provides detailed metrics and status information about the database connection pool and the database itself.

  • 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 succeeded
      durationMs - duration of the connection test in milliseconds
      activeConnections - number of active connections in the pool
      idleConnections - number of idle connections in the pool
      databaseVersion - database version string from metadata
      errorMessage - 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

      public String databaseVersion()
      Gets the database version string from metadata.
      Returns:
      database version string, or null if not available
    • errorMessage

      public String errorMessage()
      Gets the error message from a failed connection test.
      Returns:
      error message, or null if connection succeeded
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object