Package net.shibboleth.idp.saml.nameid.impl

# Class AttributeSourcedSAML2NameIDGenerator

java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
org.opensaml.saml.common.profile.AbstractNameIdentifierGenerator<NameID>
org.opensaml.saml.saml2.profile.AbstractSAML2NameIDGenerator
net.shibboleth.idp.saml.nameid.AbstractSAML2NameIDGenerator
net.shibboleth.idp.saml.nameid.impl.AttributeSourcedSAML2NameIDGenerator

All Implemented Interfaces:
  `Predicate<ProfileRequestContext>`, `Component`, `DestructableComponent`, `IdentifiableComponent`, `IdentifiedComponent`, `InitializableComponent`, `FormatSpecificNameIdentifierGenerator<NameID>`, `NameIdentifierGenerator<NameID>`, `SAML2NameIDGenerator`

@ThreadSafeAfterInit public class AttributeSourcedSAML2NameIDGenerator extends AbstractSAML2NameIDGenerator
Generator for `NameID` objects based on `IdPAttribute` data.

## Field Summary

Fields
Modifier and Type
Field
Description
`private Function<ProfileRequestContext,AttributeContext>`
`attributeContextLookupStrategy`
Strategy function to lookup AttributeContext.
`private List<String>`
`attributeSourceIds`
Attribute(s) to use as an identifier source.
`private char`
`delimiter`
Delimiter to use for scoped attribute serialization.
`private final org.slf4j.Logger`
`log`
Class logger.
`private boolean`
`useUnfilteredAttributes`
Whether to look at filtered or unfiltered attributes.

## Constructor Summary

Constructors
Constructor
Description
`AttributeSourcedSAML2NameIDGenerator()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`protected NameID`
`doGenerate(ProfileRequestContext profileRequestContext)`
`protected void`
`doInitialize()`
`protected String`
`getIdentifier(ProfileRequestContext profileRequestContext)`
`void`
`setAttributeContextLookupStrategy(Function<ProfileRequestContext,AttributeContext> strategy)`
Set the lookup strategy to use to locate the `AttributeContext`.
`void`
`setAttributeSourceIds(List<String> ids)`
Set the attribute sources to pull from.
`void`
`setScopedDelimiter(char ch)`
Set the delimiter to use for serializing scoped attribute values.
`void`
`setUseUnfilteredAttributes(boolean flag)`
Set whether to source the input attributes from the unfiltered set.

### Methods inherited from class net.shibboleth.idp.saml.nameid.AbstractSAML2NameIDGenerator

`getEffectiveSPNameQualifier, setRelyingPartyContextLookupStrategy, setRequestLookupStrategy`

### Methods inherited from class org.opensaml.saml.common.profile.AbstractNameIdentifierGenerator

`generate, getDefaultIdPNameQualifierLookupStrategy, getDefaultSPNameQualifierLookupStrategy, getEffectiveIdPNameQualifier, getFormat, getIdPNameQualifier, getSPNameQualifier, getSPProvidedID, isOmitQualifiers, setActivationCondition, setDefaultIdPNameQualifierLookupStrategy, setDefaultSPNameQualifierLookupStrategy, setFormat, setIdPNameQualifier, setOmitQualifiers, setSPNameQualifier, setSPProvidedId, test`

### 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 net.shibboleth.shared.component.IdentifiedComponent

`getId`

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

`and, negate, or`

### Methods inherited from interface org.opensaml.saml.saml2.profile.SAML2NameIDGenerator

`generate`

## Field Details

### log

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

### attributeContextLookupStrategy

@Nonnull private Function<ProfileRequestContext,AttributeContext> attributeContextLookupStrategy
Strategy function to lookup AttributeContext.

### useUnfilteredAttributes

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

### delimiter

private char delimiter
Delimiter to use for scoped attribute serialization.

### attributeSourceIds

@Nonnull private List<String> attributeSourceIds
Attribute(s) to use as an identifier source.

## Constructor Details

### AttributeSourcedSAML2NameIDGenerator

public AttributeSourcedSAML2NameIDGenerator()
Constructor.

## Method Details

### setAttributeContextLookupStrategy

public void setAttributeContextLookupStrategy(@Nonnull Function<ProfileRequestContext,AttributeContext> strategy)
Set the lookup strategy to use to locate the `AttributeContext`.

Parameters:
  `strategy` - lookup function to use

### setScopedDelimiter

public void setScopedDelimiter(char ch)
Set the delimiter to use for serializing scoped attribute values.

Parameters:
  `ch` - scope to set

### setAttributeSourceIds

public void setAttributeSourceIds(@Nonnull List<String> ids)
Set the attribute sources to pull from.

Parameters:
  `ids` - attribute IDs to pull from

### setUseUnfilteredAttributes

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

Parameters:
  `flag` - flag to set

### doInitialize

protected void doInitialize() throws ComponentInitializationException

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

### doGenerate

@Nullable protected NameID doGenerate(@Nonnull ProfileRequestContext profileRequestContext) throws SAMLException

Overrides:
  `doGenerate` in class `AbstractSAML2NameIDGenerator`
Throws:
  `SAMLException`

### getIdentifier

@Nullable protected String getIdentifier(@Nonnull ProfileRequestContext profileRequestContext) throws SAMLException

Overrides:
  `getIdentifier` in class `AbstractNameIdentifierGenerator<NameID>`
Throws:
  `SAMLException`