Class MappedAttributeDefinition
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.mapped.impl.MappedAttributeDefinition
- All Implemented Interfaces:
AttributeDefinition,ResolverPlugin<IdPAttribute>,Component,DestructableComponent,IdentifiableComponent,IdentifiedComponent,InitializableComponent,UnmodifiableComponent,DisposableBean
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 Collection of @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
FieldsModifier and TypeFieldDescriptionprivate StringAttributeValueDefault return value.private final org.slf4j.LoggerClass logger.private booleanWhether the definition passes thru unmatched values.Value maps. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected IdPAttributedoAttributeDefinitionResolve(AttributeResolutionContext resolutionContext, AttributeResolverWorkContext workContext) Creates and populates the values for the resolved attribute.protected voidGets the default return value.Gets the default return value.Gets the functions used to map an input value to an output value.booleanGets whether the definition passes unmatched values through.protected List<StringAttributeValue>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, 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. -
valueMaps
Value maps. -
passThru
private boolean passThruWhether the definition passes thru unmatched values. -
defaultValue
Default return value.
-
-
Constructor Details
-
MappedAttributeDefinition
public MappedAttributeDefinition()
-
-
Method Details
-
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
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
Gets the default return value.- Returns:
- the default return value.
-
getDefaultValue
Gets the default return value.- Returns:
- the default return value.
-
setDefaultValue
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
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 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
-