Class DataSourceValidator
java.lang.Object
net.shibboleth.idp.attribute.resolver.dc.rdbms.impl.DataSourceValidator
- All Implemented Interfaces:
Validator
Validator implementation that invokes
DataSource.getConnection() to determine if the DataSource is properly
configured.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate DataSourceJDBC data source to validate.private final org.slf4j.LoggerClass logger.private booleanWhether validate should throw. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the data source.booleanReturns whetherValidator.validate()should throw or log errors.voidsetDataSource(DataSource source) Sets the data source.voidsetThrowValidateError(boolean value) Sets whetherValidator.validate()should throw or log errors.voidvalidate()Probe the data connector and conditionally fails if it is not valid and ready for use.
-
Field Details
-
log
private final org.slf4j.Logger logClass logger. -
dataSource
JDBC data source to validate. -
throwOnValidateError
private boolean throwOnValidateErrorWhether validate should throw.
-
-
Constructor Details
-
DataSourceValidator
public DataSourceValidator()
-
-
Method Details
-
setDataSource
Sets the data source.- Parameters:
source- the data source
-
getDataSource
Returns the data source.- Returns:
- data source
-
setThrowValidateError
public void setThrowValidateError(boolean value) Sets whetherValidator.validate()should throw or log errors.- Specified by:
setThrowValidateErrorin interfaceValidator- Parameters:
value- whetherValidator.validate()should throw or log errors
-
isThrowValidateError
public boolean isThrowValidateError()Returns whetherValidator.validate()should throw or log errors.- Specified by:
isThrowValidateErrorin interfaceValidator- Returns:
- whether
Validator.validate()should throw or log errors
-
validate
Probe the data connector and conditionally fails if it is not valid and ready for use.- Specified by:
validatein interfaceValidator- Throws:
ValidationException- thrown if validation fails andValidator.isThrowValidateError()is true
-