AT&T 2.0.19 Code drop, stage 1
[aaf/authz.git] / misc / env / src / main / java / org / onap / aaf / misc / env / EnvProps.java
1 /**
2  * ============LICENSE_START====================================================
3  * org.onap.aaf
4  * ===========================================================================
5  * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
6  * ===========================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END====================================================
19  *
20  */
21
22 package org.onap.aaf.misc.env;
23
24 import java.util.Map;
25
26 public interface EnvProps extends Env {
27         public interface EnvProperty {
28                 public String getProperty(String input);
29         };
30
31         /**
32          * Obtain a Property (String) based on a Key.  Implementor decides how
33          * that works, i.e. from a complex set of Configurations, or just 
34          * "System" (Java standard)
35          * 
36          * @param key
37          * @return APIException
38          */
39         public String getProperty(String key);
40
41         /**
42          * Obtain a Property (String) based on a Key.  Implementor decides how
43          * that works, i.e. from a complex set of Configurations, or just 
44          * "System" (Java standard)
45          * 
46          * If Property Value is null, then default will be used.
47          * @param key
48          * @return APIException
49          */
50         public String getProperty(String tag, String defaultValue);
51
52         /**
53          * Set a Property (String) based on a Key accessible to all in Env.  Implementor decides how
54          * that works, i.e. from a complex set of Configurations, or just 
55          * "System" (Java standard)
56          * 
57          * @param key
58          * @return APIException
59          */
60         public String setProperty(String key, String value);
61         
62         /**
63          * Get the SubProperties based on key.
64          * 
65          * use "false" to remove prefix, "true" to leave prefix in.
66          * 
67          * @param key
68          * @return APIException
69          * Given a known property set (or in this case, properties starting with key), 
70          * return map of all properties with appropriate key names
71          */
72         public Map<String, String> getSubProperties(String key, boolean includePrefix);
73
74         /**
75          * Get all of the properties in the Environment
76          * @return
77          */
78         public Map<String, String> getProperties();
79
80 }