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

# Class AttributeFilterContext

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

All Implemented Interfaces:
  `Iterable<BaseContext>`

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

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static enum`
`AttributeFilterContext.Direction`
Used to indicate the "direction" of filtering relative to the IdP.

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

`BaseContext.ContextSetNoRemoveIteratorDecorator, BaseContext.DeprecatedContextClassNameLookAside`

## Field Summary

Fields
Modifier and Type
Field
Description
`private String`
`attributeIssuerID`
The attribute source identity.
`private String`
`attributeRecipientGroupID`
The attribute recipient's group identity.
`private String`
`attributeRecipientID`
The attribute recipient identity.
`private AttributeFilterContext.Direction`
`direction`
Direction of filtering.
`private Map<String,IdPAttribute>`
`filteredAttributes`
Attributes which have been filtered.
`private boolean`
`includeUnfilteredAttributes`
Do we include unfiltered attributes into the resolution?
`private SAMLMetadataContext`
`issuerMetadataContext`
Cache of issuer metadata context.
`private Function<AttributeFilterContext,SAMLMetadataContext>`
`issuerMetadataContextLookupStrategy`
Lookup strategy used to locate the IdP's metadata context.
`private MetadataResolver`
`metadataResolver`
Optional, supplemental metadata resolver.
`private Map<String,IdPAttribute>`
`prefilteredAttributes`
Attributes which are to be filtered.
`private String`
`principal`
The principal associated with the filtering.
`private Function<AttributeFilterContext,ProfileRequestContext>`
`profileRequestContextLookupStrategy`
Lookup strategy used to locate profile request context for the request.
`private ProxiedRequesterContext`
`proxiedRequesterContext`
Cache of the proxied requester context.
`private Function<AttributeFilterContext,ProxiedRequesterContext>`
`proxiedRequesterContextLookupStrategy`
Lookup strategy used to locate a `ProxiedRequesterContext`.
`private SAMLMetadataContext`
`proxiedRequesterMetadataContext`
Cache of proxied requester metadata context.
`private Function<AttributeFilterContext,SAMLMetadataContext>`
`proxiedRequesterMetadataContextLookupStrategy`
Lookup strategy used to locate a proxied requester's metadata context.
`private SAMLMetadataContext`
`requesterMetadataContext`
Cache of requester metadata context.
`private Function<AttributeFilterContext,SAMLMetadataContext>`
`requesterMetadataContextLookupStrategy`
Lookup strategy used to locate the SP's metadata context.

## Constructor Summary

Constructors
Constructor
Description
`AttributeFilterContext()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`void`
`filterAttributes(ReloadableService<AttributeFilter> attributeFilterService)`
Helper method to invoke an AttributeFilter service using this context.
`String`
`getAttributeIssuerID()`
Gets the attribute issuer (me) associated with this filtering.
`String`
`getAttributeRecipientGroupID()`
Get the attribute recipient grouping associated with this filtering.
`String`
`getAttributeRecipientID()`
Gets the attribute recipient (her) associated with this filtering.
`AttributeFilterContext.Direction`
`getDirection()`
Gets the direction of filtering.
`Map<String,IdPAttribute>`
`getFilteredIdPAttributes()`
Gets the collection of attributes, indexed by ID, left after the filtering process has run.
`SAMLMetadataContext`
`getIssuerMetadataContext()`
Get the Issuer Metadata context.
`Function<AttributeFilterContext,SAMLMetadataContext>`
`getIssuerMetadataContextLookupStrategy()`
Get the strategy used to locate the IdP's metadata context.
`MetadataResolver`
`getMetadataResolver()`
Get supplemental source of metadata for filtering rules.
`Map<String,IdPAttribute>`
`getPrefilteredIdPAttributes()`
Gets the collection of attributes that are to be filtered, indexed by attribute ID.
`String`
`getPrincipal()`
Sets the principal associated with the filtering.
`Function<AttributeFilterContext,ProfileRequestContext>`
`getProfileRequestContextLookupStrategy()`
Gets the lookup strategy for locating the profile request context.
`ProxiedRequesterContext`
`getProxiedRequesterContext()`
Get the `ProxiedRequesterContext`.
`Function<AttributeFilterContext,ProxiedRequesterContext>`
`getProxiedRequesterContextLookupStrategy()`
Get the strategy used to locate the `ProxiedRequesterContext`.
`SAMLMetadataContext`
`getProxiedRequesterMetadataContext()`
Get the Proxied Requester Metadata context.
`Function<AttributeFilterContext,SAMLMetadataContext>`
`getProxiedRequesterMetadataContextLookupStrategy()`
Get the strategy used to locate a proxied requester's metadata context.
`SAMLMetadataContext`
`getRequesterMetadataContext()`
Get the Requester Metadata context.
`Function<AttributeFilterContext,SAMLMetadataContext>`
`getRequesterMetadataContextLookupStrategy()`
Get the strategy used to locate the SP's metadata context.
`boolean`
`isIncludeUnfilteredAttributes()`
Will we include unfiltered attributes in the result?
`AttributeFilterContext`
`setAttributeIssuerID(String value)`
Sets the attribute issuer (me) associated with this filtering.
`AttributeFilterContext`
`setAttributeRecipientGroupID(String value)`
Set the attribute recipient grouping associated with this filtering.
`AttributeFilterContext`
`setAttributeRecipientID(String value)`
Sets the attribute recipient (her) associated with this filtering.
`AttributeFilterContext`
`setDirection(AttributeFilterContext.Direction dir)`
Sets the direction of filtering.
`AttributeFilterContext`
`setFilteredIdPAttributes(Collection<IdPAttribute> attributes)`
Deprecated, for removal: This API element is subject to removal in a future version.
`AttributeFilterContext`
`setFilteredIdPAttributes(Map<String,IdPAttribute> attributes)`
Sets the attributes that have been filtered.
`AttributeFilterContext`
`setIncludeUnfilteredAttributes(boolean what)`
Control whether we will include unfiltered attributes in the result.
`AttributeFilterContext`
`setIssuerMetadataContextLookupStrategy(Function<AttributeFilterContext,SAMLMetadataContext> strategy)`
Set the strategy used to locate the IdP's metadata context.
`AttributeFilterContext`
`setMetadataResolver(MetadataResolver resolver)`
Set supplemental source of metadata for filtering rules.
`AttributeFilterContext`
`setPrefilteredIdPAttributes(Collection<IdPAttribute> attributes)`
Deprecated, for removal: This API element is subject to removal in a future version.
`AttributeFilterContext`
`setPrefilteredIdPAttributes(Map<String,IdPAttribute> attributes)`
Sets the attributes which are to be filtered.
`AttributeFilterContext`
`setPrincipal(String who)`
Gets the principal associated with the filtering.
`AttributeFilterContext`
`setProfileRequestContextLookupStrategy(Function<AttributeFilterContext,ProfileRequestContext> strategy)`
Sets the lookup strategy for locating the profile request context.
`AttributeFilterContext`
`setProxiedRequesterContextLookupStrategy(Function<AttributeFilterContext,ProxiedRequesterContext> strategy)`
Set the strategy used to locate the SP's metadata context.
`AttributeFilterContext`
`setProxiedRequesterMetadataContextLookupStrategy(Function<AttributeFilterContext,SAMLMetadataContext> strategy)`
Set the strategy used to locate a proxied requester's metadata context.
`AttributeFilterContext`
`setRequesterMetadataContextLookupStrategy(Function<AttributeFilterContext,SAMLMetadataContext> strategy)`
Set the strategy used to locate the SP's metadata 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

