Class DataSourceValidator
- java.lang.Object
-
- net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
-
- net.shibboleth.idp.attribute.resolver.dc.rdbms.impl.DataSourceValidator
-
- All Implemented Interfaces:
Validator,Component,DestructableComponent,InitializableComponent
public class DataSourceValidator extends AbstractInitializableComponent implements Validator
Validator implementation that invokesDataSource.getConnection()to determine if the DataSource is properly configured.
-
-
Field Summary
Fields Modifier and Type Field Description private DataSourcedataSourceJDBC data source to validate.private org.slf4j.LoggerlogClass logger.private booleanthrowOnValidateErrorWhether validate should throw, default value istrue.
-
Constructor Summary
Constructors Constructor Description DataSourceValidator()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoInitialize()DataSourcegetDataSource()Returns the data source.booleanisThrowValidateError()voidsetDataSource(DataSource source)Sets the data source.voidsetThrowValidateError(boolean value)voidvalidate()-
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, doDestroy, initialize, isDestroyed, isInitialized
-
-
-
-
Field Detail
-
log
private final org.slf4j.Logger log
Class logger.
-
dataSource
@NonnullAfterInit private DataSource dataSource
JDBC data source to validate.
-
throwOnValidateError
private boolean throwOnValidateError
Whether validate should throw, default value istrue.
-
-
Method Detail
-
doInitialize
protected void doInitialize() throws ComponentInitializationException- Overrides:
doInitializein classAbstractInitializableComponent- Throws:
ComponentInitializationException
-
setDataSource
public void setDataSource(@Nonnull DataSource source)Sets the data source.- Parameters:
source- the data source
-
getDataSource
public DataSource getDataSource()
Returns the data source.- Returns:
- data source
-
setThrowValidateError
public void setThrowValidateError(boolean value)
- Specified by:
setThrowValidateErrorin interfaceValidator
-
isThrowValidateError
public boolean isThrowValidateError()
- Specified by:
isThrowValidateErrorin interfaceValidator
-
validate
public void validate() throws ValidationException- Specified by:
validatein interfaceValidator- Throws:
ValidationException
-
-