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.
A selector to choose which
MechanismConfiguration to use based on information know about the current authentication
attempt.- Author:
- Darran Lofthouse
-
Method Summary
Modifier and TypeMethodDescriptionaggregate(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.constantSelector(MechanismConfiguration mechanismConfiguration) Create a constantMechanismConfigurationSelectorwhich will always return the sameMechanismConfigurationinstance.predicateSelector(Predicate<MechanismInformation> predicate, MechanismConfiguration mechanismConfiguration) Create a simpleMechanismConfigurationSelectorthat is paired with aPredicateto test if the configuration should be used for the supplied information.selectConfiguration(MechanismInformation mechanismInformation) Select theMechanismConfigurationto use for the current authentication attempt.
-
Method Details
-
selectConfiguration
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
-