Package net.shibboleth.idp.attribute.resolver.context

# Class AttributeResolutionContext

java.lang.Object
org.opensaml.messaging.context.BaseContext
net.shibboleth.idp.attribute.resolver.context.AttributeResolutionContext

All Implemented Interfaces:
  `Iterable<BaseContext>`

@NotThreadSafe public final class AttributeResolutionContext extends BaseContext
A context supplying input to the `AttributeResolver` interface.

## Nested Class Summary

## Nested classes/interfaces inherited from class org.opensaml.messaging.context.BaseContext

`BaseContext.ContextSetNoRemoveIteratorDecorator, BaseContext.DeprecatedContextClassNameLookAside`

## Field Summary

Fields
Modifier and Type
Field
Description
`private boolean`
`allowCachedResults`
Whether the resolver should allow for results to come from cache.
`private String`
`attributeIssuerID`
The attribute source identity.
`private String`
`attributeRecipientGroupID`
The attribute recipient's group identity.
`private String`
`attributeRecipientID`
The attribute recipient identity.
`private Function<AttributeResolutionContext,ProfileRequestContext>`
`prcLookupStrategy`
Strategy used to locate the `ProfileRequestContext` to use.
`private String`
`principal`
The principal associated with this resolution.
`private Set<String>`
`requestedAttributeNames`
(internal) Names of the attributes that have been requested to be resolved.
`private String`
`resolutionLabel`
Label distinguishing different "types" of attribute resolution for use in resolver.
`private Map<String,IdPAttribute>`
`resolvedAttributes`
Attributes which were resolved and released by the attribute resolver.

## Constructor Summary

