com.ibm.commerce.server
Class ConfigProperties

java.lang.Object
  |
  +--java.util.Dictionary
        |
        +--java.util.Hashtable
              |
              +--java.util.Properties
                    |
                    +--com.ibm.commerce.server.ConfigProperties
All Implemented Interfaces:
java.lang.Cloneable, java.util.Map, java.io.Serializable

public class ConfigProperties
extends java.util.Properties
implements java.io.Serializable

Gets the properties values from property cache. The property cache is constructed from the information in the configuration xml file. The key for the properties is all the hierarchy path from "InstanceProperties" layer in the configuration file, plus the property attribute name and separated with "/", for example, "RuleServices/RuleService/name".

See Also:
Serialized Form

Field Summary
static java.lang.String COPYRIGHT
          IBM copyright notice field.
protected  java.lang.String merchantKey
           
 
Fields inherited from class java.util.Properties
defaults
 
Method Summary
 void addWebModule(WebModuleConfig config)
          Adds a web modules configuration.
 java.util.Vector getAllValues(java.lang.String key)
          Returns all values from the configuration file as a Vector
 java.lang.String getMerchantKey()
          Gets the merchant key
 java.lang.String getSeparator()
          Gets a separator character.
 java.lang.String getValue(java.lang.String key)
          Returns the first value from the configuration file as a string
 java.lang.String getValue(java.lang.String key, java.lang.String def)
          Returns the first value from the configuration file as a string
 WebModuleConfig getWebModule(java.lang.String name)
          Gets a web module configuation given the web module name.
 WebModuleConfig getWebModuleByContextPath(java.lang.String path)
          Returns a web module configuation given a context path.
 java.lang.String getWebServerAlias(java.lang.String key)
          Returns the value of a web server alias.
 void setMerchantKey(java.lang.String key)
          Gets the merchant key.
 void setWebModule(java.lang.String name, WebModuleConfig config)
          Sets the web modules configuration by name.
 void setWebModuleByContextPath(java.lang.String contextPath, WebModuleConfig config)
          Sets the web modules configuration for a context path.
 void setWebServerAlias(java.lang.String name, java.lang.String value)
          Sets the value of a web server alias.
static  ConfigProperties singleton()
          Gets a singleton ConfigProperties object.
 
Methods inherited from class java.util.Properties
getProperty, getProperty, list, list, load, propertyNames, save, setProperty, store
 
Methods inherited from class java.util.Hashtable
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail
public static final java.lang.String COPYRIGHT
IBM copyright notice field.
See Also:
Constant Field Values

merchantKey

protected java.lang.String merchantKey
Method Detail

getAllValues

public java.util.Vector getAllValues(java.lang.String key)
Returns all values from the configuration file as a Vector
Parameters:
key - the key to find a value for, the format is hierarchy path1 + "/" + path2 .. + "/" + nameOfAttribute
Returns:
all values associtated with the key passed in from the attribute set

getMerchantKey

public java.lang.String getMerchantKey()
Gets the merchant key
Returns:
the merchant key value

getSeparator

public java.lang.String getSeparator()
Gets a separator character.
Returns:
the separator

getValue

public java.lang.String getValue(java.lang.String key)
Returns the first value from the configuration file as a string
Parameters:
key - the key to find a value for, the format is hierarchy path1 + "/" + path2 .. + "/" + nameOfAttribute
Returns:
the first value associtated with the key passed in from the attribute set

getValue

public java.lang.String getValue(java.lang.String key,
                                 java.lang.String def)
Returns the first value from the configuration file as a string
Parameters:
key - the key to find a value for
def - the default value if no parameter with that key is found
Returns:
the first value associtated with the key passed in from the attribute set

getWebServerAlias

public java.lang.String getWebServerAlias(java.lang.String key)
Returns the value of a web server alias.
Parameters:
key - name of web module

setMerchantKey

public void setMerchantKey(java.lang.String key)
Gets the merchant key.
Returns:
the merchant key value

setWebServerAlias

public void setWebServerAlias(java.lang.String name,
                              java.lang.String value)
Sets the value of a web server alias.
Parameters:
name - name of alias,
value - value of alias,

singleton

public static ConfigProperties singleton()
Gets a singleton ConfigProperties object.
Returns:
a singleton ConfigProperties

getWebModuleByContextPath

public WebModuleConfig getWebModuleByContextPath(java.lang.String path)
Returns a web module configuation given a context path.
Parameters:
path - the context path for the web module
Returns:
a web module configuration.

setWebModuleByContextPath

public void setWebModuleByContextPath(java.lang.String contextPath,
                                      WebModuleConfig config)
Sets the web modules configuration for a context path.
Parameters:
config - the web module configuration

getWebModule

public WebModuleConfig getWebModule(java.lang.String name)
Gets a web module configuation given the web module name.
Parameters:
name - web module name
Returns:
a web module configuration

setWebModule

public void setWebModule(java.lang.String name,
                         WebModuleConfig config)
Sets the web modules configuration by name.
Parameters:
name - web module name
config - the web module configuration

addWebModule

public void addWebModule(WebModuleConfig config)
Adds a web modules configuration.
Parameters:
config - the web module configuration