Class AbstractAttributeDefinition
- 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
-
- All Implemented Interfaces:
AttributeDefinition,ResolverPlugin<IdPAttribute>,Component,DestructableComponent,IdentifiableComponent,IdentifiedComponent,InitializableComponent,UnmodifiableComponent,DisposableBean
- Direct Known Subclasses:
ContextDerivedAttributeDefinition,DateTimeAttributeDefinition,DecryptedAttributeDefinition,MappedAttributeDefinition,PrescopedAttributeDefinition,PrincipalNameAttributeDefinition,RegexSplitAttributeDefinition,ResolvedAttributeDefinition,SAML1NameIdentifierAttributeDefinition,SAML2NameIDAttributeDefinition,ScopedAttributeDefinition,ScriptedAttributeDefinition,SimpleAttributeDefinition,StaticAttributeDefinition,TemplateAttributeDefinition
@ThreadSafe public abstract class AbstractAttributeDefinition extends AbstractResolverPlugin<IdPAttribute> implements AttributeDefinition
Base class for attribute definition resolver plugins.
-
-
Field Summary
Fields Modifier and Type Field Description private booleandependencyOnlyWhether this attribute definition is only a dependency and thus its values should never be released.private org.slf4j.LoggerlogClass logger.private StringlogPrefixcache for the log prefix - to save multiple recalculations.private booleanpreRequestedWhether this attribute definition is to be pre-resolved.
-
Constructor Summary
Constructors Constructor Description AbstractAttributeDefinition()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract IdPAttributedoAttributeDefinitionResolve(AttributeResolutionContext resolutionContext, AttributeResolverWorkContext workContext)Creates and populates the values for the resolved attribute.protected voiddoInitialize()protected IdPAttributedoResolve(AttributeResolutionContext resolutionContext, AttributeResolverWorkContext workContext)Perform the actual resolution.protected StringgetLogPrefix()return a string which is to be prepended to all log messages.booleanisDependencyOnly()Gets whether this attribute definition is only a dependency and thus its values should never be released outside the resolver.booleanisPreRequested()Gets whether this attribute definition has to be resolved prior in a first pass (in order to prime contexts which can be used in the "main pass").voidsetDependencyOnly(boolean isDependencyOnly)Sets whether this attribute definition is only a dependency and thus its values should never be released outside the resolver.voidsetPreRequested(boolean value)Sets whether this definition (and its dependencies) are to be pre-resolved.-
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.
-
dependencyOnly
private boolean dependencyOnly
Whether this attribute definition is only a dependency and thus its values should never be released.
-
preRequested
private boolean preRequested
Whether this attribute definition is to be pre-resolved.
-
logPrefix
@Nullable private String logPrefix
cache for the log prefix - to save multiple recalculations.
-
-
Method Detail
-
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- Returns:
- true if this attribute is only used as a dependency, false otherwise
-
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.- Parameters:
isDependencyOnly- whether this attribute definition is only a dependency
-
isPreRequested
public boolean isPreRequested()
Gets whether this attribute definition has to be resolved prior in a first pass (in order to prime contexts which can be used in the "main pass").- Specified by:
isPreRequestedin interfaceAttributeDefinition- Returns:
- true if this is a definition to be done "first"
-
setPreRequested
public void setPreRequested(boolean value)
Sets whether this definition (and its dependencies) are to be pre-resolved.- Parameters:
value- what to set
-
doInitialize
protected void doInitialize() throws ComponentInitializationException- Overrides:
doInitializein classAbstractResolverPlugin<IdPAttribute>- Throws:
ComponentInitializationException
-
doResolve
@Nullable protected IdPAttribute doResolve(@Nonnull AttributeResolutionContext resolutionContext, @Nonnull AttributeResolverWorkContext workContext) throws ResolutionException
Perform the actual resolution. The resolved attribute(s) should not be recorded in the work context. This method delegates the actual resolution of the attribute's values to thedoAttributeDefinitionResolve(AttributeResolutionContext, AttributeResolverWorkContext)method. Afterwards, if null was not returned, this method will attach the registered display names, descriptions, and encoders to the resultant attribute.- Specified by:
doResolvein classAbstractResolverPlugin<IdPAttribute>- Parameters:
resolutionContext- current resolution contextworkContext- child context where intermediate results are tracked- Returns:
- the resolved attributes or null if no attributes were resolved
- Throws:
ResolutionException- thrown if there is a problem resolving the attributes- See Also:
AbstractResolverPlugin.resolve(AttributeResolutionContext)
-
doAttributeDefinitionResolve
@Nullable protected abstract 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.- 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
-
getLogPrefix
@Nonnull @NotEmpty protected String getLogPrefix()
return a string which is to be prepended to all log messages.- Specified by:
getLogPrefixin classAbstractResolverPlugin<IdPAttribute>- Returns:
- "Attribute Definition '<definitionID>' :"
-
-