Class ScopedAttributeDefinition
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
net.shibboleth.idp.attribute.resolver.AbstractResolverPlugin<IdPAttribute>
net.shibboleth.idp.attribute.resolver.AbstractAttributeDefinition
net.shibboleth.idp.attribute.resolver.ad.impl.ScopedAttributeDefinition
- All Implemented Interfaces:
AttributeDefinition,ResolverPlugin<IdPAttribute>,Component,DestructableComponent,IdentifiableComponent,IdentifiedComponent,InitializableComponent,UnmodifiableComponent,DisposableBean
An attribute definition that creates
ScopedStringAttributeValues by taking a source attribute value and
applying a static scope to each.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected IdPAttributedoAttributeDefinitionResolve(AttributeResolutionContext resolutionContext, AttributeResolverWorkContext workContext) Creates and populates the values for the resolved attribute.protected voidNull safe getter fornonScopeAttributeDependencies.getScope()Get scope value.private StringgetScopeFromSource(AttributeResolverWorkContext workContext) Lookup the source attribute in the resolved list.Get scope source (attribute id).voidSet the scope for this definition.voidsetScopeSource(String attributeId) Set the source of the scope for this definition.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
doDestroy, equals, getActivationCondition, getAttributeDependencies, getDataConnectorDependencies, hashCode, isPropagateResolutionExceptions, resolve, setActivationCondition, setAttributeDependencies, setDataConnectorDependencies, setPropagateResolutionExceptionsMethods inherited from class net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
setIdMethods inherited from class net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
ensureId, getId, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentExceptionMethods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, initialize, isDestroyed, isInitializedMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.shibboleth.shared.component.DestructableComponent
destroy, isDestroyedMethods inherited from interface org.springframework.beans.factory.DisposableBean
destroyMethods inherited from interface net.shibboleth.shared.component.IdentifiedComponent
getIdMethods inherited from interface net.shibboleth.shared.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 logClass logger. -
scope
Scope value. Mutually exclusive withscopeSource -
scopeSource
Scope source. Mutually exclusive withscope -
nonScopeAttributeDependencies
@NonnullAfterInit private Collection<ResolverAttributeDefinitionDependency> nonScopeAttributeDependenciesThe attribute dependencies mine the scopeSource attribute (if there is one).
-
-
Constructor Details
-
ScopedAttributeDefinition
public ScopedAttributeDefinition()
-
-
Method Details
-
getScope
Get scope value.- Returns:
- Returns the scope.
-
setScope
Set the scope for this definition.- Parameters:
newScope- what to set.
-
getScopeSource
Get scope source (attribute id).- Returns:
- Returns the scope.
-
ensureNonScopeAttributeDependencies
@Nonnull private Collection<ResolverAttributeDefinitionDependency> ensureNonScopeAttributeDependencies()Null safe getter fornonScopeAttributeDependencies.- Returns:
- Returns the nonScopeAttributeDependencies.
-
setScopeSource
Set the source of the scope for this definition.- Parameters:
attributeId- what to set.
-
getScopeFromSource
@Nonnull @NotEmpty private String getScopeFromSource(@Nonnull AttributeResolverWorkContext workContext) throws ResolutionException Lookup the source attribute in the resolved list.- Parameters:
workContext- where to look- Returns:
- the single string value contained in the attribute
- Throws:
ResolutionException- if the attribute was not there or if it didn't have only one string value
-
doAttributeDefinitionResolve
@Nonnull 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
-
doInitialize
- Overrides:
doInitializein classAbstractAttributeDefinition- Throws:
ComponentInitializationException
-