Class AbstractSearchDataConnector<T1 extends ExecutableSearch,T2 extends MappingStrategy<?>>
- 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<T1,T2>
-
- Type Parameters:
T1- type of executable searchT2- type of mapping strategy
- All Implemented Interfaces:
DataConnector,ResolverPlugin<Map<String,IdPAttribute>>,Component,DestructableComponent,IdentifiableComponent,IdentifiedComponent,InitializableComponent,UnmodifiableComponent,DisposableBean
- Direct Known Subclasses:
HTTPDataConnector,LDAPDataConnector,RDBMSDataConnector,StorageServiceDataConnector
public abstract class AbstractSearchDataConnector<T1 extends ExecutableSearch,T2 extends MappingStrategy<?>> extends AbstractDataConnector
ADataConnectorcontaining functionality common to data connectors that retrieve attribute data by searching a data source.
-
-
Field Summary
Fields Modifier and Type Field Description private ValidatorconnectorValidatorValidator for validating this data connector.private booleanfailFastInitializeDoes DataConnector fail fast on Initialize.private org.slf4j.LoggerlogClass logger.private T2mappingStrategyStrategy for mapping search results to a collection ofIdPAttributes.private Cache<String,Map<String,IdPAttribute>>resultsCacheQuery result cache.private ExecutableSearchBuilder<T1>searchBuilderBuilder used to create executable searches.
-
Constructor Summary
Constructors Constructor Description AbstractSearchDataConnector()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected Map<String,IdPAttribute>doDataConnectorResolve(AttributeResolutionContext resolutionContext, AttributeResolverWorkContext workContext)protected voiddoInitialize()ExecutableSearchBuilder<T1>getExecutableSearchBuilder()Gets the builder used to create executable searches.T2getMappingStrategy()Gets the strategy for mapping from search results to a collection ofIdPAttributes.Cache<String,Map<String,IdPAttribute>>getResultsCache()Gets the cache used to cache search results.ValidatorgetValidator()Gets the validator used to validate this connector.booleanisFailFastInitialize()Does the data connector fails fast.protected abstract Map<String,IdPAttribute>retrieveAttributes(T1 executable)Attempts to retrieve attributes from the data source.voidsetExecutableSearchBuilder(ExecutableSearchBuilder<T1> builder)Sets the builder used to create the executable searches.voidsetFailFastInitialize(boolean what)Whether the data connector fails fast (on initialize).voidsetMappingStrategy(T2 strategy)Sets the strategy for mapping from search results to a collection ofIdPAttributes.voidsetResultsCache(Cache<String,Map<String,IdPAttribute>> cache)Sets the cache used to cache search results.voidsetValidator(Validator validator)Sets the validator used to validate this connector.-
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.
-
searchBuilder
@NonnullAfterInit private ExecutableSearchBuilder<T1 extends ExecutableSearch> searchBuilder
Builder used to create executable searches.
-
connectorValidator
@NonnullAfterInit private Validator connectorValidator
Validator for validating this data connector.
-
mappingStrategy
@NonnullAfterInit private T2 extends MappingStrategy<?> mappingStrategy
Strategy for mapping search results to a collection ofIdPAttributes.
-
resultsCache
@Nullable private Cache<String,Map<String,IdPAttribute>> resultsCache
Query result cache.
-
failFastInitialize
private boolean failFastInitialize
Does DataConnector fail fast on Initialize.
-
-
Method Detail
-
getExecutableSearchBuilder
@NonnullAfterInit public ExecutableSearchBuilder<T1> getExecutableSearchBuilder()
Gets the builder used to create executable searches.- Returns:
- builder used to create the executable searches
-
setExecutableSearchBuilder
public void setExecutableSearchBuilder(@Nonnull ExecutableSearchBuilder<T1> builder)Sets the builder used to create the executable searches.- Parameters:
builder- builder used to create the executable searches
-
getValidator
@NonnullAfterInit public Validator getValidator()
Gets the validator used to validate this connector.- Returns:
- validator used to validate this connector
-
setValidator
public void setValidator(@Nonnull Validator validator)Sets the validator used to validate this connector.- Parameters:
validator- used to validate this connector
-
getMappingStrategy
@NonnullAfterInit public T2 getMappingStrategy()
Gets the strategy for mapping from search results to a collection ofIdPAttributes.- Returns:
- strategy for mapping from search results to a collection of
IdPAttributes
-
setMappingStrategy
public void setMappingStrategy(@Nonnull T2 strategy)Sets the strategy for mapping from search results to a collection ofIdPAttributes.- Parameters:
strategy- strategy for mapping from search results to a collection ofIdPAttributes
-
getResultsCache
@Nullable public Cache<String,Map<String,IdPAttribute>> getResultsCache()
Gets the cache used to cache search results.- Returns:
- cache used to cache search results
-
setResultsCache
public void setResultsCache(@Nullable Cache<String,Map<String,IdPAttribute>> cache)Sets the cache used to cache search results. Note, all entries in the cache are invalidated prior to use.- Parameters:
cache- cache used to cache search results
-
retrieveAttributes
@Nullable protected abstract Map<String,IdPAttribute> retrieveAttributes(@Nonnull T1 executable) throws ResolutionException
Attempts to retrieve attributes from the data source.- Parameters:
executable- used to retrieve data from the data source- Returns:
- attributes
- Throws:
ResolutionException- thrown if there is a problem retrieving data from the data source
-
doDataConnectorResolve
@Nullable protected Map<String,IdPAttribute> doDataConnectorResolve(@Nonnull AttributeResolutionContext resolutionContext, @Nonnull AttributeResolverWorkContext workContext) throws ResolutionException
- Specified by:
doDataConnectorResolvein classAbstractDataConnector- Throws:
ResolutionException
-
doInitialize
protected void doInitialize() throws ComponentInitializationException- Overrides:
doInitializein classAbstractDataConnector- Throws:
ComponentInitializationException
-
isFailFastInitialize
public boolean isFailFastInitialize()
Does the data connector fails fast.- Returns:
- Returns whether the data connector fails fast (on initialize)
-
setFailFastInitialize
public void setFailFastInitialize(boolean what)
Whether the data connector fails fast (on initialize).- Parameters:
what- what to set
-
-