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 Summary
Fields Modifier and Type Field Description static booleanLOADEDThe loaded. -
Constructor Summary
Constructors Constructor Description Configuration() -
Method Summary
Modifier and Type Method Description static Stringget(String key)Getter for the value of the property by its key.static Stringget(String key, String defaultValue)Getter for the value of the property by its key.static String[]getConfigurationParameters()Gets the configuration parameters.static Map<String,String>getDeploymentVariables()Getter for the configurations from the dirigible.properties filesstatic Map<String,String>getEnvironmentVariables()Getter for the configurations from the environment.static String[]getKeys()Getter for all the keys.static Map<String,String>getModuleVariables()Getter for the configurations from the module's dirigible-*.properties filesstatic StringgetOS()Gets the os.static Map<String,String>getRuntimeVariables()Getter for the configurations set programmatically at runtime.static booleanisAnonymousModeEnabled()Checks if is anonymous mode enabled.static booleanisAnonymousUserEnabled()Checks if is anonymous user enabled.static booleanisJwtModeEnabled()Checks if is JWT mode enabled.static booleanisKeycloakModeEnabled()Checks if the Keycloak authentication is enabled.static booleanisOAuthAuthenticationEnabled()Checks if the OAuth authentication is enabled.static booleanisOSMac()Checks if is OS mac.static booleanisOSSolaris()Checks if is OS solaris.static booleanisOSUNIX()Checks if is osunix.static booleanisOSWindows()Checks if is OS windows.static booleanisProductiveIFrameEnabled()Checks if productive iframe is enabled.static booleanisTerminalEnabled()Checks if Web IDE Terminal is enabled.static voidloadModuleConfig(String path)Load module config.static voidremove(String key)Remove property.static voidset(String key, String value)Setter for the property's key and value.static voidsetIfNull(String key, String value)Setter for the property's key and value.static voidsetSystemProperty(String key, String value)Setter as a System's property.static voidupdate()Update the properties values from the System's properties and from the Environment if any.
-
Field Details
-
LOADED
public static boolean LOADEDThe loaded.
-
-
Constructor Details
-
Configuration
public Configuration()
-
-
Method Details
-
loadModuleConfig
Load module config.- Parameters:
path- the path
-
get
Getter for the value of the property by its key.- Parameters:
key- the key- Returns:
- the string
-
get
Getter for the value of the property by its key.- Parameters:
key- the keydefaultValue- the default value- Returns:
- the string
-
set
Setter for the property's key and value.- Parameters:
key- the keyvalue- the value
-
setIfNull
Setter for the property's key and value. Sets the new value, only if the key value is null.- Parameters:
key- the keyvalue- the value
-
remove
Remove property.- Parameters:
key- the key
-
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
Setter as a System's property.- Parameters:
key- the keyvalue- the value
-
getRuntimeVariables
Getter for the configurations set programmatically at runtime.- Returns:
- the map of the runtime variables
-
getEnvironmentVariables
Getter for the configurations from the environment.- Returns:
- the map of the variables from the environment
-
getDeploymentVariables
Getter for the configurations from the dirigible.properties files- Returns:
- the map of the variables from the dirigible.properties files
-
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
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
Gets the configuration parameters.- Returns:
- the configuration parameters
-