### direction

@Nonnull private AttributeFilterContext.Direction direction
Direction of filtering.

### profileRequestContextLookupStrategy

@Nonnull private Function<AttributeFilterContext,ProfileRequestContext> profileRequestContextLookupStrategy
Lookup strategy used to locate profile request context for the request.

### prefilteredAttributes

@Nonnull private Map<String,IdPAttribute> prefilteredAttributes
Attributes which are to be filtered.

### filteredAttributes

@Nonnull private Map<String,IdPAttribute> filteredAttributes
Attributes which have been filtered.

### metadataResolver

@Nullable private MetadataResolver metadataResolver
Optional, supplemental metadata resolver.

### principal

@Nullable private String principal
The principal associated with the filtering.

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

### includeUnfilteredAttributes

private boolean includeUnfilteredAttributes
Do we include unfiltered attributes into the resolution?

### issuerMetadataContext

@Nullable private SAMLMetadataContext issuerMetadataContext
Cache of issuer metadata context.

### requesterMetadataContext

@Nullable private SAMLMetadataContext requesterMetadataContext
Cache of requester metadata context.

### proxiedRequesterContext

@Nullable private ProxiedRequesterContext proxiedRequesterContext
Cache of the proxied requester context.

### proxiedRequesterMetadataContext

@Nullable private SAMLMetadataContext proxiedRequesterMetadataContext
Cache of proxied requester metadata context.

### issuerMetadataContextLookupStrategy

@Nullable private Function<AttributeFilterContext,SAMLMetadataContext> issuerMetadataContextLookupStrategy
Lookup strategy used to locate the IdP's metadata context.

### requesterMetadataContextLookupStrategy

@Nullable private Function<AttributeFilterContext,SAMLMetadataContext> requesterMetadataContextLookupStrategy
Lookup strategy used to locate the SP's metadata context.

### proxiedRequesterContextLookupStrategy

