Package net.shibboleth.idp.plugin.authn.webauthn.context.navigate

# Class AbstractAttributeContextUserIdentityStrategy<T>

java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
net.shibboleth.idp.plugin.authn.webauthn.context.navigate.AbstractAttributeContextUserIdentityStrategy<T>

Type Parameters:
  `T` - the type of attribute value to return

All Implemented Interfaces:
  `Function<ProfileRequestContext,T>`, `Component`, `DestructableComponent`, `IdentifiableComponent`, `IdentifiedComponent`, `InitializableComponent`

Direct Known Subclasses:
  `AttributeContextByteArrayLookupStrategy`, `AttributeContextStringLookupStrategy`

public abstract class AbstractAttributeContextUserIdentityStrategy<T> extends AbstractIdentifiableInitializableComponent implements Function<ProfileRequestContext,T>
A base class for functions that retrieve a single attribute value from the `attribute context`.

## Field Summary

Fields
Modifier and Type
Field
Description
`private Function<ProfileRequestContext,AttributeContext>`
`attributeContextLookupStrategy`
Strategy used to locate the `AttributeContext` associated with a given `ProfileRequestContext`.
`private String`
`attributeId`
The attribute Id to extract the value from.
`private final org.slf4j.Logger`
`log`
Class logger.
`private boolean`
`useUnfilteredAttributes`
Whether to look at filtered or unfiltered attributes.

## Constructor Summary

Constructors
Modifier
Constructor
Description
`protected`
`AbstractAttributeContextUserIdentityStrategy()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`protected IdPAttribute`
`getAttribute(ProfileRequestContext profileRequestContext)`
Get the attribute from either the filtered or unfiltered set of attributes with the given attribute Id from the AttributeContext (if it exists).
`protected String`
`getAttributeId()`
Get the attribute Id to extract the value from.
`boolean`
`isUseUnfilteredAttributes()`
Get whether to source the input attributes from the unfiltered set.
`void`
`setAttributeContextLookupStrategy(Function<ProfileRequestContext,AttributeContext> strategy)`
Set the strategy used to locate the `AttributeContext` associated with a given `ProfileRequestContext`.
`void`
`setAttributeId(String id)`
Set the attribute Id to extract the value from.
`void`
`setUseUnfilteredAttributes(boolean flag)`
Set whether to source the input attributes from the unfiltered set.

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

`setId`

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

`doInitialize, ensureId, getId, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException`

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

`checkComponentActive, checkSetterPreconditions, destroy, doDestroy, initialize, isDestroyed, isInitialized`

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

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

### Methods inherited from interface java.util.function.Function

`andThen, apply, compose`

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

`getId`

## Field Details

### log

@Nonnull private final org.slf4j.Logger log
Class logger.

### attributeContextLookupStrategy

@Nonnull private Function<ProfileRequestContext,AttributeContext> attributeContextLookupStrategy
Strategy used to locate the `AttributeContext` associated with a given `ProfileRequestContext`.

### attributeId

@Nullable @NotEmpty private String attributeId
The attribute Id to extract the value from.

### useUnfilteredAttributes

private boolean useUnfilteredAttributes
Whether to look at filtered or unfiltered attributes. Default is filtered.

## Constructor Details

### AbstractAttributeContextUserIdentityStrategy

protected AbstractAttributeContextUserIdentityStrategy()
Constructor.

## Method Details

### isUseUnfilteredAttributes

public boolean isUseUnfilteredAttributes()
Get whether to source the input attributes from the unfiltered set.

Returns:
  whether to source the input attributes from the unfiltered set

### setUseUnfilteredAttributes

public void setUseUnfilteredAttributes(boolean flag)
Set whether to source the input attributes from the unfiltered set.

Defaults to true.

Parameters:
  `flag` - flag to set

### setAttributeId

public void setAttributeId(@Nullable String id)
Set the attribute Id to extract the value from.

Parameters:
  `id` - the attributeId.

### getAttributeId

@Nullable @NotEmpty protected String getAttributeId()
Get the attribute Id to extract the value from.

Returns:
  the attributeId.

### setAttributeContextLookupStrategy

public void setAttributeContextLookupStrategy(@Nonnull Function<ProfileRequestContext,AttributeContext> strategy)
Set the strategy used to locate the `AttributeContext` associated with a given `ProfileRequestContext`.

Parameters:
  `strategy` - strategy used to locate the `AttributeContext` associated with a given `ProfileRequestContext`

### getAttribute

@Nullable protected IdPAttribute getAttribute(@Nonnull ProfileRequestContext profileRequestContext)
Get the attribute from either the filtered or unfiltered set of attributes with the given attribute Id from the AttributeContext (if it exists).

Parameters:
  `profileRequestContext` - the profile request context to locate the attribute context and the attribute from
Returns:
  the IdPAttribute, or `null` if not found.