Class ResolvedAttributeDefinition
- 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.ResolvedAttributeDefinition
-
- All Implemented Interfaces:
AttributeDefinition,ResolverPlugin<IdPAttribute>,Component,DestructableComponent,IdentifiableComponent,IdentifiedComponent,InitializableComponent,UnmodifiableComponent,DisposableBean
@ThreadSafe public final class ResolvedAttributeDefinition extends AbstractAttributeDefinition
A proxy which wraps a resolved attribute definition and always returns the same attribute. The goal being that once an attribute definition is resolved once this can be used in its place and calls toResolverPlugin.resolve(AttributeResolutionContext)are "free". This proxy is immutable so all setter methods simply return.
-
-
Field Summary
Fields Modifier and Type Field Description private IdPAttributeresolvedAttributeThe attribute produced by the resolved attribute definition.private AttributeDefinitionresolvedDefinitionThe attribute definition that was resolved to produce the attribute.
-
Constructor Summary
Constructors Constructor Description ResolvedAttributeDefinition(AttributeDefinition definition, IdPAttribute attribute)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected IdPAttributedoAttributeDefinitionResolve(AttributeResolutionContext resolutionContext, AttributeResolverWorkContext workContext)Creates and populates the values for the resolved attribute.booleanequals(Object obj)Predicate<ProfileRequestContext>getActivationCondition()Get the predicate which defines whether this plugin is active for a given request.Set<ResolverAttributeDefinitionDependency>getAttributeDependencies()Gets the unmodifiable list of attributeDependencies for this plugin.Set<ResolverDataConnectorDependency>getDataConnectorDependencies()Gets the unmodifiable list of dependencies for this plugin.StringgetId()IdPAttributegetResolvedAttribute()Gets the resolved attribute.AttributeDefinitiongetResolvedDefinition()Gets the wrapped attribute definition that was resolved.inthashCode()booleanisDependencyOnly()Gets whether this attribute definition is only a dependency and thus its values should never be released outside the resolver.booleanisInitialized()booleanisPropagateResolutionExceptions()Get whether aResolutionExceptionthat occurred resolving attributes will be re-thrown.voidsetDependencyOnly(boolean isDependencyOnly)Sets whether this attribute definition is only a dependency and thus its values should never be released outside the resolver.voidsetPropagateResolutionExceptions(boolean propagate)Set whether anAttributeResolutionContextthat occurred resolving attributes will be re-thrown.StringtoString()-
Methods inherited from class net.shibboleth.idp.attribute.resolver.AbstractAttributeDefinition
doInitialize, doResolve, getLogPrefix, isPreRequested, setPreRequested
-
Methods inherited from class net.shibboleth.idp.attribute.resolver.AbstractResolverPlugin
addDisplayInformation, doDestroy, getProfileContextStrategy, isSuppressDisplayInformation, resolve, setActivationCondition, setAttributeDependencies, setDataConnectorDependencies, setProfileContextStrategy, setSuppressDisplayInformation
-
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractIdentifiableInitializableComponent
setId
-
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, initialize, isDestroyed
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, 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.InitializableComponent
initialize
-
Methods inherited from interface net.shibboleth.idp.attribute.resolver.ResolverPlugin
resolve
-
-
-
-
Field Detail
-
resolvedDefinition
@Nonnull private final AttributeDefinition resolvedDefinition
The attribute definition that was resolved to produce the attribute.
-
resolvedAttribute
@Nullable private final IdPAttribute resolvedAttribute
The attribute produced by the resolved attribute definition.
-
-
Constructor Detail
-
ResolvedAttributeDefinition
public ResolvedAttributeDefinition(@Nonnull AttributeDefinition definition, @Nullable IdPAttribute attribute)Constructor.- Parameters:
definition- attribute definition that was resolved to produce the given attributeattribute- attribute produced by the given attribute definition
-
-
Method Detail
-
doAttributeDefinitionResolve
@Nullable protected IdPAttribute doAttributeDefinitionResolve(@Nonnull AttributeResolutionContext resolutionContext, @Nonnull AttributeResolverWorkContext workContext) throws ResolutionException
Creates 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
-
equals
public boolean equals(Object obj)
- Overrides:
equalsin classAbstractResolverPlugin<IdPAttribute>
-
getAttributeDependencies
@Nonnull @NonnullElements public Set<ResolverAttributeDefinitionDependency> getAttributeDependencies()
Gets the unmodifiable list of attributeDependencies for this plugin.- Specified by:
getAttributeDependenciesin interfaceResolverPlugin<IdPAttribute>- Overrides:
getAttributeDependenciesin classAbstractResolverPlugin<IdPAttribute>- Returns:
- unmodifiable list of dependencies for this plugin, never null
-
getDataConnectorDependencies
@Nonnull @NonnullElements public Set<ResolverDataConnectorDependency> getDataConnectorDependencies()
Gets the unmodifiable list of dependencies for this plugin.- Specified by:
getDataConnectorDependenciesin interfaceResolverPlugin<IdPAttribute>- Overrides:
getDataConnectorDependenciesin classAbstractResolverPlugin<IdPAttribute>- Returns:
- unmodifiable list of dependencies for this plugin, never null
-
getActivationCondition
@Nullable public Predicate<ProfileRequestContext> getActivationCondition()
Get the predicate which defines whether this plugin is active for a given request.- Specified by:
getActivationConditionin interfaceResolverPlugin<IdPAttribute>- Overrides:
getActivationConditionin classAbstractResolverPlugin<IdPAttribute>- Returns:
- the predicate.
-
getId
@Nonnull public String getId()
- Specified by:
getIdin interfaceIdentifiedComponent- Overrides:
getIdin classAbstractIdentifiedInitializableComponent
-
getResolvedAttribute
@Nullable public IdPAttribute getResolvedAttribute()
Gets the resolved attribute.- Returns:
- resolved attribute, or null
-
hashCode
public int hashCode()
- Overrides:
hashCodein classAbstractResolverPlugin<IdPAttribute>
-
isDependencyOnly
public boolean isDependencyOnly()
Gets whether this attribute definition is only a dependency and thus its values should never be released outside the resolver.- Specified by:
isDependencyOnlyin interfaceAttributeDefinition- Overrides:
isDependencyOnlyin classAbstractAttributeDefinition- Returns:
- true if this attribute is only used as a dependency, false otherwise
-
isPropagateResolutionExceptions
public boolean isPropagateResolutionExceptions()
Get whether aResolutionExceptionthat occurred resolving attributes will be re-thrown. Doing so will cause the entire attribute resolution request to fail.- Specified by:
isPropagateResolutionExceptionsin interfaceResolverPlugin<IdPAttribute>- Overrides:
isPropagateResolutionExceptionsin classAbstractResolverPlugin<IdPAttribute>- Returns:
- true if
ResolutionExceptions are propagated, false if not
-
setDependencyOnly
public void setDependencyOnly(boolean isDependencyOnly)
Sets whether this attribute definition is only a dependency and thus its values should never be released outside the resolver.- Overrides:
setDependencyOnlyin classAbstractAttributeDefinition- Parameters:
isDependencyOnly- whether this attribute definition is only a dependency
-
setPropagateResolutionExceptions
public void setPropagateResolutionExceptions(boolean propagate)
Set whether anAttributeResolutionContextthat occurred resolving attributes will be re-thrown. Doing so will cause the entire attribute resolution request to fail.- Overrides:
setPropagateResolutionExceptionsin classAbstractResolverPlugin<IdPAttribute>- Parameters:
propagate- true ifResolutionExceptions are propagated, false if not
-
getResolvedDefinition
@Nonnull public AttributeDefinition getResolvedDefinition()
Gets the wrapped attribute definition that was resolved.- Returns:
- the resolved attribute definition
-
isInitialized
public boolean isInitialized()
- Specified by:
isInitializedin interfaceInitializableComponent- Overrides:
isInitializedin classAbstractInitializableComponent
-
-