@Nullable private Function<AttributeFilterContext,ProxiedRequesterContext> proxiedRequesterContextLookupStrategy
Lookup strategy used to locate a `ProxiedRequesterContext`.

### proxiedRequesterMetadataContextLookupStrategy

@Nullable private Function<AttributeFilterContext,SAMLMetadataContext> proxiedRequesterMetadataContextLookupStrategy
Lookup strategy used to locate a proxied requester's metadata context.

## Constructor Details

### AttributeFilterContext

public AttributeFilterContext()
Constructor.

## Method Details

### getDirection

@Nonnull public AttributeFilterContext.Direction getDirection()
Gets the direction of filtering.

Returns:
  the direction
Since:
  4.0.0

### setDirection

@Nonnull public AttributeFilterContext setDirection(@Nonnull AttributeFilterContext.Direction dir)
Sets the direction of filtering.

Parameters:
  `dir` - the direction
Returns:
  this context
Since:
  4.0.0

### isIncludeUnfilteredAttributes

public boolean isIncludeUnfilteredAttributes()
Will we include unfiltered attributes in the result?

Returns:
  whether unfilter attributes are to be included
Since:
  5.2.0

### setIncludeUnfilteredAttributes

@Nonnull public AttributeFilterContext setIncludeUnfilteredAttributes(boolean what)
Control whether we will include unfiltered attributes in the result.

Parameters:
  `what` - if true then we will include unfiltered attributes in the result
Returns:
  this context
Since:
  5.2.0

### getProfileRequestContextLookupStrategy

@Nonnull public Function<AttributeFilterContext,ProfileRequestContext> getProfileRequestContextLookupStrategy()
Gets the lookup strategy for locating the profile request context.

Returns:
  lookup strategy
Since:
  5.0.0

### setProfileRequestContextLookupStrategy

@Nonnull public AttributeFilterContext setProfileRequestContextLookupStrategy(@Nonnull Function<AttributeFilterContext,ProfileRequestContext> strategy)
Sets the lookup strategy for locating the profile request context.

Parameters:
  `strategy` - lookup strategy
Returns:
  this context
Since:
  5.0.0

### getPrefilteredIdPAttributes

@Nonnull @NotLive @Unmodifiable public Map<String,IdPAttribute> getPrefilteredIdPAttributes()
Gets the collection of attributes that are to be filtered, indexed by attribute ID.

Returns:
  attributes to be filtered

### setPrefilteredIdPAttributes

@Deprecated(since="5.2.0", forRemoval=true) @Nonnull public AttributeFilterContext setPrefilteredIdPAttributes(@Nullable Collection<IdPAttribute> attributes)
Deprecated, for removal: This API element is subject to removal in a future version.
Sets the attributes which are to be filtered.

Parameters:
  `attributes` - attributes which are to be filtered
Returns:
  this context

### setPrefilteredIdPAttributes

@Nonnull public AttributeFilterContext setPrefilteredIdPAttributes(@Nullable Map<String,IdPAttribute> attributes)
Sets the attributes which are to be filtered.

Parameters:
  `attributes` - attributes which are to be filtered
Returns:
  this context
Since:
  5.2.0

### getFilteredIdPAttributes

@Nonnull @Unmodifiable @NotLive public Map<String,IdPAttribute> getFilteredIdPAttributes()
Gets the collection of attributes, indexed by ID, left after the filtering process has run.

Returns:
  attributes left after the filtering process has run

### setFilteredIdPAttributes

@Deprecated(since="5.2.0", forRemoval=true) @Nonnull public AttributeFilterContext setFilteredIdPAttributes(@Nullable Collection<IdPAttribute> attributes)
Deprecated, for removal: This API element is subject to removal in a future version.
Sets the attributes that have been filtered.

Parameters:
  `attributes` - attributes that have been filtered
Returns:
  this context

### setFilteredIdPAttributes

@Nonnull public AttributeFilterContext setFilteredIdPAttributes(@Nullable Map<String,IdPAttribute> attributes)
Sets the attributes that have been filtered.

Parameters:
  `attributes` - attributes that have been filtered
Returns:
  this context

### getMetadataResolver

@Nullable public MetadataResolver getMetadataResolver()
Get supplemental source of metadata for filtering rules.

Returns:
  metadata resolver
Since:
  3.4.0

### setMetadataResolver

@Nonnull public AttributeFilterContext setMetadataResolver(@Nullable MetadataResolver resolver)
Set supplemental source of metadata for filtering rules.

Parameters:
  `resolver` - metadata resolver
Returns:
  this context
Since:
  3.4.0

### getPrincipal

@Nullable public String getPrincipal()
Sets the principal associated with the filtering.

Returns:
  Returns the principal.

### setPrincipal

