Package com.aceql.jdbc.commons
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 Summary
Constructors Constructor Description HealthCheck(AceQLConnection connection)Default constructor -
Method Summary
Modifier and Type Method Description AceQLExceptiongetAceQLException()Returns the AceQLException thrown if aping()returns falselonggetResponseTime()Gets the response time of a "select 1" called on the remote database defined by the underlyingAceQLConnectionlonggetResponseTime(String sql)Gets the response time of a SQL statement called on the remote database defined by the underlyingAceQLConnectionServerMemoryInfogetServerMemoryInfo()Gets health check memory info from serverbooleanping()Allows to ping the AceQL server main servlet
-
Constructor Details
-
HealthCheck
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
Gets the response time of a "select 1" called on the remote database defined by the underlyingAceQLConnection- Returns:
- the response time in milliseconds
- Throws:
SQLException- if any SQL Exception occurs
-
getResponseTime
Gets the response time of a SQL statement called on the remote database defined by the underlyingAceQLConnection- Parameters:
sql- the SQL statement to call- Returns:
- the response time in milliseconds
- Throws:
SQLException- if any SQL Exception occurs
-
getServerMemoryInfo
Gets health check memory info from server- Returns:
- health check memory info from server
- Throws:
SQLException- if any SQL Exception occurs
-
getAceQLException
Returns the AceQLException thrown if aping()returns false- Returns:
- the AceQLException thrown if a
ping()returns false
-