Package net.shibboleth.idp.attribute.resolver.dc.ldap.impl

# Class LDAPDataConnector

java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
net.shibboleth.shared.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>
A `DataConnector` that queries an LDAP in order to retrieve attribute data.

## Field Summary

Fields
Modifier and Type
Field
Description
`private ConnectionFactory`
`connectionFactory`
Factory for retrieving LDAP connections.
`private boolean`
`defaultMappingStrategy`
Whether the default mapping strategy is being used.
`private boolean`
`defaultValidator`
Whether the default validator is being used.
`private final org.slf4j.Logger`
`log`
Class logger.
`private SearchOperation`
`searchOperation`
For executing LDAP searches.

## Constructor Summary

Constructors
Constructor
Description
`LDAPDataConnector()`

## Method Summary

Modifier and Type
Method
Description
`protected void`
`doInitialize()`
`ConnectionFactory`
`getConnectionFactory()`
Gets the connection factory for retrieving `Connection`s.
`SearchOperation`
`getSearchOperation()`
Gets the search operation for executing searches.
`private void`
`policeForJVMTrust()`
Police TLS for JVM trust.
`protected Map<String,IdPAttribute>`
`retrieveAttributes(ExecutableSearchFilter filter)`
Attempts to retrieve attributes from the LDAP.
`void`
`setConnectionFactory(ConnectionFactory factory)`
Sets the connection factory for retrieving `Connection`s.
`void`
`setMappingStrategy(SearchResultMappingStrategy strategy)`
Sets the strategy for mapping from search results to a collection of `IdPAttribute`s.
`void`
`setSearchOperation(SearchOperation operation)`
Sets the search executor for executing searches.
`void`
`setValidator(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, retrieveAttributes, setExecutableSearchBuilder, setFailFastInitialize, setResultsCache`

### Methods inherited from class net.shibboleth.idp.attribute.resolver.AbstractDataConnector

`doResolve, getExportAttributes, getFailoverDataConnectorId, getLastFail, getLastSuccess, getLogPrefix, getNoRetryDelay, setExportAttributes, setFailoverDataConnectorId, setLastFail, setLastSuccess, setNoRetryDelay`

### Methods inherited from class net.shibboleth.idp.attribute.resolver.AbstractResolverPlugin

`doDestroy, equals, getActivationCondition, getAttributeDependencies, getDataConnectorDependencies, hashCode, isPropagateResolutionExceptions, resolve, setActivationCondition, setAttributeDependencies, setDataConnectorDependencies, setPropagateResolutionExceptions`

### Methods inherited from class net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent

`setId`

### Methods inherited from class net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent

`ensureId, getId, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException`

### Methods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent

`checkComponentActive, checkSetterPreconditions, 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.shared.component.DestructableComponent

`destroy, isDestroyed`

### Methods inherited from interface org.springframework.beans.factory.DisposableBean

`destroy`

### Methods inherited from interface net.shibboleth.shared.component.IdentifiedComponent

`getId`

### Methods inherited from interface net.shibboleth.shared.component.InitializableComponent

`initialize, isInitialized`

### Methods inherited from interface net.shibboleth.idp.attribute.resolver.ResolverPlugin

`getActivationCondition, getAttributeDependencies, getDataConnectorDependencies, isPropagateResolutionExceptions, resolve`

## Field Details

### log

@Nonnull private final org.slf4j.Logger log
Class logger.

### connectionFactory

@NonnullAfterInit private ConnectionFactory connectionFactory
Factory for retrieving LDAP connections.

### searchOperation

@NonnullAfterInit private SearchOperation searchOperation
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.

## Constructor Details

### LDAPDataConnector

public LDAPDataConnector()

## Method Details

### getConnectionFactory

public ConnectionFactory getConnectionFactory()
Gets the connection factory for retrieving `Connection`s.

Returns:
  connection factory for retrieving `Connection`s

### setConnectionFactory

public void setConnectionFactory(@Nonnull ConnectionFactory factory)
Sets the connection factory for retrieving `Connection`s.

Parameters:
  `factory` - connection factory for retrieving `Connection`s

### getSearchOperation

public SearchOperation getSearchOperation()
Gets the search operation for executing searches.

Returns:
  search operation for executing searches

### setSearchOperation

public void setSearchOperation(@Nonnull SearchOperation operation)
Sets the search executor for executing searches.

Parameters:
  `operation` - for executing searches

### setValidator

public void setValidator(@Nonnull Validator validator)
Sets the validator used to validate this connector.

Overrides:
  `setValidator` in class `AbstractSearchDataConnector<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 of `IdPAttribute`s.

Overrides:
  `setMappingStrategy` in class `AbstractSearchDataConnector<ExecutableSearchFilter,SearchResultMappingStrategy>`
Parameters:
  `strategy` - strategy for mapping from search results to a collection of `IdPAttribute`s

### doInitialize

protected void doInitialize() throws ComponentInitializationException

Overrides:
  `doInitialize` in class `AbstractSearchDataConnector<ExecutableSearchFilter,SearchResultMappingStrategy>`
Throws:
  `ComponentInitializationException`

### policeForJVMTrust

private void policeForJVMTrust() throws ComponentInitializationException
Police TLS for JVM trust.

Throws:
  `ComponentInitializationException` - if we detect an SSL issue

### retrieveAttributes

@Nullable @Unmodifiable @NotLive protected Map<String,IdPAttribute> retrieveAttributes(@Nullable ExecutableSearchFilter filter) throws ResolutionException
Attempts to retrieve attributes from the LDAP.

Specified by:
  `retrieveAttributes` in class `AbstractSearchDataConnector<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