Class Configuration

java.lang.Object
org.eclipse.dirigible.commons.config.Configuration

public class Configuration
extends Object
Configuration Facade class keeps all the configurations in the Dirigible instance It has the default built in properties file - dirigible.properties After the initialization, all the default properties are replaced with the ones coming as: 1. System's properties 2. Environment variables This can be triggered programmatically with update() method It supports also loading of custom properties files from the class loader with load() for the modules and also merge with a provided properties object with add() methods
  • Field Details

    • LOADED

      public static boolean LOADED
      The loaded.
  • Constructor Details

  • Method Details

    • loadModuleConfig

      public static void loadModuleConfig​(String path)
      Load module config.
      Parameters:
      path - the path
    • get

      public static String get​(String key)
      Getter for the value of the property by its key.
      Parameters:
      key - the key
      Returns:
      the string
    • get

      public static String get​(String key, String defaultValue)
      Getter for the value of the property by its key.
      Parameters:
      key - the key
      defaultValue - the default value
      Returns:
      the string
    • set

      public static void set​(String key, String value)
      Setter for the property's key and value.
      Parameters:
      key - the key
      value - the value
    • setIfNull

      public static void setIfNull​(String key, String value)
      Setter for the property's key and value. Sets the new value, only if the key value is null.
      Parameters:
      key - the key
      value - the value
    • remove

      public static void remove​(String key)
      Remove property.
      Parameters:
      key - the key
    • getKeys

      public static String[] getKeys()
      Getter for all the keys.
      Returns:
      the keys
    • update

      public static void update()
      Update the properties values from the System's properties and from the Environment if any.
    • isAnonymousModeEnabled

      public static boolean isAnonymousModeEnabled()
      Checks if is anonymous mode enabled.
      Returns:
      true, if is anonymous mode enabled
    • isAnonymousUserEnabled

      public static boolean isAnonymousUserEnabled()
      Checks if is anonymous user enabled.
      Returns:
      true, if is anonymous user enabled
    • isOAuthAuthenticationEnabled

      public static boolean isOAuthAuthenticationEnabled()
      Checks if the OAuth authentication is enabled.
      Returns:
      true, if the OAuth authentication is enabled
    • isKeycloakModeEnabled

      public static boolean isKeycloakModeEnabled()
      Checks if the Keycloak authentication is enabled.
      Returns:
      true, if the Keycloak authentication is enabled
    • isJwtModeEnabled

      public static boolean isJwtModeEnabled()
      Checks if is JWT mode enabled.
      Returns:
      true, if is JWT mode enabled
    • isProductiveIFrameEnabled

      public static boolean isProductiveIFrameEnabled()
      Checks if productive iframe is enabled.
      Returns:
      true, if productive iframe is enabled
    • isTerminalEnabled

      public static boolean isTerminalEnabled()
      Checks if Web IDE Terminal is enabled.
      Returns:
      true, if Web IDE Terminal is enabled
    • setSystemProperty

      public static void setSystemProperty​(String key, String value)
      Setter as a System's property.
      Parameters:
      key - the key
      value - the value
    • getRuntimeVariables

      public static Map<String,​String> getRuntimeVariables()
      Getter for the configurations set programmatically at runtime.
      Returns:
      the map of the runtime variables
    • getEnvironmentVariables

      public static Map<String,​String> getEnvironmentVariables()
      Getter for the configurations from the environment.
      Returns:
      the map of the variables from the environment
    • getDeploymentVariables

      public static Map<String,​String> getDeploymentVariables()
      Getter for the configurations from the dirigible.properties files
      Returns:
      the map of the variables from the dirigible.properties files
    • getModuleVariables

      public static Map<String,​String> getModuleVariables()
      Getter for the configurations from the module's dirigible-*.properties files
      Returns:
      the map of the variables from the module's dirigible-*.properties files
    • getOS

      public static String getOS()
      Gets the os.
      Returns:
      the os
    • isOSWindows

      public static boolean isOSWindows()
      Checks if is OS windows.
      Returns:
      true, if is OS windows
    • isOSMac

      public static boolean isOSMac()
      Checks if is OS mac.
      Returns:
      true, if is OS mac
    • isOSUNIX

      public static boolean isOSUNIX()
      Checks if is osunix.
      Returns:
      true, if is osunix
    • isOSSolaris

      public static boolean isOSSolaris()
      Checks if is OS solaris.
      Returns:
      true, if is OS solaris
    • getConfigurationParameters

      public static String[] getConfigurationParameters()
      Gets the configuration parameters.
      Returns:
      the configuration parameters