org.pentaho.platform.engine.core.system
Class SimpleSystemSettings

java.lang.Object
  extended by org.pentaho.platform.engine.core.system.SimpleSystemSettings
All Implemented Interfaces:
ISystemSettings

public class SimpleSystemSettings
extends Object
implements ISystemSettings


Constructor Summary
SimpleSystemSettings()
           
 
Method Summary
 void addSetting(String name, String value)
           
 String getSystemCfgSourceName()
          Gets the name of the source of the system configurations.
 String getSystemSetting(String settingName, String defaultValue)
          Gets a system setting from the system configuration file
 String getSystemSetting(String path, String settingName, String defaultValue)
          Gets a system setting from the system path
 List getSystemSettings(String settingSection)
          Gets a section from the system system configuration file
 List getSystemSettings(String path, String settingSection)
          Gets a section from the specified settings document
 org.dom4j.Document getSystemSettingsDocument(String actionPath)
          Returns a Document object containing the settings document within the path specified by actionPath.
 Properties getSystemSettingsProperties(String path)
          Gets a properties file from the solution.
 void resetSettingsCache()
          The SystemSettings object caches each settings document once it's read in.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleSystemSettings

public SimpleSystemSettings()
Method Detail

addSetting

public void addSetting(String name,
                       String value)

getSystemCfgSourceName

public String getSystemCfgSourceName()
Description copied from interface: ISystemSettings
Gets the name of the source of the system configurations. For system configurations that are stored in a file, it should return the filename. Other implementations should return a name that is relevant to the implementation (possibly a URL, or a database sql query, etc.) Often this will be pentaho.xml

Specified by:
getSystemCfgSourceName in interface ISystemSettings
Returns:
String containing a name that identifies the source of the system configuration

getSystemSetting

public String getSystemSetting(String path,
                               String settingName,
                               String defaultValue)
Description copied from interface: ISystemSettings
Gets a system setting from the system path

Specified by:
getSystemSetting in interface ISystemSettings
Parameters:
path - relative to the "system" directory, go to this document
settingName - the setting name to get
defaultValue - the value to use if the setting isn't specified in the setting document
Returns:
the setting requested, or the default value if not found

getSystemSetting

public String getSystemSetting(String settingName,
                               String defaultValue)
Description copied from interface: ISystemSettings
Gets a system setting from the system configuration file

Specified by:
getSystemSetting in interface ISystemSettings
Parameters:
settingName - the setting name to get
defaultValue - the value to use if the setting isn't specified in the setting document
Returns:
the setting requested, or the default value if not found

getSystemSettings

public List getSystemSettings(String path,
                              String settingSection)
Description copied from interface: ISystemSettings
Gets a section from the specified settings document

Specified by:
getSystemSettings in interface ISystemSettings
Parameters:
path - relative to the system directory, go to this document
settingSection - the section is the document to retrieve
Returns:
the list of settings in the specified section of the document

getSystemSettings

public List getSystemSettings(String settingSection)
Description copied from interface: ISystemSettings
Gets a section from the system system configuration file

Specified by:
getSystemSettings in interface ISystemSettings
Parameters:
settingSection - the section to retrieve
Returns:
the list of elements in the section of the document.

getSystemSettingsDocument

public org.dom4j.Document getSystemSettingsDocument(String actionPath)
Description copied from interface: ISystemSettings
Returns a Document object containing the settings document within the path specified by actionPath.

Specified by:
getSystemSettingsDocument in interface ISystemSettings
Parameters:
actionPath - The XML document relative to the solution that contains the settings desired
Returns:
Document Parsed XML document.

getSystemSettingsProperties

public Properties getSystemSettingsProperties(String path)
Description copied from interface: ISystemSettings
Gets a properties file from the solution.

Specified by:
getSystemSettingsProperties in interface ISystemSettings
Parameters:
path - Relative path to the properties file within the solution
Returns:
Properties object containing the properties.

resetSettingsCache

public void resetSettingsCache()
Description copied from interface: ISystemSettings
The SystemSettings object caches each settings document once it's read in. If the system gets a refresh event, this should be called to make sure that the system settings get refreshed.

Specified by:
resetSettingsCache in interface ISystemSettings