Package org.clazzes.util.jdbc.provider
Class JdbcProviderApiImpl
- java.lang.Object
-
- org.clazzes.util.sched.impl.JobStatusServiceImpl
-
- org.clazzes.util.jdbc.provider.JdbcProviderApiImpl
-
- All Implemented Interfaces:
IJdbcProviderApi
,org.clazzes.util.sched.api.IJobStatusService
public class JdbcProviderApiImpl extends org.clazzes.util.sched.impl.JobStatusServiceImpl implements IJdbcProviderApi
The implementation of the external monitoring API.
-
-
Constructor Summary
Constructors Constructor Description JdbcProviderApiImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,Boolean>
listDataSources()
UUID
restartDataSource(String datasourceName)
Restart a configured datasource.void
setDataSourceKeeper(IDataSourceKeeper dataSourceKeeper)
void
setSecretsService(BiFunction<String,String,String> secretsService)
UUID
testAllDataSources()
Test all configured datasources.UUID
testConnection(String url, Map<String,String> additionalProperties)
Test a not yet configured JDBC connection.UUID
testDataSource(String datasourceName)
Test an already configured datasource.-
Methods inherited from class org.clazzes.util.sched.impl.JobStatusServiceImpl
cancelJob, getJobStatus, getOneTimeScheduler, isAllowCancelTimedJob, setAllowCancelTimedJob, setOneTimeScheduler, waitForJob
-
-
-
-
Method Detail
-
testConnection
public UUID testConnection(String url, Map<String,String> additionalProperties)
Description copied from interface:IJdbcProviderApi
Test a not yet configured JDBC connection.- Specified by:
testConnection
in interfaceIJdbcProviderApi
- Parameters:
url
- The JDBC URL to test.additionalProperties
- Any additional properties likeusername
,password
, ... as mentioned in the description ofJdbcProvider
.- Returns:
- An UUID of a job to query with
IJobStatusService.getJobStatus(UUID)
. The job will have a result type ofBoolean
.
-
testDataSource
public UUID testDataSource(String datasourceName)
Description copied from interface:IJdbcProviderApi
Test an already configured datasource.- Specified by:
testDataSource
in interfaceIJdbcProviderApi
- Parameters:
datasourceName
- The name of the configured datasource to test.- Returns:
- An UUID of a job to query with
IJobStatusService.getJobStatus(UUID)
. The job will have a result type ofBoolean
.
-
testAllDataSources
public UUID testAllDataSources()
Description copied from interface:IJdbcProviderApi
Test all configured datasources.- Specified by:
testAllDataSources
in interfaceIJdbcProviderApi
- Returns:
- An UUID of a job to query with
IJobStatusService.getJobStatus(UUID)
. The job will have a result type ofInteger
representing the number of successfully tested datasources.
-
restartDataSource
public UUID restartDataSource(String datasourceName)
Description copied from interface:IJdbcProviderApi
Restart a configured datasource.- Specified by:
restartDataSource
in interfaceIJdbcProviderApi
- Parameters:
datasourceName
- The name of the configured datasource to restart.- Returns:
- An UUID of a job to query with
IJobStatusService.getJobStatus(UUID)
. The job will have a result type ofBoolean
.
-
listDataSources
public Map<String,Boolean> listDataSources()
- Specified by:
listDataSources
in interfaceIJdbcProviderApi
- Returns:
- A list of datasources along with their activation status.
-
setDataSourceKeeper
public void setDataSourceKeeper(IDataSourceKeeper dataSourceKeeper)
-
setSecretsService
public void setSecretsService(BiFunction<String,String,String> secretsService)
-
-