T - the custom Principal type to locatepublic class DefaultPrincipalDeterminationStrategy<T extends Principal> extends Object implements com.google.common.base.Function<org.opensaml.profile.context.ProfileRequestContext,T>
Principal of a particular type found on the
AuthenticationResult returned by
AuthenticationContext.getAuthenticationResult().
The context is located using a lookup strategy, by default a child of the input context.
If for any reason a matching Principal can't be located, a default is returned.
| Modifier and Type | Class and Description |
|---|---|
private class |
DefaultPrincipalDeterminationStrategy.WeightedComparator
A
Comparator that compares the mapped weights of the two operands, using a weight of zero
for any unmapped values. |
| Modifier and Type | Field and Description |
|---|---|
private com.google.common.base.Function<org.opensaml.profile.context.ProfileRequestContext,AuthenticationContext> |
authnContextLookupStrategy
Authentication context lookup strategy.
|
private T |
defaultPrincipal
Default Principal to return.
|
private Class<T> |
principalType
Type of Principal to return.
|
private Map<T,Integer> |
weightMap
A map supplying weighted preference to particular Principals.
|
| Constructor and Description |
|---|
DefaultPrincipalDeterminationStrategy(Class<T> type,
T principal)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
T |
apply(org.opensaml.profile.context.ProfileRequestContext input) |
void |
setAuthenticationContextLookupStrategy(com.google.common.base.Function<org.opensaml.profile.context.ProfileRequestContext,AuthenticationContext> strategy)
Set lookup strategy for
AuthenticationContext. |
void |
setWeightMap(Map<T,Integer> map)
Set the map of Principals to weight values to impose a sort order on any matching Principals
found in the authentication result.
|
@Nonnull private final Class<T extends Principal> principalType
@Nonnull private final T extends Principal defaultPrincipal
@Nonnull @NonnullElements private Map<T extends Principal,Integer> weightMap
@Nonnull private com.google.common.base.Function<org.opensaml.profile.context.ProfileRequestContext,AuthenticationContext> authnContextLookupStrategy
public void setWeightMap(@Nonnull@NonnullElements Map<T,Integer> map)
map - map to setpublic void setAuthenticationContextLookupStrategy(@Nonnull com.google.common.base.Function<org.opensaml.profile.context.ProfileRequestContext,AuthenticationContext> strategy)
AuthenticationContext.strategy - lookup strategyCopyright © 1999–2015. All rights reserved.