Class LDAPDataConnector
- java.lang.Object
-
- net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
-
- net.shibboleth.utilities.java.support.component.AbstractIdentifiedInitializableComponent
-
- net.shibboleth.utilities.java.support.component.AbstractIdentifiableInitializableComponent
-
- net.shibboleth.idp.attribute.resolver.AbstractResolverPlugin<Map<String,IdPAttribute>>
-
- net.shibboleth.idp.attribute.resolver.AbstractDataConnector
-
- net.shibboleth.idp.attribute.resolver.dc.impl.AbstractSearchDataConnector<ExecutableSearchFilter,SearchResultMappingStrategy>
-
- net.shibboleth.idp.attribute.resolver.dc.ldap.impl.LDAPDataConnector
-
- All Implemented Interfaces:
DataConnector,ResolverPlugin<Map<String,IdPAttribute>>,Component,DestructableComponent,IdentifiableComponent,IdentifiedComponent,InitializableComponent,UnmodifiableComponent,DisposableBean
public class LDAPDataConnector extends AbstractSearchDataConnector<ExecutableSearchFilter,SearchResultMappingStrategy>
ADataConnectorthat queries an LDAP in order to retrieve attribute data.
-
-
Field Summary
Fields Modifier and Type Field Description private ConnectionFactoryconnectionFactoryFactory for retrieving LDAP connections.private booleandefaultMappingStrategyWhether the default mapping strategy is being used.private booleandefaultValidatorWhether the default validator is being used.private org.slf4j.LoggerlogClass logger.private SearchExecutorsearchExecutorFor executing LDAP searches.
-
Constructor Summary
Constructors Constructor Description LDAPDataConnector()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoInitialize()ConnectionFactorygetConnectionFactory()Gets the connection factory for retrievingConnections.SearchExecutorgetSearchExecutor()Gets the search executor for executing searches.private voidpoliceForJVMTrust()Police TLS for JVM trust.protected Map<String,IdPAttribute>retrieveAttributes(ExecutableSearchFilter filter)Attempts to retrieve attributes from the LDAP.voidsetConnectionFactory(ConnectionFactory factory)Sets the connection factory for retrievingConnections.voidsetMappingStrategy(SearchResultMappingStrategy strategy)Sets the strategy for mapping from search results to a collection ofIdPAttributes.voidsetSearchExecutor(SearchExecutor executor)Sets the search executor for executing searches.voidsetValidator(Validator validator)Sets the validator used to validate this connector.-
Methods inherited from class net.shibboleth.idp.attribute.resolver.dc.impl.AbstractSearchDataConnector
doDataConnectorResolve, getExecutableSearchBuilder, getMappingStrategy, getResultsCache, getValidator, isFailFastInitialize, setExecutableSearchBuilder, setFailFastInitialize, setResultsCache
-
Methods inherited from class net.shibboleth.idp.attribute.resolver.AbstractDataConnector
doResolve, getExportAttributes, getFailoverDataConnectorId, getLastFail, getLastSuccess, getLogPrefix, getNoRetryDelay, isExportAllAttributes, setExportAllAttributes, setExportAttributes, setFailoverDataConnectorId, setLastFail, setLastSuccess, setNoRetryDelay
-
Methods inherited from class net.shibboleth.idp.attribute.resolver.AbstractResolverPlugin
addDisplayInformation, doDestroy, equals, getActivationCondition, getAttributeDependencies, getDataConnectorDependencies, getProfileContextStrategy, hashCode, isPropagateResolutionExceptions, isSuppressDisplayInformation, resolve, setActivationCondition, setAttributeDependencies, setDataConnectorDependencies, setProfileContextStrategy, setPropagateResolutionExceptions, setSuppressDisplayInformation
-
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractIdentifiableInitializableComponent
setId
-
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractIdentifiedInitializableComponent
getId
-
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, initialize, isDestroyed, isInitialized
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.shibboleth.utilities.java.support.component.DestructableComponent
destroy, isDestroyed
-
Methods inherited from interface org.springframework.beans.factory.DisposableBean
destroy
-
Methods inherited from interface net.shibboleth.utilities.java.support.component.IdentifiedComponent
getId
-
Methods inherited from interface net.shibboleth.utilities.java.support.component.InitializableComponent
initialize, isInitialized
-
Methods inherited from interface net.shibboleth.idp.attribute.resolver.ResolverPlugin
getActivationCondition, getAttributeDependencies, getDataConnectorDependencies, isPropagateResolutionExceptions, resolve
-
-
-
-
Field Detail
-
log
@Nonnull private final org.slf4j.Logger log
Class logger.
-
connectionFactory
private ConnectionFactory connectionFactory
Factory for retrieving LDAP connections.
-
searchExecutor
private SearchExecutor searchExecutor
For executing LDAP searches.
-
defaultValidator
private boolean defaultValidator
Whether the default validator is being used.
-
defaultMappingStrategy
private boolean defaultMappingStrategy
Whether the default mapping strategy is being used.
-
-
Method Detail
-
getConnectionFactory
public ConnectionFactory getConnectionFactory()
Gets the connection factory for retrievingConnections.- Returns:
- connection factory for retrieving
Connections
-
setConnectionFactory
public void setConnectionFactory(@Nonnull ConnectionFactory factory)Sets the connection factory for retrievingConnections.- Parameters:
factory- connection factory for retrievingConnections
-
getSearchExecutor
public SearchExecutor getSearchExecutor()
Gets the search executor for executing searches.- Returns:
- search executor for executing searches
-
setSearchExecutor
public void setSearchExecutor(@Nonnull SearchExecutor executor)Sets the search executor for executing searches.- Parameters:
executor- search executor for executing searches
-
setValidator
public void setValidator(@Nonnull Validator validator)Sets the validator used to validate this connector.- Overrides:
setValidatorin classAbstractSearchDataConnector<ExecutableSearchFilter,SearchResultMappingStrategy>- Parameters:
validator- used to validate this connector
-
setMappingStrategy
public void setMappingStrategy(@Nonnull SearchResultMappingStrategy strategy)Sets the strategy for mapping from search results to a collection ofIdPAttributes.- Overrides:
setMappingStrategyin classAbstractSearchDataConnector<ExecutableSearchFilter,SearchResultMappingStrategy>- Parameters:
strategy- strategy for mapping from search results to a collection ofIdPAttributes
-
doInitialize
protected void doInitialize() throws ComponentInitializationException- Overrides:
doInitializein classAbstractSearchDataConnector<ExecutableSearchFilter,SearchResultMappingStrategy>- Throws:
ComponentInitializationException
-
policeForJVMTrust
private void policeForJVMTrust() throws ComponentInitializationExceptionPolice TLS for JVM trust.- Throws:
ComponentInitializationException- if we detect an SSL issue
-
retrieveAttributes
@Nullable protected Map<String,IdPAttribute> retrieveAttributes(ExecutableSearchFilter filter) throws ResolutionException
Attempts to retrieve attributes from the LDAP.- Specified by:
retrieveAttributesin classAbstractSearchDataConnector<ExecutableSearchFilter,SearchResultMappingStrategy>- Parameters:
filter- search filter used to retrieve data from the LDAP- Returns:
- search result from the LDAP
- Throws:
ResolutionException- thrown if there is a problem retrieving data from the LDAP
-
-