Class PrescopedAttributeDefinition
- 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.PrescopedAttributeDefinition
-
- All Implemented Interfaces:
AttributeDefinition,ResolverPlugin<IdPAttribute>,Component,DestructableComponent,IdentifiableComponent,IdentifiedComponent,InitializableComponent,UnmodifiableComponent,DisposableBean
@ThreadSafe public class PrescopedAttributeDefinition extends AbstractAttributeDefinition
An attribute definition that createsScopedStringAttributeValues by taking a source attribute value splitting it at a delimiter. The first atom becomes the attribute value and the second value becomes the scope.
-
-
Field Summary
Fields Modifier and Type Field Description private org.slf4j.LoggerlogClass logger.private StringscopeDelimiterDelimiter between value and scope.
-
Constructor Summary
Constructors Constructor Description PrescopedAttributeDefinition()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private IdPAttributeValuebuildScopedStringAttributeValue(StringAttributeValue value)Builds aScopedStringAttributeValuefrom aStringAttributeValuewhose value contains a delimited value.protected IdPAttributedoAttributeDefinitionResolve(AttributeResolutionContext resolutionContext, AttributeResolverWorkContext workContext)Creates and populates the values for the resolved attribute.protected voiddoInitialize()StringgetScopeDelimiter()Get delimiter between value and scope.voidsetScopeDelimiter(String newScopeDelimiter)Set the delimiter between value and scope.-
Methods inherited from class net.shibboleth.idp.attribute.resolver.AbstractAttributeDefinition
doResolve, getLogPrefix, isDependencyOnly, isPreRequested, setDependencyOnly, setPreRequested
-
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.
-
scopeDelimiter
private String scopeDelimiter
Delimiter between value and scope. Default value: @
-
-
Method Detail
-
getScopeDelimiter
@Nonnull public String getScopeDelimiter()
Get delimiter between value and scope.- Returns:
- delimiter between value and scope
-
setScopeDelimiter
public void setScopeDelimiter(@Nonnull @NotEmpty String newScopeDelimiter)
Set the delimiter between value and scope.- Parameters:
newScopeDelimiter- delimiter between value and scope
-
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
-
buildScopedStringAttributeValue
@Nonnull private IdPAttributeValue buildScopedStringAttributeValue(@Nonnull StringAttributeValue value) throws ResolutionException
Builds aScopedStringAttributeValuefrom aStringAttributeValuewhose value contains a delimited value.- Parameters:
value- the original attribute value- Returns:
- the scoped attribute value
- Throws:
ResolutionException- thrown if the given attribute value does not contain a delimited value
-
doInitialize
protected void doInitialize() throws ComponentInitializationException- Overrides:
doInitializein classAbstractAttributeDefinition- Throws:
ComponentInitializationException
-
-