com.indexdata.masterkey.config
public class MasterkeyConfiguration extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
static String |
MASTERKEY_CONFIG_LIFE_TIME_PARAM |
Modifier and Type | Method and Description |
---|---|
boolean |
areConfigParamsCached() |
ConfigFileLocation |
getConfigFileLocation() |
String |
getConfigParameter(String prefix,
String name)
Retrieves a given config parameter by name and module/prefix.
|
Enumeration<String> |
getConfigParameterNames(String prefix)
Retrieves all config parameter names for the module
|
Map<String,String> |
getConfigParamsAsMap(String prefix)
Retrieves all config parameters for a module/prefix as a HashMap.
|
Properties |
getConfigParamsAsProperties(String prefix)
Returns the config parameters as Properties for a module/prefix
|
String |
getContextKey()
Provides a unique key for this configuration context (unique per j2ee component and vhost)
|
String |
getHostName()
Host name intended for use in logging.
|
static MasterkeyConfiguration |
getInstance(javax.servlet.ServletContext servletContext,
String appId,
String hostName)
Creates a singleton MasterkeyConfiguration for each combination of component name and host name.
|
static MasterkeyConfiguration |
getInstance(javax.servlet.ServletContext servletContext,
String appId,
String hostName,
String configFileName)
Creates a singleton MasterkeyConfiguration for each combination of component name, host name, and property file name.
|
static ModuleConfiguration |
getModuleConfiguration(javax.servlet.ServletContext servletContext,
String hostName,
String appId,
String moduleName) |
ModuleConfiguration |
getModuleConfiguration(String moduleName)
Creates a ModuleConfiguration holding the subset of properties that applies to the given module
|
public static final String MASTERKEY_CONFIG_LIFE_TIME_PARAM
public static MasterkeyConfiguration getInstance(javax.servlet.ServletContext servletContext, String appId, String hostName) throws IOException
servletContext
- Needed to pick up init parameters regarding the location of config fileshostName
- Used for resolving the path to config files.IOException
public static MasterkeyConfiguration getInstance(javax.servlet.ServletContext servletContext, String appId, String hostName, String configFileName) throws IOException
servletContext
- Needed to pick up init parameters regarding the location of config fileshostName
- Used for resolving the path to config files.configFileName
- Defined by components code.IOException
public String getContextKey()
public ModuleConfiguration getModuleConfiguration(String moduleName) throws IOException
moduleName
- Must match the prefix of the properties to pick upIOException
public boolean areConfigParamsCached()
public Enumeration<String> getConfigParameterNames(String prefix) throws IOException
javax.servlet.ServletException
IOException
public String getConfigParameter(String prefix, String name) throws IOException
name
- javax.servlet.ServletException
IOException
public Map<String,String> getConfigParamsAsMap(String prefix) throws IOException
javax.servlet.ServletException
IOException
public ConfigFileLocation getConfigFileLocation()
public String getHostName()
public Properties getConfigParamsAsProperties(String prefix) throws IOException
IOException
public static ModuleConfiguration getModuleConfiguration(javax.servlet.ServletContext servletContext, String hostName, String appId, String moduleName) throws IOException
IOException
Copyright © 2014. All rights reserved.