KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > pentaho > core > system > ISystemSettings


1 /*
2  * Copyright 2006 Pentaho Corporation. All rights reserved.
3  * This software was developed by Pentaho Corporation and is provided under the terms
4  * of the Mozilla Public License, Version 1.1, or any later version. You may not use
5  * this file except in compliance with the license. If you need a copy of the license,
6  * please go to http://www.mozilla.org/MPL/MPL-1.1.txt. The Original Code is the Pentaho
7  * BI Platform. The Initial Developer is Pentaho Corporation.
8  *
9  * Software distributed under the Mozilla Public License is distributed on an "AS IS"
10  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. Please refer to
11  * the license for the specific language governing your rights and limitations.
12  *
13  * @created Jul 19, 2005
14  * @author James Dixon
15  *
16  */

17
18 package org.pentaho.core.system;
19
20 import java.util.List JavaDoc;
21 import java.util.Properties JavaDoc;
22
23 import org.dom4j.Document;
24
25 /**
26  * The SystemSettings manages the platform's overall configuration settings.
27  * These settings by default can be found in the system tree in an xml file
28  * named "pentaho.xml."
29  */

30
31 public interface ISystemSettings {
32
33     /**
34      * This constant is for the overall system settings file name.
35      */

36     public static final String JavaDoc PENTAHOSETTINGSFILENAME = "pentaho.xml"; //$NON-NLS-1$
37

38     /**
39      * Gets a system setting from the system path
40      *
41      * @param path
42      * relative to the "system" directory, go to this document
43      * @param settingName
44      * the setting name to get
45      * @param defaultValue
46      * the value to use if the setting isn't specified in the setting
47      * document
48      * @return the setting requested, or the default value if not found
49      */

50     public String JavaDoc getSystemSetting(String JavaDoc path, String JavaDoc settingName, String JavaDoc defaultValue);
51
52     /**
53      * Gets a system setting from the system configuration file
54      *
55      * @param settingName
56      * the setting name to get
57      * @param defaultValue
58      * the value to use if the setting isn't specified in the setting
59      * document
60      * @return the setting requested, or the default value if not found
61      */

62     public String JavaDoc getSystemSetting(String JavaDoc settingName, String JavaDoc defaultValue);
63
64     /**
65      * Gets a section from the specified settings document
66      *
67      * @param path
68      * relative to the system directory, go to this document
69      * @param settingSection
70      * the section is the document to retrieve
71      * @return the list of settings in the specified section of the document
72      */

73     public List JavaDoc getSystemSettings(String JavaDoc path, String JavaDoc settingSection);
74
75     /**
76      * Gets a section from the system system configuration file
77      *
78      * @param settingSection
79      * the section to retrieve
80      * @return the list of elements in the section of the document.
81      */

82     public List JavaDoc getSystemSettings(String JavaDoc settingSection);
83
84     /**
85      * The SystemSettings object caches each settings document once it's read
86      * in. If the system gets a refresh event, this should be called to make
87      * sure that the system settings get refreshed.
88      */

89     public void resetSettingsCache();
90
91     /**
92      * Returns a Document object containing the settings document within the
93      * path specified by actionPath.
94      *
95      * @param actionPath
96      * The XML document relative to the solution that contains the
97      * settings desired
98      * @return Document Parsed XML document.
99      */

100     public Document getSystemSettingsDocument(String JavaDoc actionPath);
101
102     /**
103      * Gets a properties file from the solution.
104      * @param path Relative path to the properties file within the solution
105      * @return <tt>Properties</tt> object containing the properties.
106      */

107     public Properties JavaDoc getSystemSettingsProperties(String JavaDoc path);
108
109 }
110
Popular Tags