01: /*
02: * Copyright 2004 Outerthought bvba and Schaubroeck nv
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License"); you may not
05: * use this file except in compliance with the License. You may obtain a copy of
06: * the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12: * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13: * License for the specific language governing permissions and limitations under
14: * the License.
15: */
16: package org.outerj.daisy.frontend.components.config;
17:
18: import org.apache.avalon.framework.configuration.Configuration;
19:
20: /**
21: * A place to get configuration information from.
22: *
23: * <p>There are three levels of configuration:
24: * <ul>
25: * <li>site-level config
26: * <li>datadir config
27: * <li>webapp config
28: * </ul>
29: *
30: * <p>Configuration is addressed by slash-separated paths, paths do not start or end with slash.
31: */
32: public interface ConfigurationManager {
33:
34: static final String ROLE = ConfigurationManager.class.getName();
35:
36: /**
37: * @param fallback fallback to webapp conf
38: * @return the configuration, or null if there is no configuration
39: */
40: Configuration getConfiguration(String path, boolean fallback);
41:
42: /**
43: *
44: * @param site name of the Daisy Wiki site
45: * @param fallback fallback to global conf (datadir, webapp)
46: * @return the configuration, or null if there is no configuration
47: */
48: Configuration getConfiguration(String site, String path,
49: boolean fallback);
50:
51: /**
52: * Does getConfiguration(path, true).
53: */
54: Configuration getConfiguration(String path);
55:
56: /**
57: * Does getConfiguration(site, path, true).
58: */
59: Configuration getConfiguration(String site, String path);
60: }
|