Class SubjectDataConnector
- 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.SubjectDataConnector
-
- All Implemented Interfaces:
DataConnector,ResolverPlugin<Map<String,IdPAttribute>>,Component,DestructableComponent,IdentifiableComponent,IdentifiedComponent,InitializableComponent,UnmodifiableComponent,DisposableBean
@ThreadSafe public class SubjectDataConnector extends AbstractDataConnector
ADataConnectorthat extracts allIdPAttributePrincipalobjects from theSubjectobjects associated with the request.- Since:
- 4.0.0
-
-
Field Summary
Fields Modifier and Type Field Description private booleanforCanonicalizationFlag denoting whether plugin is being used for subject c14n or standard usage.private org.slf4j.LoggerlogClass logger.private booleannoResultIsErrorControls handling of empty results.private Function<ProfileRequestContext,SubjectContext>scLookupStrategyStrategy used to locate theSubjectContextto use.private Function<ProfileRequestContext,Subject>subjectLookupStrategyStrategy used to locate theSubjectto use.
-
Constructor Summary
Constructors Constructor Description SubjectDataConnector()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Map<String,IdPAttribute>doDataConnectorResolve(AttributeResolutionContext resolutionContext, AttributeResolverWorkContext workContext)protected voiddoInitialize()booleanisForCanonicalization()Gets whether the connector is being used during Subject Canonicalization, causing auto-installation of an alternate Subject lookup strategy.booleanisNoResultIsError()Gets whether obtaining no results should be treated as an error.voidsetForCanonicalization(boolean flag)Sets whether the connector is being used during Subject Canonicalization, causing auto-installation of an alternate Subject lookup strategy.voidsetNoResultIsError(boolean flag)Sets whether obtaining no results should be treated as an error.voidsetSubjectContextLookupStrategy(Function<ProfileRequestContext,SubjectContext> strategy)Sets the strategy used to locate theSubjectContextassociated with a givenAttributeResolutionContext.voidsetSubjectLookupStrategy(Function<ProfileRequestContext,Subject> strategy)Sets the strategy used to locate aSubjectassociated with a givenAttributeResolutionContext.-
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.
-
forCanonicalization
private boolean forCanonicalization
Flag denoting whether plugin is being used for subject c14n or standard usage.
-
scLookupStrategy
@Nonnull private Function<ProfileRequestContext,SubjectContext> scLookupStrategy
Strategy used to locate theSubjectContextto use.
-
subjectLookupStrategy
@Nullable private Function<ProfileRequestContext,Subject> subjectLookupStrategy
Strategy used to locate theSubjectto use.
-
noResultIsError
private boolean noResultIsError
Controls handling of empty results.
-
-
Method Detail
-
isForCanonicalization
public boolean isForCanonicalization()
Gets whether the connector is being used during Subject Canonicalization, causing auto-installation of an alternate Subject lookup strategy.- Returns:
- whether connector is being used during c14n
-
setForCanonicalization
public void setForCanonicalization(boolean flag)
Sets whether the connector is being used during Subject Canonicalization, causing auto-installation of an alternate Subject lookup strategy.Defaults to false.
- Parameters:
flag- flag to set
-
setSubjectContextLookupStrategy
public void setSubjectContextLookupStrategy(@Nonnull Function<ProfileRequestContext,SubjectContext> strategy)Sets the strategy used to locate theSubjectContextassociated with a givenAttributeResolutionContext.- Parameters:
strategy- lookup strategy
-
setSubjectLookupStrategy
public void setSubjectLookupStrategy(@Nullable Function<ProfileRequestContext,Subject> strategy)Sets the strategy used to locate aSubjectassociated with a givenAttributeResolutionContext.- Parameters:
strategy- strategy used to locate aSubjectassociated with a givenAttributeResolutionContext
-
isNoResultIsError
public boolean isNoResultIsError()
Gets whether obtaining no results should be treated as an error.- Returns:
- whether obtaining no results should be treated as an error
-
setNoResultIsError
public void setNoResultIsError(boolean flag)
Sets whether obtaining no results should be treated as an error.Defaults to false.
- Parameters:
flag- flag to set
-
doInitialize
protected void doInitialize() throws ComponentInitializationException- Overrides:
doInitializein classAbstractDataConnector- Throws:
ComponentInitializationException
-
doDataConnectorResolve
@Nonnull protected Map<String,IdPAttribute> doDataConnectorResolve(@Nonnull AttributeResolutionContext resolutionContext, @Nonnull AttributeResolverWorkContext workContext) throws ResolutionException
- Specified by:
doDataConnectorResolvein classAbstractDataConnector- Throws:
ResolutionException
-
-