Package net.shibboleth.idp.attribute.context

# Class AttributeContext

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

All Implemented Interfaces:
  `Iterable<BaseContext>`

@NotThreadSafe public final class AttributeContext extends BaseContext
A `BaseContext` that tracks a set of attributes. Usually the tracked attributes are about a particular user and associated with a particular service request.

## 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 Map<String,IdPAttribute>`
`attributes`
The attributes tracked by this context.
`private boolean`
`consented`
Whether attribute release consent was obtained from the subject.
`private Map<String,IdPAttribute>`
`unfilteredAttributes`
The attributes tracked by this context prior to filtering.

## Constructor Summary

Constructors
Constructor
Description
`AttributeContext()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`Map<String,IdPAttribute>`
`getIdPAttributes()`
Gets the map of attributes, indexed by attribute ID, tracked by this context.
`Map<String,IdPAttribute>`
`getUnfilteredIdPAttributes()`
Gets the map of unfiltered attributes, indexed by attribute ID, tracked by this context.
`boolean`
`isConsented()`
Gets whether attribute release consent was obtained from the subject during this request but not stored.
`AttributeContext`
`setConsented(boolean flag)`
Sets whether attribute release consent was obtained from the subject during this request but not stored.
`AttributeContext`
`setIdPAttributes(Collection<IdPAttribute> newAttributes)`
Deprecated, for removal: This API element is subject to removal in a future version.
`AttributeContext`
`setIdPAttributes(Map<String,IdPAttribute> newAttributes)`
Sets the attributes tracked by this context.
`AttributeContext`
`setUnfilteredIdPAttributes(Collection<IdPAttribute> newAttributes)`
Deprecated, for removal: This API element is subject to removal in a future version.
`AttributeContext`
`setUnfilteredIdPAttributes(Map<String,IdPAttribute> newAttributes)`
Sets the unfiltered attributes tracked by this context.

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

### attributes

@Nonnull private Map<String,IdPAttribute> attributes
The attributes tracked by this context.

### unfilteredAttributes

@Nonnull private Map<String,IdPAttribute> unfilteredAttributes
The attributes tracked by this context prior to filtering.

### consented

private boolean consented
Whether attribute release consent was obtained from the subject.

## Constructor Details

### AttributeContext

public AttributeContext()
Constructor.

## Method Details

### getIdPAttributes

@Nonnull @Unmodifiable @NotLive public Map<String,IdPAttribute> getIdPAttributes()
Gets the map of attributes, indexed by attribute ID, tracked by this context.

Returns:
  the collection of attributes indexed by attribute ID

### setIdPAttributes

@Deprecated(since="5.2.0", forRemoval=true) @Nonnull public AttributeContext setIdPAttributes(@Nullable Collection<IdPAttribute> newAttributes)
Deprecated, for removal: This API element is subject to removal in a future version.
Sets the attributes tracked by this context.

Parameters:
  `newAttributes` - the attributes
Returns:
  this context

### setIdPAttributes

@Nonnull public AttributeContext setIdPAttributes(@Nullable Map<String,IdPAttribute> newAttributes)
Sets the attributes tracked by this context.

Parameters:
  `newAttributes` - the attributes
Returns:
  this context
Since:
  5.2.0

### getUnfilteredIdPAttributes

@Nonnull @Unmodifiable @NotLive public Map<String,IdPAttribute> getUnfilteredIdPAttributes()
Gets the map of unfiltered attributes, indexed by attribute ID, tracked by this context.

Returns:
  the collection of attributes indexed by attribute ID

### setUnfilteredIdPAttributes

@Deprecated(since="5.2.0", forRemoval=true) @Nonnull public AttributeContext setUnfilteredIdPAttributes(@Nullable Collection<IdPAttribute> newAttributes)
Deprecated, for removal: This API element is subject to removal in a future version.
Sets the unfiltered attributes tracked by this context.

Parameters:
  `newAttributes` - the attributes
Returns:
  this context

### setUnfilteredIdPAttributes

@Nonnull public AttributeContext setUnfilteredIdPAttributes(@Nullable Map<String,IdPAttribute> newAttributes)
Sets the unfiltered attributes tracked by this context.

Parameters:
  `newAttributes` - the attributes
Returns:
  this context
Since:
  5.2.0

### isConsented

public boolean isConsented()
Gets whether attribute release consent was obtained from the subject during this request but not stored.

Returns:
  true iff consent was obtained during this request but not stored
Since:
  4.2.0

### setConsented

@Nonnull public AttributeContext setConsented(boolean flag)
Sets whether attribute release consent was obtained from the subject during this request but not stored.

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