public class DataSourceHealthIndicator extends AbstractHealthIndicator
HealthIndicator
that tests the status of a DataSource
and optionally
runs a test query.Constructor and Description |
---|
DataSourceHealthIndicator()
Create a new
DataSourceHealthIndicator instance. |
DataSourceHealthIndicator(DataSource dataSource)
Create a new
DataSourceHealthIndicator using the specified datasource. |
Modifier and Type | Method and Description |
---|---|
protected String |
detectQuery(String product) |
protected void |
doHealthCheck(Health.Builder builder)
Actual health check logic.
|
void |
setDataSource(DataSource dataSource) |
void |
setQuery(String query) |
health
public DataSourceHealthIndicator()
DataSourceHealthIndicator
instance.public DataSourceHealthIndicator(DataSource dataSource)
DataSourceHealthIndicator
using the specified datasource.dataSource
- the data sourceprotected void doHealthCheck(Health.Builder builder) throws Exception
AbstractHealthIndicator
doHealthCheck
in class AbstractHealthIndicator
builder
- the Health.Builder
to report health status and detailsException
- any Exception
that should create a Status.DOWN
system status.public void setDataSource(DataSource dataSource)
public void setQuery(String query)
Copyright © 2014 Pivotal Software, Inc.. All rights reserved.