Class ConnectionFactoryValidator
java.lang.Object
net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
net.shibboleth.idp.attribute.resolver.dc.ldap.impl.ConnectionFactoryValidator
- All Implemented Interfaces:
Validator
,Component
,DestructableComponent
,InitializableComponent
public class ConnectionFactoryValidator extends AbstractInitializableComponent implements Validator
Validator implementation that invokes
Connection.open()
to determine if the ConnectionFactory is properly
configured.-
Field Summary
Fields Modifier and Type Field Description private ConnectionFactory
connectionFactory
Connection factory to validate.private org.slf4j.Logger
log
Class logger.private boolean
throwOnValidateError
Whether validate should throw, default value istrue
. -
Constructor Summary
Constructors Constructor Description ConnectionFactoryValidator()
Constructor. -
Method Summary
Modifier and Type Method Description protected void
doInitialize()
ConnectionFactory
getConnectionFactory()
Returns the connection factory.boolean
isThrowValidateError()
Returns whetherValidator.validate()
should throw or log errors.void
setConnectionFactory(ConnectionFactory factory)
Sets the connection factory.void
setThrowValidateError(boolean what)
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.Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, doDestroy, initialize, isDestroyed, isInitialized
-
Field Details
-
log
private final org.slf4j.Logger logClass logger. -
connectionFactory
Connection factory to validate. -
throwOnValidateError
private boolean throwOnValidateErrorWhether validate should throw, default value istrue
.
-
-
Constructor Details
-
ConnectionFactoryValidator
public ConnectionFactoryValidator()Constructor.
-
-
Method Details
-
doInitialize
- Overrides:
doInitialize
in classAbstractInitializableComponent
- Throws:
ComponentInitializationException
-
setConnectionFactory
Sets the connection factory.- Parameters:
factory
- the connection factory
-
getConnectionFactory
Returns the connection factory.- Returns:
- connection factory
-
setThrowValidateError
public void setThrowValidateError(boolean what)Sets whetherValidator.validate()
should throw or log errors.- Specified by:
setThrowValidateError
in interfaceValidator
- Parameters:
what
- 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
-