public class DataSourceValidator extends AbstractInitializableComponent implements Validator
DataSource.getConnection() to determine if the DataSource is properly
configured.| Modifier and Type | Field and Description |
|---|---|
private DataSource |
dataSource
JDBC data source to validate.
|
private org.slf4j.Logger |
log
Class logger.
|
private boolean |
throwOnValidateError
whether validate should throw, default value is .
|
| Constructor and Description |
|---|
DataSourceValidator()
Constructor.
|
DataSourceValidator(DataSource source)
Deprecated.
- use the property setters
|
DataSourceValidator(DataSource source,
boolean throwOnError)
Deprecated.
- use the property setters
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
doInitialize() |
DataSource |
getDataSource()
Returns the data source.
|
boolean |
isThrowValidateError()
Returns whether
validate() should throw or log errors. |
void |
setDataSource(DataSource source)
Sets the data source.
|
void |
setThrowValidateError(boolean value)
Sets whether
validate() should throw or log errors. |
void |
validate() |
destroy, doDestroy, initialize, isDestroyed, isInitializedprivate final org.slf4j.Logger log
@NonnullAfterInit private DataSource dataSource
private boolean throwOnValidateError
@Deprecated public DataSourceValidator(DataSource source)
source - to validate@Deprecated public DataSourceValidator(DataSource source, boolean throwOnError)
source - to validatethrowOnError - whether validate() should throw or log errorspublic DataSourceValidator()
protected void doInitialize()
throws ComponentInitializationException
doInitialize in class AbstractInitializableComponentComponentInitializationExceptionpublic void setDataSource(@Nonnull DataSource source)
source - the data sourcepublic DataSource getDataSource()
public void setThrowValidateError(boolean value)
validate() should throw or log errors.value - whether validate() should throw or log errorspublic boolean isThrowValidateError()
validate() should throw or log errors.validate() should throw or log errorspublic void validate()
throws ValidationException
validate in interface ValidatorValidationExceptionCopyright © 1999–2017 Shibboleth Consortium. All rights reserved.