Package net.solarnetwork.dao.jdbc
Class DataSourcePingTest
java.lang.Object
net.solarnetwork.dao.jdbc.DataSourcePingTest
- All Implemented Interfaces:
PingTest
PingTest to verify a DataSource connection is available.
This test expects the configured query to return a
Timestamp as the first column of the query result.
- Since:
- 1.52
- Version:
- 2.0
- Author:
- matt
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.solarnetwork.service.PingTest
PingTest.Result -
Constructor Summary
ConstructorsConstructorDescriptionDataSourcePingTest(DataSource dataSource, String query) Constructor.DataSourcePingTest(DataSource dataSource, String query, String id) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionGet some globally-unique ID for this test instance.longGet the maximum number of milliseconds to wait for the ping test to execute before considering the test a failure.Get display name for this test.getQuery()Get the ping test SQL query.Perform the test, and return the results of the test.
-
Constructor Details
-
DataSourcePingTest
Constructor.The test ID will be set to the name of this class.
- Parameters:
dataSource- the data sourcequery- the query to execute
-
DataSourcePingTest
Constructor.- Parameters:
dataSource- the data sourcequery- the query to executeid- the test ID- Since:
- 1.1
-
-
Method Details
-
getPingTestId
Description copied from interface:PingTestGet some globally-unique ID for this test instance.- Specified by:
getPingTestIdin interfacePingTest- Returns:
- The globally-unique ID of this test instance.
-
getPingTestName
Description copied from interface:PingTestGet display name for this test.- Specified by:
getPingTestNamein interfacePingTest- Returns:
- The name of the test.
-
getPingTestMaximumExecutionMilliseconds
public long getPingTestMaximumExecutionMilliseconds()Description copied from interface:PingTestGet the maximum number of milliseconds to wait for the ping test to execute before considering the test a failure.- Specified by:
getPingTestMaximumExecutionMillisecondsin interfacePingTest- Returns:
- The maximum execution milliseconds.
-
performPingTest
Description copied from interface:PingTestPerform the test, and return the results of the test.- Specified by:
performPingTestin interfacePingTest- Returns:
- The test results.
- Throws:
Exception- if any error occurs
-
getQuery
Get the ping test SQL query.- Returns:
- the SQL query
-