Constructors
Constructor
Description
`AttributeResolutionContext()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`boolean`
`getAllowCachedResults()`
Get whether to allow for results from cache (defaults to true).
`String`
`getAttributeIssuerID()`
Get the attribute issuer associated with this resolution.
`String`
`getAttributeRecipientGroupID()`
Get the attribute recipient grouping associated with this resolution.
`String`
`getAttributeRecipientID()`
Get the attribute recipient associated with this resolution.
`String`
`getPrincipal()`
Get the principal name associated with this resolution.
`Function<AttributeResolutionContext,ProfileRequestContext>`
`getProfileRequestContextLookupStrategy()`
Gets the strategy used to locate the `ProfileRequestContext` associated with this context.
`Collection<String>`
`getRequestedIdPAttributeNames()`
Get a live collection of the (internal) names of the attributes requested to be resolved.
`String`
`getResolutionLabel()`
Get the optional "contextual" label associated with this attribute resolution.
`Map<String,IdPAttribute>`
`getResolvedIdPAttributes()`
Get the collection of resolved attributes.
`void`
`resolveAttributes(ReloadableService<AttributeResolver> attributeResolverService)`
Helper method to invoke an AttributeResolver service using this context.
`AttributeResolutionContext`
`setAllowCachedResults(boolean flag)`
Set whether to allow for results from cache.
`AttributeResolutionContext`
`setAttributeIssuerID(String value)`
Set the attribute issuer associated with this resolution.
`AttributeResolutionContext`
`setAttributeRecipientGroupID(String value)`
Set the attribute recipient grouping associated with this resolution.
`AttributeResolutionContext`
`setAttributeRecipientID(String value)`
Set the attribute recipient associated with this resolution.
`AttributeResolutionContext`
`setPrincipal(String who)`
Set the principal associated with this resolution.
`AttributeResolutionContext`
`setProfileRequestContextLookupStrategy(Function<AttributeResolutionContext,ProfileRequestContext> strategy)`
Set the strategy used to locate the `ProfileRequestContext` associated with this context.
`AttributeResolutionContext`
`setRequestedIdPAttributeNames(Collection<String> names)`
Set the (internal) names of the attributes requested to be resolved.
`AttributeResolutionContext`
`setResolutionLabel(String label)`
Set the optional "contextual" label associated with this attribute resolution.
`AttributeResolutionContext`
`setResolvedIdPAttributes(Collection<IdPAttribute> attributes)`
Set the set of resolved attributes.

### Methods inherited from class org.opensaml.messaging.context.BaseContext

`addSubcontext, addSubcontext, clearSubcontexts, containsSubcontext, createSubcontext, ensureSubcontext, ensureSubcontext, getParent, getSubcontext, getSubcontext, getSubcontext, getSubcontext, iterator, removeFromParent, removeSubcontext, removeSubcontext, setParent`

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

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface java.lang.Iterable

`forEach, spliterator`

## Field Details

### requestedAttributeNames

@Nonnull private Set<String> requestedAttributeNames
(internal) Names of the attributes that have been requested to be resolved.

### prcLookupStrategy

@Nonnull private Function<AttributeResolutionContext,ProfileRequestContext> prcLookupStrategy
Strategy used to locate the `ProfileRequestContext` to use.

### principal

@Nullable private String principal
The principal associated with this resolution.

### attributeIssuerID

@Nullable private String attributeIssuerID
The attribute source identity.

### attributeRecipientID

@Nullable private String attributeRecipientID
The attribute recipient identity.

### attributeRecipientGroupID

@Nullable private String attributeRecipientGroupID
The attribute recipient's group identity.

### allowCachedResults

private boolean allowCachedResults
Whether the resolver should allow for results to come from cache.

### resolutionLabel

@Nullable private String resolutionLabel
Label distinguishing different "types" of attribute resolution for use in resolver.

### resolvedAttributes

@Nonnull private Map<String,IdPAttribute> resolvedAttributes
Attributes which were resolved and released by the attribute resolver.

## Constructor Details

### AttributeResolutionContext

public AttributeResolutionContext()
Constructor.

## Method Details

### getProfileRequestContextLookupStrategy

@Nonnull public Function<AttributeResolutionContext,ProfileRequestContext> getProfileRequestContextLookupStrategy()
Gets the strategy used to locate the `ProfileRequestContext` associated with this context.

Returns:
  lookup strategy
Since:
  5.0.0

### setProfileRequestContextLookupStrategy

@Nonnull public AttributeResolutionContext setProfileRequestContextLookupStrategy(@Nonnull Function<AttributeResolutionContext,ProfileRequestContext> strategy)
Set the strategy used to locate the `ProfileRequestContext` associated with this context.

Parameters:
  `strategy` - strategy used to locate the `ProfileRequestContext` associated with a given `AttributeResolutionContext`
Returns:
  this context
Since:
  5.0.0

### getAllowCachedResults

public boolean getAllowCachedResults()
Get whether to allow for results from cache (defaults to true).

Returns:
  whether to allow for results from cache
Since:
  3.3.0

### setAllowCachedResults

@Nonnull public AttributeResolutionContext setAllowCachedResults(boolean flag)
Set whether to allow for results from cache.

Parameters:
  `flag` - flag to set
Returns:
  this context
Since:
  3.3.0

### getResolutionLabel

@Nullable public String getResolutionLabel()
Get the optional "contextual" label associated with this attribute resolution.

Plugins/scripts/etc. that run the resolver directly can use this field to control the resolver's behavior based on what component is requesting the resolution.

Returns:
  label
Since:
  3.4.0

### setResolutionLabel

@Nonnull public AttributeResolutionContext setResolutionLabel(@Nullable String label)
Set the optional "contextual" label associated with this attribute resolution.

Parameters:
  `label` - label to set
Returns:
  this context
Since:
  3.4.0

### getAttributeIssuerID

@Nullable public String getAttributeIssuerID()
Get the attribute issuer associated with this resolution.

This is typically the identity of the system performing the resolution, i.e., the eventual issuer of any protocol messages containing the data.

Returns:
  the attribute issuer associated with this resolution.

### setAttributeIssuerID

@Nonnull public AttributeResolutionContext setAttributeIssuerID(@Nullable String value)
Set the attribute issuer associated with this resolution.

Parameters:
  `value` - the attribute issuer associated with this resolution.
Returns:
  this context

### getAttributeRecipientID

@Nullable public String getAttributeRecipientID()
Get the attribute recipient associated with this resolution.

This is typically the identity of the peer on whose behalf the resolution is being performed, i.e., the eventual recipient of any protocol messages containing the data.

Returns:
  the attribute recipient associated with this resolution.

### setAttributeRecipientID

@Nonnull public AttributeResolutionContext setAttributeRecipientID(@Nullable String value)
Set the attribute recipient associated with this resolution.

Parameters:
  `value` - the attribute recipient associated with this resolution.
Returns:
  this context

### getAttributeRecipientGroupID

@Nullable public String getAttributeRecipientGroupID()
Get the attribute recipient grouping associated with this resolution.

This is a protocol-independent way to represent an association between the attribute recipient and some larger group of recipients that may be relevant to attribute resolution.

Returns:
  the attribute recipient group associated with this resolution
Since:
  3.4.0

### setAttributeRecipientGroupID

@Nonnull public AttributeResolutionContext setAttributeRecipientGroupID(@Nullable String value)
Set the attribute recipient grouping associated with this resolution.

Parameters:
  `value` - the attribute recipient group associated with this resolution
Returns:
  this context
Since:
  3.4.0

### getPrincipal

@Nullable public String getPrincipal()
Get the principal name associated with this resolution.

This is usually, though not necessarily, a normalized value resulting from authentication by other software components.

Returns:
  the principal

### setPrincipal

@Nonnull public AttributeResolutionContext setPrincipal(@Nullable String who)
Set the principal associated with this resolution.

Parameters:
  `who` - the principal to set
Returns:
  this context

### getRequestedIdPAttributeNames

@Nonnull @Live public Collection<String> getRequestedIdPAttributeNames()
Get a live collection of the (internal) names of the attributes requested to be resolved.

Returns:
  live collection of attributes requested to be resolved

### setRequestedIdPAttributeNames

@Nonnull public AttributeResolutionContext setRequestedIdPAttributeNames(@Nonnull Collection<String> names)
Set the (internal) names of the attributes requested to be resolved.

Parameters:
  `names` - the (internal) names of the attributes requested to be resolved
Returns:
  this context

### getResolvedIdPAttributes

@Nonnull @Unmodifiable @NotLive public Map<String,IdPAttribute> getResolvedIdPAttributes()
Get the collection of resolved attributes.

Returns:
  set of resolved attributes

### setResolvedIdPAttributes

@Nonnull public AttributeResolutionContext setResolvedIdPAttributes(@Nonnull Collection<IdPAttribute> attributes)
Set the set of resolved attributes.

Parameters:
  `attributes` - set of resolved attributes
Returns:
  this context

### resolveAttributes

public void resolveAttributes(@Nonnull ReloadableService<AttributeResolver> attributeResolverService)
Helper method to invoke an AttributeResolver service using this context.

Parameters:
  `attributeResolverService` - the service to invoke
Since:
  3.3.0