01: /*
02: * Copyright 2005-2006 The Kuali Foundation.
03: *
04: *
05: * Licensed under the Educational Community License, Version 1.0 (the "License");
06: * you may not use this file except in compliance with the License.
07: * You may obtain a copy of the License at
08: *
09: * http://www.opensource.org/licenses/ecl1.php
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: package org.kuali.rice.config;
18:
19: import java.util.Map;
20:
21: /**
22: * A local store for node-specific settings. The use of the word "Node" here describes an instance of KEW
23: * (running standalone or embedded). In a clustered environment, it is sometimes useful for individual
24: * nodes within the cluster to have their own settings. Depending on system configuration this configuration
25: * store may or may not be available for use. If the node settings store is not availabe then calls to
26: * query or modify the settings should be no-ops. The availablily can be queried using the isEnabled method.
27: *
28: * <p>Since Node Settings are runtime-mutable, it is important that implementations of this class be thread-safe.
29: *
30: * @author Kuali Rice Team (kuali-rice@googlegroups.com)
31: */
32: public interface NodeSettings {
33:
34: /**
35: * Retrieve the value of the setting with the given name. Will return null if the setting with the
36: * given name does not exist or node settings are not enabled.
37: *
38: * @return the value of the setting, null if the setting does not exis or node settings are not enabled
39: */
40: public String getSetting(String name);
41:
42: /**
43: * Set the value of the setting with the given name. Has no effect if node settings are not enabled.
44: */
45: public void setSetting(String name, String value);
46:
47: /**
48: * Remove the given setting from the node settings. If the setting with the given name does not
49: * exist or node settings are not enabled, then null will be returned.
50: *
51: * @return return the value of the removed setting, null if the setting does not exist
52: * or node settings are not enabled
53: */
54: public String removeSetting(String name);
55:
56: /**
57: * Returns the settings of this node as an immutable Map. If the node settings store
58: * is not enabled, then an empty Map will be returned. The Map
59: * returned by the getSettings method is thread-safe.
60: * @return
61: */
62: public Map getSettings();
63:
64: /**
65: * Returns true if node-specific settings are enabled, false otherwise. In the case that node settings
66: * are not enabled, the various accessor methods will effectively behave as no-ops.
67: *
68: * @return true if node settings are enabled, false otherwise
69: */
70: public boolean isEnabled();
71:
72: }
|