01: /*
02: * Copyright 2005-2007 The Kuali Foundation.
03: *
04: * Licensed under the Educational Community License, Version 1.0 (the "License"); you may not use this file except in
05: * compliance with the License. You may obtain a copy of the License at
06: *
07: * http://www.opensource.org/licenses/ecl1.php
08: *
09: * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS
10: * IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
11: * language governing permissions and limitations under the License.
12: */
13: package org.kuali.core.service;
14:
15: import java.util.List;
16: import java.util.Map;
17: import java.util.Properties;
18:
19: import org.kuali.core.bo.Parameter;
20:
21: /**
22: * This interface defines methods that a KualiConfiguration Service must provide. Provides methods for getting string
23: * resources.
24: */
25: public interface KualiConfigurationService {
26: /**
27: * Given a property name (key), returns the value associated with that key, or null if none is available.
28: *
29: * @param key
30: * @return String associated with the given key
31: * @throws IllegalArgumentException
32: * if the key is null
33: */
34: public String getPropertyString(String key);
35:
36: /**
37: * Given a property name (key), returns the "booleanized" value associated with that key.
38: *
39: * true, yes, on, or 1 are translated into <b>true</b> - all other values result in <b>false</b>
40: *
41: * @param key
42: * @return String associated with the given key
43: * @throws IllegalArgumentException
44: * if the key is null
45: */
46: public boolean getPropertyAsBoolean(String key);
47:
48: /**
49: * @return Properties instance containing all (key,value) pairs known to the service
50: */
51: public Properties getAllProperties();
52:
53: /**
54: * Returns whether this instance is production based on the configuration options.
55: */
56: public boolean isProductionEnvironment();
57:
58: /**
59: * This method retrieves a parameter based on the primary key
60: */
61: public Parameter getParameter(String namespaceCode,
62: String detailTypeCode, String parameterName);
63:
64: /**
65: * This method retrieves a set of parameters based on arbitraty criteria
66: */
67: public List<Parameter> getParameters(Map<String, String> criteria);
68:
69: /**
70: * This method retrieves a parameter expected to have a Yes / no value and converts to a boolean for convenience
71: */
72: public boolean getIndicatorParameter(String namespaceCode,
73: String detailTypeCode, String parameterName);
74:
75: /**
76: * This method returns a list of the parameter values split on implementation specific criteria.
77: * For the default KualiConfigurationServiceImpl, the split is on a semi-colon.
78: */
79: public List<String> getParameterValues(String namespaceCode,
80: String detailTypeCode, String parameterName);
81:
82: /**
83: * This method returns the value of the specified parameter
84: */
85: public String getParameterValue(String namespaceCode,
86: String detailTypeCode, String parameterName);
87:
88: /**
89: * This method determines whether the parameter values list constains the specified constrainedValue
90: */
91: public boolean evaluateConstrainedValue(String namespaceCode,
92: String detailTypeCode, String parameterName,
93: String constrainedValue);
94: }
|