Enum Class LoomProfile

java.lang.Object
java.lang.Enum<LoomProfile>
com.loomcache.common.config.LoomProfile
All Implemented Interfaces:
Serializable, Comparable<LoomProfile>, Constable

public enum LoomProfile extends Enum<LoomProfile>
BLK-2026-04-22-008: deployment profile flag controlling whether v2.0 GA enforces production-only safety constraints or runs in permissive development/test mode.

Two profiles are recognized:

  • DEVELOPMENT — current behavior: TLS opt-in, mTLS opt-in, gateway-trust evaluated before cert auth, ACTIVE_ACTIVE WAN allowed, cross-group transactions allowed, etc. Suitable for unit tests, CI, single-node dev clusters, and any environment where strict safety would block the workflow after explicitly selecting development mode.
  • PRODUCTION — strict mode: features known to have unfixed v2.0 correctness issues throw IllegalStateException at config time so the operator surfaces the limitation immediately rather than discovering it after data corruption. Currently rejects:
    • ACTIVE_ACTIVE WAN replication topologies (BLK-2026-04-22-006).
    Future production-only checks: TLS-on default, mTLS required, gateway-trust behind explicit listener (BLK-2026-04-22-008 v2.1 work).

Resolution: the profile is read from the JVM system property loomcache.profile (case-insensitive). Unset values are accepted only while running under the test harness, where they resolve to DEVELOPMENT; outside tests the profile must be explicit. Unknown values always fail fast. The value is cached on first read; restart the JVM to change profile.

Thread safety: immutable enum, lazily resolved via the JVM holder idiom. Safe for hot-path use without synchronization.

Since:
2.0
  • Enum Constant Details

    • DEVELOPMENT

      public static final LoomProfile DEVELOPMENT
      Permissive — current pre-v2.0 behavior. Used by unit tests, CI, dev clusters, and any single-node setup after explicit opt-in outside tests.
    • PRODUCTION

      public static final LoomProfile PRODUCTION
      Strict — v2.0 GA production safety profile. Refuses to start with configurations known to have unfixed correctness issues (currently: ACTIVE_ACTIVE WAN).
  • Field Details

  • Method Details

    • values

      public static LoomProfile[] 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 LoomProfile 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
    • current

      public static LoomProfile current()
      Returns the active profile for this JVM. Resolved on first call from the loomcache.profile system property. The profile must be explicit outside the Maven test harness so production typos cannot silently disable strict checks.
      Returns:
      the active profile (never null)
    • fromSystemProperty

      public static LoomProfile fromSystemProperty()
      Resolve the active profile from the current JVM properties without using the cached holder. Use this in startup/configuration guards that are exercised directly by tests after mutating "loomcache.profile".
      Returns:
      the active profile (never null)
    • isProduction

      public boolean isProduction()
      Returns:
      true if this profile is PRODUCTION
    • isDevelopment

      public boolean isDevelopment()
      Returns:
      true if this profile is DEVELOPMENT