Class HealthCheck

java.lang.Object
com.aceql.jdbc.commons.HealthCheck

public class HealthCheck
extends Object
Allows testing if the remote AceQL servlet is accessible with a ping, and to check database access response time.
Since:
9.0
Author:
Nicolas de Pomereu
  • Constructor Details

    • HealthCheck

      public HealthCheck​(AceQLConnection connection)
      Default constructor
      Parameters:
      connection - the Connection to the the remote database
  • Method Details

    • ping

      public boolean ping()
      Allows to ping the AceQL server main servlet
      Returns:
      true if the the AceQL server main servlet is pingable, else false
    • getResponseTime

      public long getResponseTime() throws SQLException
      Gets the response time of a "select 1" called on the remote database defined by the underlying AceQLConnection
      Returns:
      the response time in milliseconds
      Throws:
      SQLException - if any SQL Exception occurs
    • getResponseTime

      public long getResponseTime​(String sql) throws SQLException
      Gets the response time of a SQL statement called on the remote database defined by the underlying AceQLConnection
      Parameters:
      sql - the SQL statement to call
      Returns:
      the response time in milliseconds
      Throws:
      SQLException - if any SQL Exception occurs
    • getServerMemoryInfo

      public ServerMemoryInfo getServerMemoryInfo() throws SQLException
      Gets health check memory info from server
      Returns:
      health check memory info from server
      Throws:
      SQLException - if any SQL Exception occurs
    • getAceQLException

      public AceQLException getAceQLException()
      Returns the AceQLException thrown if a ping() returns false
      Returns:
      the AceQLException thrown if a ping() returns false