com.indexdata.masterkey.config
public class ModuleConfiguration extends Object implements ModuleConfigurationGetter, Serializable
Modifier and Type | Field and Description |
---|---|
String |
moduleName |
Constructor and Description |
---|
ModuleConfiguration(MasterkeyConfiguration mkConfigContext,
String moduleName) |
Modifier and Type | Method and Description |
---|---|
String |
get(String name)
Short-hand for getting a parameter value by name
|
String |
get(String name,
String defaultValue)
Short-hand for getting a parameter value by name, while returning
the provided defaultValue if the parameter is not found
|
String |
getConfigFilePath()
Retrieves the location of this components property file.
|
Map<String,String> |
getConfigMap()
Retrieves all the parameters for the module as a HashMap.
|
String |
getConfigParameter(String name)
Retrieves a config parameter prefixed with a given module name (ie a servlet name)
|
Properties |
getConfigProperties()
Retrieves all parameters for the module as a Properties
|
String |
getContextKey() |
String |
getHostName()
Host name intended for logging.
|
String |
getMandatory(String name)
Gets a mandatory parameter value by name
|
boolean |
hasParameter(String name)
Short-hand for checking for the existence of a parameter
|
String |
toString() |
public String moduleName
public ModuleConfiguration(MasterkeyConfiguration mkConfigContext, String moduleName)
public String getConfigParameter(String name) throws IOException
name
- The name of the parameter, without the service name prefix.javax.servlet.ServletException
IOException
public Map<String,String> getConfigMap() throws IOException
javax.servlet.ServletException
IOException
public Properties getConfigProperties() throws IOException
IOException
public String getContextKey()
public String getConfigFilePath()
getConfigFilePath
in interface ModuleConfigurationGetter
public String getHostName()
public String get(String name)
get
in interface ModuleConfigurationGetter
name
- public String get(String name, String defaultValue)
get
in interface ModuleConfigurationGetter
name
- defaultValue
- public String getMandatory(String name) throws MissingMandatoryParameterException
getMandatory
in interface ModuleConfigurationGetter
name
- parameter keyException
- if mandatory parameter was not foundMissingMandatoryParameterException
public boolean hasParameter(String name)
name
- Copyright © 2014. All rights reserved.