@Nonnull public AttributeFilterContext setPrincipal(@Nullable String who)
Gets the principal associated with the filtering.

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

### getAttributeIssuerID

@Nullable public String getAttributeIssuerID()
Gets the attribute issuer (me) associated with this filtering.

Returns:
  the attribute issuer associated with this filtering

### setAttributeIssuerID

@Nonnull public AttributeFilterContext setAttributeIssuerID(@Nullable String value)
Sets the attribute issuer (me) associated with this filtering.

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

### getAttributeRecipientID

@Nullable public String getAttributeRecipientID()
Gets the attribute recipient (her) associated with this filtering.

Returns:
  the attribute recipient associated with this filtering

### setAttributeRecipientID

@Nonnull public AttributeFilterContext setAttributeRecipientID(@Nullable String value)
Sets the attribute recipient (her) associated with this filtering.

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

### getAttributeRecipientGroupID

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

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

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

### setAttributeRecipientGroupID

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

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

### getRequesterMetadataContextLookupStrategy

@Nullable public Function<AttributeFilterContext,SAMLMetadataContext> getRequesterMetadataContextLookupStrategy()
Get the strategy used to locate the SP's metadata context.

Returns:
  lookup strategy

### setRequesterMetadataContextLookupStrategy

@Nonnull public AttributeFilterContext setRequesterMetadataContextLookupStrategy(@Nullable Function<AttributeFilterContext,SAMLMetadataContext> strategy)
Set the strategy used to locate the SP's metadata context.

Parameters:
  `strategy` - lookup strategy
Returns:
  this context

### setIssuerMetadataContextLookupStrategy

@Nonnull public AttributeFilterContext setIssuerMetadataContextLookupStrategy(@Nullable Function<AttributeFilterContext,SAMLMetadataContext> strategy)
Set the strategy used to locate the IdP's metadata context.

Parameters:
  `strategy` - lookup strategy
Returns:
  this context
Since:
  4.0.0

### getIssuerMetadataContextLookupStrategy

@Nullable public Function<AttributeFilterContext,SAMLMetadataContext> getIssuerMetadataContextLookupStrategy()
Get the strategy used to locate the IdP's metadata context.

Returns:
  lookup strategy
Since:
  4.0.0

### getProxiedRequesterContextLookupStrategy

@Nullable public Function<AttributeFilterContext,ProxiedRequesterContext> getProxiedRequesterContextLookupStrategy()
Get the strategy used to locate the `ProxiedRequesterContext`.

Returns:
  lookup strategy
Since:
  3.4.0

### setProxiedRequesterContextLookupStrategy

@Nonnull public AttributeFilterContext setProxiedRequesterContextLookupStrategy(@Nullable Function<AttributeFilterContext,ProxiedRequesterContext> strategy)
Set the strategy used to locate the SP's metadata context.

Parameters:
  `strategy` - lookup strategy
Returns:
  this context
Since:
  3.4.0

### getProxiedRequesterMetadataContextLookupStrategy

@Nullable public Function<AttributeFilterContext,SAMLMetadataContext> getProxiedRequesterMetadataContextLookupStrategy()
Get the strategy used to locate a proxied requester's metadata context.

Returns:
  lookup strategy
Since:
  4.2.0

### setProxiedRequesterMetadataContextLookupStrategy

@Nonnull public AttributeFilterContext setProxiedRequesterMetadataContextLookupStrategy(@Nullable Function<AttributeFilterContext,SAMLMetadataContext> strategy)
Set the strategy used to locate a proxied requester's metadata context.

Parameters:
  `strategy` - lookup strategy
Returns:
  this context
Since:
  4.2.0

### getIssuerMetadataContext

@Nullable public SAMLMetadataContext getIssuerMetadataContext()
Get the Issuer Metadata context.

This value is cached and so only calculated once.

Returns:
  the context
Since:
  4.0.0

### getRequesterMetadataContext

@Nullable public SAMLMetadataContext getRequesterMetadataContext()
Get the Requester Metadata context.

This value is cached and so only calculated once.

Returns:
  the context

### getProxiedRequesterContext

@Nullable public ProxiedRequesterContext getProxiedRequesterContext()
Get the `ProxiedRequesterContext`.

This value is cached and so only calculated once.

Returns:
  the context
Since:
  3.4.0

### getProxiedRequesterMetadataContext

@Nullable public SAMLMetadataContext getProxiedRequesterMetadataContext()
Get the Proxied Requester Metadata context.

This value is cached and so only calculated once.

Returns:
  the context
Since:
  4.2.0

### filterAttributes

public void filterAttributes(@Nonnull ReloadableService<AttributeFilter> attributeFilterService)
Helper method to invoke an AttributeFilter service using this context.

Parameters:
  `attributeFilterService` - the service to invoke
Since:
  4.0.0