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 DataSource
JDBC data source to validate.private final org.slf4j.Logger
Class logger.private boolean
Whether validate should throw. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the data source.boolean
Returns whetherValidator.validate()
should throw or log errors.void
setDataSource
(DataSource source) Sets the data source.void
setThrowValidateError
(boolean value) Sets whetherValidator.validate()
should throw or log errors.void
validate()
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:
setThrowValidateError
in interfaceValidator
- Parameters:
value
- whetherValidator.validate()
should throw or log errors
-
isThrowValidateError
public boolean isThrowValidateError()Returns whetherValidator.validate()
should throw or log errors.- Specified by:
isThrowValidateError
in 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:
validate
in interfaceValidator
- Throws:
ValidationException
- thrown if validation fails andValidator.isThrowValidateError()
is true
-