Class ContextDerivedAttributeDefinition
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<IdPAttribute>
net.shibboleth.idp.attribute.resolver.AbstractAttributeDefinition
net.shibboleth.idp.attribute.resolver.ad.impl.ContextDerivedAttributeDefinition
- All Implemented Interfaces:
AttributeDefinition,ResolverPlugin<IdPAttribute>,Component,DestructableComponent,IdentifiableComponent,IdentifiedComponent,InitializableComponent,UnmodifiableComponent,DisposableBean
An attribute definition which returns an attribute whose values are derived from the
ProfileRequestContext associated with the request via a plugged in Function.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Function<ProfileRequestContext,List<IdPAttributeValue>> Function used to generate the values associated with theProfileRequestContextThe function returns null or an empty list if the context isn't relevant.private final org.slf4j.LoggerLogger.Strategy used to locate theProfileRequestContextto use. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected IdPAttributedoAttributeDefinitionResolve(AttributeResolutionContext resolutionContext, AttributeResolverWorkContext workContext) Creates and populates the values for the resolved attribute.protected voidvoidSets the attribute value function.voidsetProfileRequestContextLookupStrategy(Function<AttributeResolutionContext, ProfileRequestContext> strategy) Set the strategy used to locate theProfileRequestContextassociated with a givenAttributeResolutionContext.Methods inherited from class net.shibboleth.idp.attribute.resolver.AbstractAttributeDefinition
doResolve, getLogPrefix, isDependencyOnly, isPreRequested, setDependencyOnly, setPreRequestedMethods 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, setSuppressDisplayInformationMethods inherited from class net.shibboleth.utilities.java.support.component.AbstractIdentifiableInitializableComponent
setIdMethods inherited from class net.shibboleth.utilities.java.support.component.AbstractIdentifiedInitializableComponent
getIdMethods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, initialize, isDestroyed, isInitializedMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.shibboleth.utilities.java.support.component.DestructableComponent
destroy, isDestroyedMethods inherited from interface org.springframework.beans.factory.DisposableBean
destroyMethods inherited from interface net.shibboleth.utilities.java.support.component.IdentifiedComponent
getIdMethods inherited from interface net.shibboleth.utilities.java.support.component.InitializableComponent
initialize, isInitializedMethods inherited from interface net.shibboleth.idp.attribute.resolver.ResolverPlugin
getActivationCondition, getAttributeDependencies, getDataConnectorDependencies, isPropagateResolutionExceptions, resolve
-
Field Details
-
log
@Nonnull private final org.slf4j.Logger logLogger. -
prcLookupStrategy
Strategy used to locate theProfileRequestContextto use. -
attributeValuesFunction
@NonnullAfterInit private Function<ProfileRequestContext,List<IdPAttributeValue>> attributeValuesFunctionFunction used to generate the values associated with theProfileRequestContextThe function returns null or an empty list if the context isn't relevant.
-
-
Constructor Details
-
ContextDerivedAttributeDefinition
public ContextDerivedAttributeDefinition()Constructor.
-
-
Method Details
-
setProfileRequestContextLookupStrategy
public void setProfileRequestContextLookupStrategy(@Nonnull Function<AttributeResolutionContext, ProfileRequestContext> strategy) Set the strategy used to locate theProfileRequestContextassociated with a givenAttributeResolutionContext.- Parameters:
strategy- strategy used to locate theProfileRequestContextassociated with a givenAttributeResolutionContext
-
setAttributeValuesFunction
public void setAttributeValuesFunction(@Nonnull Function<ProfileRequestContext, List<IdPAttributeValue>> function) Sets the attribute value function.- Parameters:
function- what to set.
-
doInitialize
- Overrides:
doInitializein classAbstractAttributeDefinition- Throws:
ComponentInitializationException
-
doAttributeDefinitionResolve
@Nullable protected IdPAttribute doAttributeDefinitionResolve(@Nonnull AttributeResolutionContext resolutionContext, @Nonnull AttributeResolverWorkContext workContext) throws ResolutionException Description copied from class:AbstractAttributeDefinitionCreates and populates the values for the resolved attribute. Implementations should not set, or otherwise manage, the resolved attribute's display name, description or encoders. Nor should the resultant attribute be recorded in the given resolution context.- Specified by:
doAttributeDefinitionResolvein classAbstractAttributeDefinition- Parameters:
resolutionContext- current attribute resolution contextworkContext- current resolver work context- Returns:
- resolved attribute or null if nothing to resolve.
- Throws:
ResolutionException- thrown if there is a problem resolving and creating the attribute
-