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 whichMechanismConfigurationto 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 MechanismConfigurationSelectoraggregate(MechanismConfigurationSelector... configurationSelectors)Create aMechanismConfigurationSelectorthat is an aggregation of other selectors, when called the selectors will be called in order and the firstMechanismConfigurationreturned will be used.static MechanismConfigurationSelectorconstantSelector(MechanismConfiguration mechanismConfiguration)Create a constantMechanismConfigurationSelectorwhich will always return the sameMechanismConfigurationinstance.static MechanismConfigurationSelectorpredicateSelector(Predicate<MechanismInformation> predicate, MechanismConfiguration mechanismConfiguration)Create a simpleMechanismConfigurationSelectorthat is paired with aPredicateto test if the configuration should be used for the supplied information.MechanismConfigurationselectConfiguration(MechanismInformation mechanismInformation)Select theMechanismConfigurationto use for the current authentication attempt.
-
-
-
Method Detail
-
selectConfiguration
MechanismConfiguration selectConfiguration(MechanismInformation mechanismInformation)
Select theMechanismConfigurationto use for the current authentication attempt.- Parameters:
mechanismInformation- information about the current authentication attempt.- Returns:
- the
MechanismConfigurationto use for the current authentication attempt.
-
predicateSelector
static MechanismConfigurationSelector predicateSelector(Predicate<MechanismInformation> predicate, MechanismConfiguration mechanismConfiguration)
Create a simpleMechanismConfigurationSelectorthat is paired with aPredicateto test if the configuration should be used for the supplied information.- Parameters:
predicate- the predicate to test theMechanismInformationmechanismConfiguration- theMechanismConfigurationto return if the test passes.- Returns:
- a simple
MechanismConfigurationSelectorbacked by aPredicateto test if the configuration should be returned.
-
aggregate
static MechanismConfigurationSelector aggregate(MechanismConfigurationSelector... configurationSelectors)
Create aMechanismConfigurationSelectorthat is an aggregation of other selectors, when called the selectors will be called in order and the firstMechanismConfigurationreturned will be used.- Parameters:
configurationSelectors- theMechanismConfigurationSelectorinstances to aggregate.- Returns:
- the
MechanismConfigurationSelectorthat is an aggregation of the supplied selectors.
-
constantSelector
static MechanismConfigurationSelector constantSelector(MechanismConfiguration mechanismConfiguration)
Create a constantMechanismConfigurationSelectorwhich will always return the sameMechanismConfigurationinstance.- Parameters:
mechanismConfiguration- a configuration which will be always returned by created selector- Returns:
- the new configuration selector
-
-