Enum Class FailMode

java.lang.Object
java.lang.Enum<FailMode>
org.apache.juneau.commons.secret.FailMode
All Implemented Interfaces:
Serializable, Comparable<FailMode>, Constable

public enum FailMode extends Enum<FailMode>
The policy a network- or OS-backed SecretStore applies when its backing store cannot answer — for example when the OS keychain tool is missing or a remote vault is unreachable.

Modeled on the FailMode of ReplayCache: the policy is a consumer decision rather than a fixed SPI behavior. The built-in InMemorySecretStore and EnvVarSecretStore never encounter an unavailable backend, so this enum is only meaningful for the out-of-commons implementations that reach an external secret backend.

Note this is orthogonal to a key simply being absent — a store that successfully answers "no secret under this key" is not a failure and is never resolved through a FailMode.

Since:
10.0.0
  • Enum Constant Details

    • FAIL_OPEN

      public static final FailMode FAIL_OPEN
      Treat a backend failure as a missing secret: find returns empty, exists/delete return false (availability-preserving).
    • FAIL_CLOSED

      public static final FailMode FAIL_CLOSED
      Treat a backend failure as an error and propagate it, so the operation fails loudly rather than silently reporting a secret as absent (the safe default).
  • Method Details

    • values

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

      public static FailMode valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
      NullPointerException - if the argument is null