Package org.wildfly.security.auth.server
Interface MechanismConfigurationSelector
-
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface MechanismConfigurationSelector
A selector to choose whichMechanismConfiguration
to use based on information know about the current authentication attempt.- Author:
- Darran Lofthouse
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static MechanismConfigurationSelector
aggregate(MechanismConfigurationSelector... configurationSelectors)
Create aMechanismConfigurationSelector
that is an aggregation of other selectors, when called the selectors will be called in order and the firstMechanismConfiguration
returned will be used.static MechanismConfigurationSelector
constantSelector(MechanismConfiguration mechanismConfiguration)
Create a constantMechanismConfigurationSelector
which will always return the sameMechanismConfiguration
instance.static MechanismConfigurationSelector
predicateSelector(Predicate<MechanismInformation> predicate, MechanismConfiguration mechanismConfiguration)
Create a simpleMechanismConfigurationSelector
that is paired with aPredicate
to test if the configuration should be used for the supplied information.MechanismConfiguration
selectConfiguration(MechanismInformation mechanismInformation)
Select theMechanismConfiguration
to use for the current authentication attempt.
-
-
-
Method Detail
-
selectConfiguration
MechanismConfiguration selectConfiguration(MechanismInformation mechanismInformation)
Select theMechanismConfiguration
to use for the current authentication attempt.- Parameters:
mechanismInformation
- information about the current authentication attempt.- Returns:
- the
MechanismConfiguration
to use for the current authentication attempt.
-
predicateSelector
static MechanismConfigurationSelector predicateSelector(Predicate<MechanismInformation> predicate, MechanismConfiguration mechanismConfiguration)
Create a simpleMechanismConfigurationSelector
that is paired with aPredicate
to test if the configuration should be used for the supplied information.- Parameters:
predicate
- the predicate to test theMechanismInformation
mechanismConfiguration
- theMechanismConfiguration
to return if the test passes.- Returns:
- a simple
MechanismConfigurationSelector
backed by aPredicate
to test if the configuration should be returned.
-
aggregate
static MechanismConfigurationSelector aggregate(MechanismConfigurationSelector... configurationSelectors)
Create aMechanismConfigurationSelector
that is an aggregation of other selectors, when called the selectors will be called in order and the firstMechanismConfiguration
returned will be used.- Parameters:
configurationSelectors
- theMechanismConfigurationSelector
instances to aggregate.- Returns:
- the
MechanismConfigurationSelector
that is an aggregation of the supplied selectors.
-
constantSelector
static MechanismConfigurationSelector constantSelector(MechanismConfiguration mechanismConfiguration)
Create a constantMechanismConfigurationSelector
which will always return the sameMechanismConfiguration
instance.- Parameters:
mechanismConfiguration
- a configuration which will be always returned by created selector- Returns:
- the new configuration selector
-
-