Package net.shibboleth.idp.saml.authn.principal.impl

# Class MapDrivenAuthnContextTranslationStrategy

java.lang.Object
net.shibboleth.idp.saml.authn.principal.impl.MapDrivenAuthnContextTranslationStrategy

All Implemented Interfaces:
  `Function<AuthnContext,Collection<Principal>>`

public class MapDrivenAuthnContextTranslationStrategy extends Object implements Function<AuthnContext,Collection<Principal>>
Implements a set of default logic for mapping an `AuthnContext`'s content into a set of custom Principals based on a set of static mapping rules.

Since:
  4.0.0

## Field Summary

Fields
Modifier and Type
Field
Description
`private final org.slf4j.Logger`
`log`
Class logger.
`private Map<Principal,Collection<Principal>>`
`principalMappings`
Mappings to transform proxied Principals.

## Constructor Summary

Constructors
Constructor
Description
`MapDrivenAuthnContextTranslationStrategy()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`Collection<Principal>`
`apply(AuthnContext input)`
`void`
`setMappings(Map<Principal,Collection<Principal>> mappings)`
Sets the mappings from input/proxied Principals to zero or more equivalent values to use.

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

### principalMappings

@Nonnull private Map<Principal,Collection<Principal>> principalMappings
Mappings to transform proxied Principals.

## Constructor Details

### MapDrivenAuthnContextTranslationStrategy

public MapDrivenAuthnContextTranslationStrategy()
Constructor.

## Method Details

### setMappings

public void setMappings(@Nullable Map<Principal,Collection<Principal>> mappings)
Sets the mappings from input/proxied Principals to zero or more equivalent values to use.

Any values not mapped will be assumed to be passed through.

Parameters:
  `mappings` - `Principal` mappings

### apply

@Nullable @Unmodifiable @NotLive public Collection<Principal> apply(@Nullable AuthnContext input)

Specified by:
  `apply` in interface `Function<AuthnContext,Collection<Principal>>`