Enum FailureMode

java.lang.Object
java.lang.Enum<FailureMode>
com.codename1.security.shield.FailureMode
All Implemented Interfaces:
Comparable<FailureMode>

public enum FailureMode extends Enum<FailureMode>

What a protected host should do when a token cannot be obtained.

This is deliberately a per-host decision. An app typically wants CLOSED on the handful of endpoints that move money or read personal data, and OPEN everywhere else, so that a shield service outage degrades one feature rather than bricking the app.

  • Enum Constant Details

    • OPEN

      public static final FailureMode OPEN

      Send the request without a token. The customer's backend still decides what to do with an unattested request; this only means the client does not block it locally.

      This is the default, and it is the only behaviour available when the app was built without the enterprise engine.

    • CLOSED

      public static final FailureMode CLOSED
      Refuse to send the request, failing it with a ShieldException carrying the reason. Use this only where a false negative is more acceptable than an unattested call, and only after reading ShieldStatus.isTransient() -- most token failures are network problems, not compromised devices.
  • Method Details

    • values

      public static FailureMode[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static FailureMode valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null