Package com.saperion.ngc.configuration
Class WebClientConfiguration
java.lang.Object
com.saperion.ngc.configuration.WebClientConfiguration
The configuration of the web client. Collects configuration parameters from context, default and custom
 configuration files.
- 
Field SummaryFields
- 
Method SummaryModifier and TypeMethodDescriptionstatic ParametergetContextParameter(String name) Loads a parameter from the servlet context (web.xml and includes).static ParametergetContextParameter(String name, jakarta.servlet.http.HttpSession session) Loads a parameter from the servlet context (web.xml and includes).static ParametergetContextParameter(String name, jakarta.servlet.ServletContext context) Loads a parameter from the servlet context (web.xml and includes).getCustomParameters(String filename, boolean caseSensitive) Loads all parameters from the specified file in the /custom-config/ folder.static ParametergetParameter(ConfigurationSource source, String name) Loads a parameter with the specified name from the specified source.static ParametergetParameter(String filename, String name) Loads a parameter from the specified file.getParameters(ConfigurationSource source, boolean caseSensitive) Loads all parameters from the specified source.getParameters(String filename, boolean caseSensitive) Loads all parameters from the specified file.static voidinit(jakarta.servlet.ServletContext context) Initializes the configuration by setting the servlet-context of the application.static voidshutdown()Shuts down the WebClientConfiguration instance.
- 
Field Details- 
DEFAULT_FOLDERThe folder containing the default configuration files- See Also:
 
- 
CUSTOM_FOLDERThe folder contiaining the customized configuration files.- See Also:
 
 
- 
- 
Method Details- 
getContextParameterLoads a parameter from the servlet context (web.xml and includes). Same as calling getParameter withConfigurationSource.CONTEXT. Note that this method usesExecutions.getCurrent(), so you can call it from within ZK-context only.- Parameters:
- name- the name of the parameter
- Returns:
- a Parametercontaining the value. Never null.
 
- 
getContextParameterLoads a parameter from the servlet context (web.xml and includes). Same as calling getParameter withConfigurationSource.CONTEXT. Use this method when you are outside of the ZK-context (e.g. in a servlet).- Parameters:
- name- the name of the parameter
- session- the current session
- Returns:
- a Parametercontaining the value. Never null.
 
- 
getContextParameterLoads a parameter from the servlet context (web.xml and includes). Same as calling getParameter withConfigurationSource.CONTEXT. Use this method when you are outside of the ZK-context (e.g. in a servlet).- Parameters:
- name- the name of the parameter
- context- the current servlet-context
- Returns:
- a Parametercontaining the value. Never null.
 
- 
getParameterLoads a parameter with the specified name from the specified source.- Parameters:
- source- the- ConfigurationSourceto load the parameter from
- name- the name of the parameter
- Returns:
- a parameter containing the value. Never null.
 
- 
getParametersLoads all parameters from the specified source.- Parameters:
- source- the- ConfigurationSourceto load the parameters from
- caseSensitive- if false, the returned map will be an instance of- CaseInsensitiveMap
- Returns:
- a map containing the parameters of the source
 
- 
getParameterLoads a parameter from the specified file. The file is expected to be in standard- properties format and must exist in /config/ folder.- Parameters:
- filename- the name (with path) of the file to load the parameters from (RELATIVE to the configuration folders)
- name- the name of the parameter
- Returns:
- a parameter containing the value. Never null.
 
- 
getParametersLoads all parameters from the specified file. The file is expected to be in standard- properties format and must exist in /config/ folder.- Parameters:
- filename- the name (with path) of the file to load the parameters from (RELATIVE to the configuration folders)
- caseSensitive- if false, the returned map will be an instance of- CaseInsensitiveMap
- Returns:
- a map containing the parameters of the file
 
- 
getCustomParametersLoads all parameters from the specified file in the /custom-config/ folder. The file is expected to be in standard-properties format. If the file is not found, an empty map will be returned.- Parameters:
- filename- the name (with path) of the file to load the parameters from (RELATIVE to the configuration folder)
- caseSensitive- if false, the returned map will be an instance of- CaseInsensitiveMap
- Returns:
- a map containing the parameters of the file
 
- 
initpublic static void init(jakarta.servlet.ServletContext context) Initializes the configuration by setting the servlet-context of the application. This method is supposed to be called once when the application is initialized.- Parameters:
- context- the- ServletContextof the application
 
- 
shutdownpublic static void shutdown()Shuts down the WebClientConfiguration instance.
 
-