Package net.shibboleth.idp.attribute.filter.context

# Class AttributeFilterWorkContext

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

All Implemented Interfaces:
  `Iterable<BaseContext>`

@NotThreadSafe public final class AttributeFilterWorkContext extends BaseContext
A context which carries and collects information through the attribute filtering process, and coordinates data between the filter implementation and the various resolver MatchFunctor implementations.

This should be considered a private API limited to plugin implementations.

## 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 final Map<String,Set<IdPAttributeValue>>`
`deniedValues`
Values, for a given attribute, that are not permitted to be released.
`private final Set<String>`
`filteredAttributeIds`
List of all Attribute names mentioned by a AttributeRule inside an active PolicyRule.
`private final Map<String,Set<IdPAttributeValue>>`
`permittedValues`
Values, for a given attribute, that are permitted to be released.

## Constructor Summary

Constructors
Constructor
Description
`AttributeFilterWorkContext()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`void`
`addDeniedIdPAttributeValues(String attributeId, Collection<IdPAttributeValue> attributeValues)`
Adds a collection of attribute values that are not permitted to be released.
`void`
`addFilteredAttributeId(String attributeId)`
Register an attribute ID as having been considered for filtering.
`void`
`addPermittedIdPAttributeValues(String attributeId, Collection<IdPAttributeValue> attributeValues)`
Adds a collection of attribute values that are permitted to be released.
`Map<String,Set<IdPAttributeValue>>`
`getDeniedAttributeValues()`
Gets the unmodifiable collection of attribute values, indexed by ID, that are not permitted to be released.
`Set<String>`
`getFilteredAttributeIds()`
Return all the attribute ids for activated AttributeRules.
`Map<String,Set<IdPAttributeValue>>`
`getPermittedIdPAttributeValues()`
Gets the collection of attribute values, indexed by ID, that are permitted to be released.

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

### permittedValues

@Nonnull private final Map<String,Set<IdPAttributeValue>> permittedValues
Values, for a given attribute, that are permitted to be released.

### deniedValues

@Nonnull private final Map<String,Set<IdPAttributeValue>> deniedValues
Values, for a given attribute, that are not permitted to be released.

### filteredAttributeIds

@Nonnull private final Set<String> filteredAttributeIds
List of all Attribute names mentioned by a AttributeRule inside an active PolicyRule.

## Constructor Details

### AttributeFilterWorkContext

public AttributeFilterWorkContext()
Constructor.

## Method Details

### getPermittedIdPAttributeValues

@Nonnull @Unmodifiable @NotLive public Map<String,Set<IdPAttributeValue>> getPermittedIdPAttributeValues()
Gets the collection of attribute values, indexed by ID, that are permitted to be released.

Returns:
  collection of attribute values, indexed by ID, that are permitted to be released,

### addPermittedIdPAttributeValues

public void addPermittedIdPAttributeValues(@Nonnull @NotEmpty String attributeId, @Nullable Collection<IdPAttributeValue> attributeValues) throws AttributeFilterException
Adds a collection of attribute values that are permitted to be released. Attempting to add values for an attribute that is not a member of `AttributeFilterContext.getPrefilteredIdPAttributes()` will result in an `IllegalArgumentException`. Attempting to add an attribute value that is not a member of `IdPAttribute.getValues()` will result in an `IllegalArgumentException`.

Parameters:
  `attributeId` - ID of the attribute whose values are permitted to be released
  `attributeValues` - values for the attribute that are permitted to be released
Throws:
  `AttributeFilterException` - if the context tree is invalid or the value(s) to add are not actually values of the attribute.

### getDeniedAttributeValues

@Nonnull @Unmodifiable @NotLive public Map<String,Set<IdPAttributeValue>> getDeniedAttributeValues()
Gets the unmodifiable collection of attribute values, indexed by ID, that are not permitted to be released.

Returns:
  collection of attribute values, indexed by ID, that are not permitted to be released

### addDeniedIdPAttributeValues

public void addDeniedIdPAttributeValues(@Nonnull @NotEmpty String attributeId, @Nullable Collection<IdPAttributeValue> attributeValues) throws AttributeFilterException
Adds a collection of attribute values that are not permitted to be released. Attempting to add values for an attribute that is not a member of `AttributeFilterContext.getPrefilteredIdPAttributes()` will result in an `IllegalArgumentException`. Attempting to add an attribute value that is not a member of `IdPAttribute.getValues()` will result in an `IllegalArgumentException`.

Parameters:
  `attributeId` - ID of the attribute whose values are not permitted to be released
  `attributeValues` - values for the attribute that are not permitted to be released
Throws:
  `AttributeFilterException` - if the context tree is invalid or if the values being denied are not in fact values of the attribute

### addFilteredAttributeId

public void addFilteredAttributeId(@Nonnull String attributeId)
Register an attribute ID as having been considered for filtering.

Parameters:
  `attributeId` - the ID

### getFilteredAttributeIds

@Nonnull public Set<String> getFilteredAttributeIds()
Return all the attribute ids for activated AttributeRules.

Returns:
  the set made up from multiple calls to `addFilteredAttributeId(String)`