Package net.shibboleth.idp.saml.profile.context.navigate

# Class DefaultNameIdentifierFormatStrategy

java.lang.Object
org.opensaml.saml.common.profile.logic.MetadataNameIdentifierFormatStrategy
net.shibboleth.idp.saml.profile.context.navigate.DefaultNameIdentifierFormatStrategy

All Implemented Interfaces:
  `Function<ProfileRequestContext,List<String>>`

public class DefaultNameIdentifierFormatStrategy extends MetadataNameIdentifierFormatStrategy
Function to filter a set of candidate NameIdentifier/NameID Format values derived from an entity's SAML metadata against configuration preferences.

## Field Summary

Fields
Modifier and Type
Field
Description
`private String`
`defaultFormat`
Default format to use if nothing else is known.
`private final org.slf4j.Logger`
`log`
Class logger.
`private String`
`profileId`
Override the `ProfileConfiguration` to look for rather than whatever's populated.
`private Function<ProfileRequestContext,RelyingPartyContext>`
`relyingPartyContextLookupStrategy`
Strategy used to locate the `RelyingPartyContext` associated with a given `ProfileRequestContext`.

## Constructor Summary

Constructors
Constructor
Description
`DefaultNameIdentifierFormatStrategy()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`List<String>`
`apply(ProfileRequestContext input)`
`void`
`setDefaultFormat(String format)`
Set the default format to return.
`void`
`setProfileId(String id)`
Set the profile configuration ID to locate in the `RelyingPartyConfiguration` for the purposes of establishing format precedence rules.
`void`
`setRelyingPartyContextLookupStrategy(Function<ProfileRequestContext,RelyingPartyContext> strategy)`
Set the strategy used to locate the `RelyingPartyContext` associated with a given `ProfileRequestContext`.

### Methods inherited from class org.opensaml.saml.common.profile.logic.MetadataNameIdentifierFormatStrategy

`setSSODescriptorLookupStrategy`

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

## Field Details

### log

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

### relyingPartyContextLookupStrategy

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

### profileId

@Nullable private String profileId
Override the `ProfileConfiguration` to look for rather than whatever's populated.

### defaultFormat

@Nonnull @NotEmpty private String defaultFormat
Default format to use if nothing else is known.

## Constructor Details

### DefaultNameIdentifierFormatStrategy

public DefaultNameIdentifierFormatStrategy()
Constructor.

## Method Details

### setRelyingPartyContextLookupStrategy

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

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

### setProfileId

public void setProfileId(@Nullable String id)
Set the profile configuration ID to locate in the `RelyingPartyConfiguration` for the purposes of establishing format precedence rules.

By default/without one set, the strategy is to use the configuration object populated in the `RelyingPartyContext`.

Parameters:
  `id` - profile ID to look for

### setDefaultFormat

public void setDefaultFormat(@Nonnull @NotEmpty String format)
Set the default format to return.

Parameters:
  `format` - default format

### apply

@Nonnull @Unmodifiable @NotLive public List<String> apply(@Nullable ProfileRequestContext input)

Specified by:
  `apply` in interface `Function<ProfileRequestContext,List<String>>`
Overrides:
  `apply` in class `MetadataNameIdentifierFormatStrategy`