Class ConnectionFactoryValidator
- java.lang.Object
-
- net.shibboleth.idp.attribute.resolver.dc.ldap.impl.ConnectionFactoryValidator
-
- All Implemented Interfaces:
Validator
public class ConnectionFactoryValidator extends Object implements Validator
Validator implementation that invokesConnection.open()to determine if the ConnectionFactory is properly configured.
-
-
Field Summary
Fields Modifier and Type Field Description private ConnectionFactoryconnectionFactoryConnection factory to validate.private org.slf4j.LoggerlogClass logger.private booleanthrowOnValidateErrorWhether validate should throw, default value istrue.
-
Constructor Summary
Constructors Constructor Description ConnectionFactoryValidator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConnectionFactorygetConnectionFactory()Returns the connection factory.booleanisThrowValidateError()Returns whetherValidator.validate()should throw or log errors.voidsetConnectionFactory(ConnectionFactory factory)Sets the connection factory.voidsetThrowValidateError(boolean what)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 Detail
-
log
private final org.slf4j.Logger log
Class logger.
-
connectionFactory
@Nonnull private ConnectionFactory connectionFactory
Connection factory to validate.
-
throwOnValidateError
private boolean throwOnValidateError
Whether validate should throw, default value istrue.
-
-
Method Detail
-
setConnectionFactory
@Nonnull public void setConnectionFactory(@Nonnull ConnectionFactory factory)Sets the connection factory.- Parameters:
factory- the connection factory
-
getConnectionFactory
@Nonnull public ConnectionFactory getConnectionFactory()
Returns the connection factory.- Returns:
- connection factory
-
setThrowValidateError
public void setThrowValidateError(boolean what)
Sets whetherValidator.validate()should throw or log errors.- Specified by:
setThrowValidateErrorin interfaceValidator- Parameters:
what- 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
public void validate() throws ValidationExceptionProbe 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
-
-