Package net.shibboleth.idp.attribute.resolver

# Class ResolvedAttributeDefinition

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.ResolvedAttributeDefinition

All Implemented Interfaces:
  `AttributeDefinition`, `ResolverPlugin<IdPAttribute>`, `Component`, `DestructableComponent`, `IdentifiableComponent`, `IdentifiedComponent`, `InitializableComponent`, `UnmodifiableComponent`, `DisposableBean`

@ThreadSafe public final class ResolvedAttributeDefinition extends AbstractAttributeDefinition
A proxy which wraps a resolved attribute definition and always returns the same attribute. The goal being that once an attribute definition is resolved once this can be used in its place and calls to `ResolverPlugin.resolve(AttributeResolutionContext)` are "free". This proxy is immutable so all setter methods simply return.

## Field Summary

Fields
Modifier and Type
Field
Description
`private final IdPAttribute`
`resolvedAttribute`
The attribute produced by the resolved attribute definition.
`private final AttributeDefinition`
`resolvedDefinition`
The attribute definition that was resolved to produce the attribute.

## Constructor Summary

Constructors
Constructor
Description
`ResolvedAttributeDefinition(AttributeDefinition definition, IdPAttribute attribute)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`protected IdPAttribute`
`doAttributeDefinitionResolve(AttributeResolutionContext resolutionContext, AttributeResolverWorkContext workContext)`
Creates and populates the values for the resolved attribute.
`boolean`
`equals(Object obj)`
`Predicate<ProfileRequestContext>`
`getActivationCondition()`
Get the predicate which defines whether this plugin is active for a given request.
`Set<ResolverAttributeDefinitionDependency>`
`getAttributeDependencies()`
Gets the unmodifiable list of attributeDependencies for this plugin.
`Set<ResolverDataConnectorDependency>`
`getDataConnectorDependencies()`
Gets the unmodifiable list of dependencies for this plugin.
`String`
`getId()`
`IdPAttribute`
`getResolvedAttribute()`
Gets the resolved attribute.
`AttributeDefinition`
`getResolvedDefinition()`
Gets the wrapped attribute definition that was resolved.
`int`
`hashCode()`
`boolean`
`isDependencyOnly()`
Gets whether this attribute definition is only a dependency and thus its values should never be released outside the resolver.
`boolean`
`isInitialized()`
`boolean`
`isPropagateResolutionExceptions()`
Get whether a `ResolutionException` that occurred resolving attributes will be re-thrown.
`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`
`setPropagateResolutionExceptions(boolean propagate)`
Set whether an `AttributeResolutionContext` that occurred resolving attributes will be re-thrown.
`String`
`toString()`

### Methods inherited from class net.shibboleth.idp.attribute.resolver.AbstractAttributeDefinition

`doInitialize, doResolve, getLogPrefix, isPreRequested, setPreRequested`

### Methods inherited from class net.shibboleth.idp.attribute.resolver.AbstractResolverPlugin

`doDestroy, resolve, setActivationCondition, setAttributeDependencies, setDataConnectorDependencies`

### Methods inherited from class net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent

`setId`

### Methods inherited from class net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent

`ensureId, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException`

### Methods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent

`checkComponentActive, checkSetterPreconditions, destroy, initialize, isDestroyed`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface net.shibboleth.shared.component.DestructableComponent

`destroy, isDestroyed`

### Methods inherited from interface org.springframework.beans.factory.DisposableBean

`destroy`

### Methods inherited from interface net.shibboleth.shared.component.InitializableComponent

`initialize`

### Methods inherited from interface net.shibboleth.idp.attribute.resolver.ResolverPlugin

`resolve`

## Field Details

### resolvedDefinition

@Nonnull private final AttributeDefinition resolvedDefinition
The attribute definition that was resolved to produce the attribute.

### resolvedAttribute

@Nullable private final IdPAttribute resolvedAttribute
The attribute produced by the resolved attribute definition.

## Constructor Details

### ResolvedAttributeDefinition

public ResolvedAttributeDefinition(@Nonnull AttributeDefinition definition, @Nullable IdPAttribute attribute)
Constructor.

Parameters:
  `definition` - attribute definition that was resolved to produce the given attribute
  `attribute` - attribute produced by the given attribute definition

## Method Details

### 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:
  `doAttributeDefinitionResolve` in class `AbstractAttributeDefinition`
Parameters:
  `resolutionContext` - current attribute resolution context
  `workContext` - 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

### equals

public boolean equals(Object obj)

Overrides:
  `equals` in class `AbstractResolverPlugin<IdPAttribute>`

### getAttributeDependencies

@Nonnull public Set<ResolverAttributeDefinitionDependency> getAttributeDependencies()
Gets the unmodifiable list of attributeDependencies for this plugin.

Specified by:
  `getAttributeDependencies` in interface `ResolverPlugin<IdPAttribute>`
Overrides:
  `getAttributeDependencies` in class `AbstractResolverPlugin<IdPAttribute>`
Returns:
  unmodifiable list of dependencies for this plugin, never null.

### getDataConnectorDependencies

@Nonnull public Set<ResolverDataConnectorDependency> getDataConnectorDependencies()
Gets the unmodifiable list of dependencies for this plugin.

Specified by:
  `getDataConnectorDependencies` in interface `ResolverPlugin<IdPAttribute>`
Overrides:
  `getDataConnectorDependencies` in class `AbstractResolverPlugin<IdPAttribute>`
Returns:
  unmodifiable list of dependencies for this plugin, never null.

### getActivationCondition

@Nullable public Predicate<ProfileRequestContext> getActivationCondition()
Get the predicate which defines whether this plugin is active for a given request.

Specified by:
  `getActivationCondition` in interface `ResolverPlugin<IdPAttribute>`
Overrides:
  `getActivationCondition` in class `AbstractResolverPlugin<IdPAttribute>`
Returns:
  the predicate.

### getId

@Nonnull public String getId()

Specified by:
  `getId` in interface `IdentifiedComponent`
Overrides:
  `getId` in class `AbstractIdentifiedInitializableComponent`

### getResolvedAttribute

@Nullable public IdPAttribute getResolvedAttribute()
Gets the resolved attribute.

Returns:
  resolved attribute, or null

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `AbstractResolverPlugin<IdPAttribute>`

### 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 interface `AttributeDefinition`
Overrides:
  `isDependencyOnly` in class `AbstractAttributeDefinition`
Returns:
  true if this attribute is only used as a dependency, false otherwise

### isPropagateResolutionExceptions

public boolean isPropagateResolutionExceptions()
Get whether a `ResolutionException` that occurred resolving attributes will be re-thrown. Doing so will cause the entire attribute resolution request to fail.

Specified by:
  `isPropagateResolutionExceptions` in interface `ResolverPlugin<IdPAttribute>`
Overrides:
  `isPropagateResolutionExceptions` in class `AbstractResolverPlugin<IdPAttribute>`
Returns:
  true if `ResolutionException`s are propagated, false if not

### 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.

Overrides:
  `setDependencyOnly` in class `AbstractAttributeDefinition`
Parameters:
  `isDependencyOnly` - whether this attribute definition is only a dependency

### setPropagateResolutionExceptions

public void setPropagateResolutionExceptions(boolean propagate)
Set whether an `AttributeResolutionContext` that occurred resolving attributes will be re-thrown. Doing so will cause the entire attribute resolution request to fail.

Overrides:
  `setPropagateResolutionExceptions` in class `AbstractResolverPlugin<IdPAttribute>`
Parameters:
  `propagate` - true if `ResolutionException`s are propagated, false if not

### toString

@Nonnull public String toString()

Overrides:
  `toString` in class `Object`

### getResolvedDefinition

@Nonnull public AttributeDefinition getResolvedDefinition()
Gets the wrapped attribute definition that was resolved.

Returns:
  the resolved attribute definition

### isInitialized

public boolean isInitialized()

Specified by:
  `isInitialized` in interface `InitializableComponent`
Overrides:
  `isInitialized` in class `AbstractInitializableComponent`