Package net.shibboleth.idp.authn.context.impl

# Class SubjectDerivedAttributesFunction

java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
net.shibboleth.idp.authn.context.impl.SubjectDerivedAttributesFunction

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

public class SubjectDerivedAttributesFunction extends AbstractIdentifiableInitializableComponent implements Function<ProfileRequestContext,List<IdPAttribute>>
A Function which returns `IdPAttribute`s derived from the `Principal`s associated with the request.

## Field Summary

Fields
Modifier and Type
Field
Description
`private boolean`
`forCanonicalization`
Flag denoting whether plugin is being used for subject c14n or standard usage.
`private final org.slf4j.Logger`
`log`
Logger.
`private Function<ProfileRequestContext,SubjectContext>`
`scLookupStrategy`
Strategy used to locate the `SubjectContext` to use.
`private Function<ProfileRequestContext,Subject>`
`subjectLookupStrategy`
Strategy used to locate the `Subject` to use.

## Constructor Summary

Constructors
Constructor
Description
`SubjectDerivedAttributesFunction()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`List<IdPAttribute>`
`apply(ProfileRequestContext prc)`
`protected void`
`doInitialize()`
`private String`
`getLogPrefix()`
Produce a consistent log prefix.
`boolean`
`isForCanonicalization()`
Gets whether the definition is being used during Subject Canonicalization, causing auto-installation of an alternate Subject lookup strategy.
`void`
`setForCanonicalization(boolean flag)`
Sets whether the definition is being used during Subject Canonicalization, causing auto-installation of an alternate Subject lookup strategy.
`void`
`setSubjectContextLookupStrategy(Function<ProfileRequestContext,SubjectContext> strategy)`
Sets the strategy used to locate the `SubjectContext` associated with a given `AttributeResolutionContext`.
`void`
`setSubjectLookupStrategy(Function<ProfileRequestContext,Subject> strategy)`
Sets the strategy used to locate a `Subject` associated with a given `AttributeResolutionContext`.

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

`setId`

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

`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, compose`

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

`getId`

## Field Details

### log

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

### forCanonicalization

private boolean forCanonicalization
Flag denoting whether plugin is being used for subject c14n or standard usage.

### scLookupStrategy

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

### subjectLookupStrategy

@Nullable private Function<ProfileRequestContext,Subject> subjectLookupStrategy
Strategy used to locate the `Subject` to use.

## Constructor Details

### SubjectDerivedAttributesFunction

public SubjectDerivedAttributesFunction()
Constructor.

## Method Details

### isForCanonicalization

public boolean isForCanonicalization()
Gets whether the definition is being used during Subject Canonicalization, causing auto-installation of an alternate Subject lookup strategy.

Returns:
  whether the definition is being used during Subject Canonicalization

### setForCanonicalization

public void setForCanonicalization(boolean flag)
Sets whether the definition is being used during Subject Canonicalization, causing auto-installation of an alternate Subject lookup strategy.

Parameters:
  `flag` - flag to set

### setSubjectContextLookupStrategy

public void setSubjectContextLookupStrategy(@Nonnull Function<ProfileRequestContext,SubjectContext> strategy)
Sets the strategy used to locate the `SubjectContext` associated with a given `AttributeResolutionContext`.

Parameters:
  `strategy` - strategy used to locate the `SubjectContext` associated with a given `AttributeResolutionContext`

### setSubjectLookupStrategy

public void setSubjectLookupStrategy(@Nullable Function<ProfileRequestContext,Subject> strategy)
Sets the strategy used to locate a `Subject` associated with a given `AttributeResolutionContext`.

Parameters:
  `strategy` - strategy used to locate a `Subject` associated with a given `AttributeResolutionContext`

### doInitialize

protected void doInitialize() throws ComponentInitializationException

Overrides:
  `doInitialize` in class `AbstractIdentifiedInitializableComponent`
Throws:
  `ComponentInitializationException`

### apply

@Nullable @Unmodifiable @NotLive public List<IdPAttribute> apply(@Nullable ProfileRequestContext prc)

Specified by:
  `apply` in interface `Function<ProfileRequestContext,List<IdPAttribute>>`

### getLogPrefix

private String getLogPrefix()
Produce a consistent log prefix.

Returns:
  a consistent log prefix