Class ActivationResult

Object
se.curity.identityserver.sdk.authentication.ActivationResult

public class ActivationResult extends Object
This class represents the state of activation tasks. If the result is Pending or Done a username will exist in the result. If the state is failed, the username may be null.
Since:
2.1.0
  • Method Details

    • getModel

      public ResponseModel getModel()
    • getState

      Get the state of the activation.
      Returns:
      an ActivationState for this activation
    • isDone

      public boolean isDone()
      The activation is completed.
      Returns:
      true if the activation is completed
    • isPending

      public boolean isPending()
      The activation is still pending. This is typically the result after the initializeActivation call where an out of band process has been initiated.
      Returns:
      true if the activation is in pending mode
    • isFailed

      public boolean isFailed()
      The activation failed for some reason, typically the session or token had expired.
      Returns:
      true if the activation failed
    • getUsername

      @Nullable public @Nullable String getUsername()
      The username that was activated or is pending.
      Returns:
      a non null username if activation was pending or is done, but username may be null if activation failed.
    • activationPending

      public static ActivationResult activationPending(String username)
      Create an activation pending result with a given user.
      Parameters:
      username - A non-null username that the activation is pending for
      Returns:
      an ActivationResult with the state ACTIVATION_PENDING
    • activationPending

      public static ActivationResult activationPending(String username, Map<String,Object> model)
      Create an activation pending result with a given user and additional response model parameters.
      Parameters:
      username - A non-null username that the activation is pending for
      model - response model parameters given by the activator that should be added to the response view model
      Returns:
      an ActivationResult with the state ACTIVATION_PENDING
    • activationDone

      public static ActivationResult activationDone(String username)
      Create an activation completed result with a given user.
      Parameters:
      username - A non-null username that the activation is completed for
      Returns:
      an ActivationResult with the state ACTIVATION_DONE
    • activationDone

      public static ActivationResult activationDone(String username, Map<String,Object> model)
      Create an activation completed result with a given user and additional response model parameters.
      Parameters:
      username - A non-null username that the activation is completed for
      model - response model parameters given by the activator that should be added to the response view model
      Returns:
      an ActivationResult with the state ACTIVATION_DONE
    • activationFailed

      public static ActivationResult activationFailed()
      An activation result for a failed activation, no user will be present.
      Returns:
      an ActivationResult with the state ACTIVATION_FAILED