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
,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
FieldsModifier and TypeFieldDescriptionprivate boolean
Whether this attribute definition is only a dependency and thus its values should never be released.private final org.slf4j.Logger
Class logger.private String
cache for the log prefix - to save multiple recalculations.private boolean
Whether this attribute definition is to be pre-resolved. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract IdPAttribute
doAttributeDefinitionResolve
(AttributeResolutionContext resolutionContext, AttributeResolverWorkContext workContext) Creates and populates the values for the resolved attribute.protected void
protected IdPAttribute
doResolve
(AttributeResolutionContext resolutionContext, AttributeResolverWorkContext workContext) Perform the actual resolution.protected String
return a string which is to be prepended to all log messages.boolean
Gets whether this attribute definition is only a dependency and thus its values should never be released outside the resolver.boolean
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").void
setDependencyOnly
(boolean isDependencyOnly) Sets whether this attribute definition is only a dependency and thus its values should never be released outside the resolver.void
setPreRequested
(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 Details
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
dependencyOnly
private boolean dependencyOnlyWhether this attribute definition is only a dependency and thus its values should never be released. -
preRequested
private boolean preRequestedWhether this attribute definition is to be pre-resolved. -
logPrefix
cache for the log prefix - to save multiple recalculations.
-
-
Constructor Details
-
AbstractAttributeDefinition
public AbstractAttributeDefinition()
-
-
Method Details
-
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:
isDependencyOnly
in 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:
isPreRequested
in 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
- Overrides:
doInitialize
in 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:
doResolve
in 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:
-
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
return a string which is to be prepended to all log messages.- Specified by:
getLogPrefix
in classAbstractResolverPlugin<IdPAttribute>
- Returns:
- "Attribute Definition '<definitionID>' :"
-