Package net.shibboleth.idp.authn.context
Class PreferredPrincipalContext
- java.lang.Object
-
- org.opensaml.messaging.context.BaseContext
-
- net.shibboleth.idp.authn.context.PreferredPrincipalContext
-
- All Implemented Interfaces:
Iterable<BaseContext>
public final class PreferredPrincipalContext extends BaseContext
A context that holds information about an authentication request's preference for a specific customPrincipal.Authentication protocols with features for preferring specific forms of authentication with optional semantics will populate this context type with an expression of those preferences in the form of an ordered list of custom
Principalobjects.- Since:
- 3.4.0
- Parent:
AuthenticationContext- Added:
- Before the authentication process begins
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.opensaml.messaging.context.BaseContext
BaseContext.ContextSetNoRemoveIteratorDecorator
-
-
Field Summary
Fields Modifier and Type Field Description private List<Principal>preferredPrincipalsThe principals reflecting the preference.
-
Constructor Summary
Constructors Constructor Description PreferredPrincipalContext()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<Principal>getPreferredPrincipals()Get an immutable list of principals reflecting the request preferences.booleanisAcceptable(Collection<Principal> principals)Helper method that evaluatesPrincipalobjects against this context to determine if the input is compatible with it.booleanisAcceptable(PrincipalSupportingComponent component)Helper method that evaluates aPrincipalSupportingComponentagainst this context to determine if the input is compatible with it.<T extends Principal>
booleanisAcceptable(T principal)Helper method that evaluates aPrincipalobject against this context to determine if the input is compatible with it.PreferredPrincipalContextsetPreferredPrincipals(List<Principal> principals)Set list of principals reflecting the request preferences.-
Methods inherited from class org.opensaml.messaging.context.BaseContext
addSubcontext, addSubcontext, clearSubcontexts, containsSubcontext, createSubcontext, getParent, getSubcontext, getSubcontext, getSubcontext, getSubcontext, iterator, removeSubcontext, removeSubcontext, setParent
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Field Detail
-
preferredPrincipals
@Nonnull @NonnullElements private List<Principal> preferredPrincipals
The principals reflecting the preference.
-
-
Method Detail
-
getPreferredPrincipals
@Nonnull @NonnullElements @Unmodifiable @NotLive public List<Principal> getPreferredPrincipals()
Get an immutable list of principals reflecting the request preferences.- Returns:
- immutable list of principals
-
setPreferredPrincipals
@Nonnull public PreferredPrincipalContext setPreferredPrincipals(@Nonnull @NonnullElements List<Principal> principals)
Set list of principals reflecting the request preferences.- Parameters:
principals- list of principals- Returns:
- this context
-
isAcceptable
public boolean isAcceptable(@Nonnull PrincipalSupportingComponent component)Helper method that evaluates aPrincipalSupportingComponentagainst this context to determine if the input is compatible with it.- Parameters:
component- component to evaluate- Returns:
- true iff the input is compatible with the requested authentication preferences
-
isAcceptable
public boolean isAcceptable(@Nonnull @NonnullElements Collection<Principal> principals)
Helper method that evaluatesPrincipalobjects against this context to determine if the input is compatible with it.- Parameters:
principals- principal(s) to evaluate- Returns:
- true iff the input is compatible with the requested authentication preferences
-
isAcceptable
public <T extends Principal> boolean isAcceptable(@Nonnull T principal)
Helper method that evaluates aPrincipalobject against this context to determine if the input is compatible with it.- Type Parameters:
T- type of principal- Parameters:
principal- principal to evaluate- Returns:
- true iff the input is compatible with the requested authentication preferences
-
-