Class MappedAttributeDefinition
- 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.mapped.impl.MappedAttributeDefinition
-
- All Implemented Interfaces:
AttributeDefinition,ResolverPlugin<IdPAttribute>,Component,DestructableComponent,IdentifiableComponent,IdentifiedComponent,InitializableComponent,UnmodifiableComponent,DisposableBean
@ThreadSafe public class MappedAttributeDefinition extends AbstractAttributeDefinition
Implementation of Mapped Attributes.An attribute definition that takes the values from previous resolution stages and converts them as it creates the output attribute. Each value is compared with a lookup table (a
Collectionof @link{ValueMap}s) and if it matches then the appropriate value(s) is/are substituted. Non matches are either passed through or are removed depending on the setting 'passThru'.
-
-
Field Summary
Fields Modifier and Type Field Description private StringAttributeValuedefaultValueDefault return value.private org.slf4j.LoggerlogClass logger.private booleanpassThruWhether the definition passes thru unmatched values.private Set<ValueMap>valueMapsValue maps.
-
Constructor Summary
Constructors Constructor Description MappedAttributeDefinition()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected IdPAttributedoAttributeDefinitionResolve(AttributeResolutionContext resolutionContext, AttributeResolverWorkContext workContext)protected voiddoDestroy()protected voiddoInitialize()StringAttributeValuegetDefaultAttributeValue()Gets the default return value.StringgetDefaultValue()Gets the default return value.Collection<ValueMap>getValueMaps()Gets the functions used to map an input value to an output value.booleanisPassThru()Gets whether the definition passes unmatched values through.protected List<StringAttributeValue>mapValue(String value)Maps the value from a dependency in to the value(s) for this attribute.voidsetDefaultValue(String newDefaultValue)Sets the default return value.voidsetPassThru(boolean newPassThru)Sets whether the definition passes unmatched values through.voidsetValueMaps(Collection<ValueMap> mappings)Sets the functions used to map an input value to an output value.-
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, 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.
-
valueMaps
@Nonnull @NonnullElements private Set<ValueMap> valueMaps
Value maps.
-
passThru
private boolean passThru
Whether the definition passes thru unmatched values.
-
defaultValue
@Nullable private StringAttributeValue defaultValue
Default return value.
-
-
Method Detail
-
getValueMaps
@Nonnull @NonnullElements @Unmodifiable public Collection<ValueMap> getValueMaps()
Gets the functions used to map an input value to an output value.- Returns:
- functions used to map an input value to an output value
-
setValueMaps
public void setValueMaps(@Nullable @NonnullElements Collection<ValueMap> mappings)
Sets the functions used to map an input value to an output value.- Parameters:
mappings- functions used to map an input value to an output value
-
getDefaultAttributeValue
@Nullable public StringAttributeValue getDefaultAttributeValue()
Gets the default return value.- Returns:
- the default return value.
-
getDefaultValue
@Nullable public String getDefaultValue()
Gets the default return value.- Returns:
- the default return value.
-
setDefaultValue
public void setDefaultValue(@Nullable String newDefaultValue)Sets the default return value.- Parameters:
newDefaultValue- the default return value
-
isPassThru
public boolean isPassThru()
Gets whether the definition passes unmatched values through.- Returns:
- whether the definition passes unmatched values unchanged or suppresses them.
-
setPassThru
public void setPassThru(boolean newPassThru)
Sets whether the definition passes unmatched values through.- Parameters:
newPassThru- whether the definition passes unmatched values unchanged or suppresses them.
-
mapValue
protected List<StringAttributeValue> mapValue(@Nullable String value)
Maps the value from a dependency in to the value(s) for this attribute.- Parameters:
value- the value from the dependency- Returns:
- the set of attribute values that the given dependency value maps in to
-
doAttributeDefinitionResolve
@Nullable protected IdPAttribute doAttributeDefinitionResolve(@Nonnull AttributeResolutionContext resolutionContext, @Nonnull AttributeResolverWorkContext workContext) throws ResolutionException
- Specified by:
doAttributeDefinitionResolvein classAbstractAttributeDefinition- Throws:
ResolutionException
-
doDestroy
protected void doDestroy()
- Overrides:
doDestroyin classAbstractResolverPlugin<IdPAttribute>
-
doInitialize
protected void doInitialize() throws ComponentInitializationException- Overrides:
doInitializein classAbstractAttributeDefinition- Throws:
ComponentInitializationException
-
-