Enum Class RunEnv

java.lang.Object
java.lang.Enum<RunEnv>
ch.tocco.nice2.boot.api.RunEnv
All Implemented Interfaces:
Serializable, Comparable<RunEnv>, Constable

public enum RunEnv extends Enum<RunEnv>
The run environment like DEVELOPMENT or PRODUCTION for the system.

Code and configuration may perform differently based on this, for example log an error or not.

Maybe more env's will be added in the future. Examples are:

  • STAGING (like a live installation, the stage before going live)
As of now testing is done using the development env, and if we use staging then it's probably in live mode.
  • Enum Constant Details

    • DEVELOPMENT

      public static final RunEnv DEVELOPMENT
      The system runs in development mode on the developer's machine.
    • TEST

      public static final RunEnv TEST
      The system runs in test mode.
    • UPDATE

      public static final RunEnv UPDATE
      A mode with reduced services to allow multiple instances on the same database. The idea is, that only one application with mode "development"/"production" is running and others then use this mode.
    • PRODUCTION

      public static final RunEnv PRODUCTION
      The system runs in production mode.
  • Method Details

    • values

      public static RunEnv[] 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 RunEnv 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
    • isLive

      public boolean isLive()
      Tells if the environment should behave as if it was "live". This is true for PRODUCTION, but not for DEVELOPMENT (and test, staging, etc).