Class ProgressStageBinding<C extends StageConfig>

java.lang.Object
org.forgerock.selfservice.core.ProgressStageBinding<C>
Type Parameters:
C - type that describes the stage config

public final class ProgressStageBinding<C extends StageConfig> extends Object
Binds together the progress stage with its config. Acts to enforce the generic binding between the two but also assists in the passing of the config to keep the progress stages from maintaining thread state, therefore promoting thread safety.
Since:
0.1.0
  • Method Details

    • gatherInitialRequirements

      public JsonValue gatherInitialRequirements(ProcessContext context) throws ResourceException
      Response for defining any initial requirements the bound stage may have.

      An empty json object implies no initial requirements.

      Parameters:
      context - the current process context
      Returns:
      json value representing the requirements or empty json object for no requirements
      Throws:
      ResourceException - if some expected state is invalid
    • advance

      public StageResponse advance(ProcessContext context) throws ResourceException
      Advance the progress stage.
      Parameters:
      context - the current process context
      Returns:
      the result of invoking this stage
      Throws:
      ResourceException - if some expected state or input is invalid
    • getName

      public String getName()
      Return the name of the bound stage.
      Returns:
      the stage name
    • bind

      public static <C extends StageConfig> ProgressStageBinding<C> bind(ProgressStage<C> stage, C config)
      Create a new binder instance.
      Type Parameters:
      C - the stage config type shared by the progress stage
      Parameters:
      stage - the progress stage
      config - the stage config
      Returns:
      a new binder instance