Class MultiFactorAuthenticationTransition
After each step/flow is successfully completed, this object supplies rules for determining what to do next with a bit of pseudo-SWF reinvention that allows an event to be mapped to a new flow to run by means of a function. If no mapping exists, or the function returns null, then the active event is simply raised as the result of the overall flow execution.
Note that raising the "proceed" event from a previous step will cause the MFA flow itself to attempt successful completion by finalizing its result.
- Since:
- 3.3.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Map<String,
Function<ProfileRequestContext, String>> A function that determines the next flow to execute. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetNextFlowStrategy
(String event) Get the function to run to determine the next subflow to run.(package private) Map<String,
Function<ProfileRequestContext, String>> Get the map of transition rules to follow.void
setNextFlow
(String flowId) Set the next flow to run directly, instead of using a strategy map.void
setNextFlowStrategy
(Function<ProfileRequestContext, String> strategy) Set a function to run directly instead of using a strategy map.void
Set the map of transition rules to follow.
-
Field Details
-
nextFlowStrategyMap
@Nonnull @NonnullElements private Map<String,Function<ProfileRequestContext, nextFlowStrategyMapString>> A function that determines the next flow to execute.
-
-
Constructor Details
-
MultiFactorAuthenticationTransition
public MultiFactorAuthenticationTransition()Constructor.
-
-
Method Details
-
getNextFlowStrategy
@Nonnull public Function<ProfileRequestContext,String> getNextFlowStrategy(@Nonnull @NotEmpty String event) Get the function to run to determine the next subflow to run.- Parameters:
event
- the event to transition from- Returns:
- flow determination strategy
-
getNextFlowStrategyMap
@Nonnull @NonnullElements @Live Map<String,Function<ProfileRequestContext, getNextFlowStrategyMap()String>> Get the map of transition rules to follow.- Returns:
- a map of transition functions keyed by event ID
-
setNextFlowStrategyMap
Set the map of transition rules to follow.The values in the map must be either a
String
identifying the flow ID to run, or aFunction
<
ProfileRequestContext
,
String
>
to execute.- Parameters:
map
- map of transition rules
-
setNextFlow
Set the next flow to run directly, instead of using a strategy map.The transition rule is implicitly based on a "proceed" event occurring, and assumes no custom transitions for any other events.
- Parameters:
flowId
- fully-qualified flow ID to run
-
setNextFlowStrategy
Set a function to run directly instead of using a strategy map.The transition rule is implicitly based on a "proceed" event occurring, and assumes no custom transitions for any other events.
- Parameters:
strategy
- function to run
-