| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| KualiConfigurationService |
|
| 1.0;1 |
| 1 | /* | |
| 2 | * Copyright 2005-2008 The Kuali Foundation | |
| 3 | * | |
| 4 | * Licensed under the Educational Community License, Version 2.0 (the "License"); you may not use this file except in | |
| 5 | * compliance with the License. You may obtain a copy of the License at | |
| 6 | * | |
| 7 | * http://www.opensource.org/licenses/ecl2.php | |
| 8 | * | |
| 9 | * 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.rice.kns.service; | |
| 14 | ||
| 15 | import java.util.List; | |
| 16 | import java.util.Properties; | |
| 17 | ||
| 18 | /** | |
| 19 | * This interface defines methods that a KualiConfiguration Service must provide. Provides methods for getting string | |
| 20 | * resources. | |
| 21 | */ | |
| 22 | public interface KualiConfigurationService { | |
| 23 | /** | |
| 24 | * Given a property name (key), returns the value associated with that key, or null if none is available. | |
| 25 | * | |
| 26 | * @param key | |
| 27 | * @return String associated with the given key | |
| 28 | * @throws IllegalArgumentException | |
| 29 | * if the key is null | |
| 30 | */ | |
| 31 | public String getPropertyString(String key); | |
| 32 | ||
| 33 | /** | |
| 34 | * Given a property name (key), returns the "booleanized" value associated with that key. | |
| 35 | * | |
| 36 | * true, yes, on, or 1 are translated into <b>true</b> - all other values result in <b>false</b> | |
| 37 | * | |
| 38 | * @param key | |
| 39 | * @return String associated with the given key | |
| 40 | * @throws IllegalArgumentException | |
| 41 | * if the key is null | |
| 42 | */ | |
| 43 | public boolean getPropertyAsBoolean(String key); | |
| 44 | ||
| 45 | /** | |
| 46 | * @return Properties instance containing all (key,value) pairs known to the service | |
| 47 | */ | |
| 48 | public Properties getAllProperties(); | |
| 49 | ||
| 50 | /** | |
| 51 | * Returns whether this instance is production based on the configuration options. | |
| 52 | */ | |
| 53 | public boolean isProductionEnvironment(); | |
| 54 | ||
| 55 | /** | |
| 56 | * This method retrieves a parameter based on the primary key | |
| 57 | */ | |
| 58 | //public Parameter getParameter(String namespaceCode, String detailTypeCode, String parameterName); | |
| 59 | ||
| 60 | /** | |
| 61 | * This method retrieves a parameter based on the primary key. Unlike {@link #getParameter(String, String, String)}, | |
| 62 | * this method does not throw an exception if the parameter cannot be found. It instead returns null. | |
| 63 | */ | |
| 64 | //public Parameter getParameterWithoutExceptions(String namespaceCode, String detailTypeCode, String parameterName); | |
| 65 | ||
| 66 | /** | |
| 67 | * This method retrieves a set of parameters based on arbitraty criteria | |
| 68 | */ | |
| 69 | //public List<Parameter> getParameters(Map<String, String> criteria); | |
| 70 | ||
| 71 | /** | |
| 72 | * This method retrieves a parameter expected to have a Yes / no value and converts to a boolean for convenience | |
| 73 | */ | |
| 74 | @Deprecated | |
| 75 | public boolean getIndicatorParameter(String namespaceCode, String detailTypeCode, String parameterName); | |
| 76 | ||
| 77 | /** | |
| 78 | * This method returns a list of the parameter values split on implementation specific criteria. | |
| 79 | * For the default KualiConfigurationServiceImpl, the split is on a semi-colon. | |
| 80 | */ | |
| 81 | @Deprecated | |
| 82 | public List<String> getParameterValues(String namespaceCode, String detailTypeCode, String parameterName); | |
| 83 | ||
| 84 | /** | |
| 85 | * This method returns the value of the specified parameter | |
| 86 | */ | |
| 87 | @Deprecated | |
| 88 | public String getParameterValue(String namespaceCode, String detailTypeCode, String parameterName); | |
| 89 | ||
| 90 | /** | |
| 91 | * This method determines whether the parameter values list constains the specified constrainedValue | |
| 92 | */ | |
| 93 | //public boolean evaluateConstrainedValue(String namespaceCode, String detailTypeCode, String parameterName, | |
| 94 | // String constrainedValue); | |
| 95 | } |