Reduce technical debt and add JUnit
[policy/engine.git] / PolicyEngineAPI / src / main / java / org / onap / policy / api / DecisionRequestParameters.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * PolicyEngineAPI
4  * ================================================================================
5  * Copyright (C) 2017 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 package org.onap.policy.api;
22
23 import java.util.Map;
24 import java.util.UUID;
25
26 /**
27  * <code>DecisionRequestParameters</code> defines the Decision Policy Request Parameters
28  *  which retrieve(s) the response from PDP if the request parameters match with any Decision Policy.
29  * 
30  * @version 0.1
31  */
32 public class DecisionRequestParameters {
33         private String onapName;
34         private Map<String,String> decisionAttributes;
35         private UUID requestID;
36         
37         /**
38          * Constructor with no Parameters
39          */
40         public DecisionRequestParameters(){
41                 // Empty constructor
42         }
43         
44         /**
45          * Constructor with Parameters
46          * 
47          * @param onapName the <code>String</code> format of the onapName whose Decision is required.
48          * @param decisionAttributes the <code>Map</code> of <code>String,String</code> format of the decisionAttributes that contain the ID and values.
49          * @param requestID unique request ID which will be passed throughout the ONAP components to correlate logging messages.
50          */
51         public DecisionRequestParameters(String onapName, Map<String,String> decisionAttributes, UUID requestID){
52                 this.onapName = onapName;
53                 this.decisionAttributes = decisionAttributes;
54                 this.requestID = requestID;
55         }
56         
57         /**
58          * Gets the onapName of the Decision Request Parameters. 
59          * 
60          * @return onapName the <code>String</code> format of the onapName of the Decision Request Parameters.
61          */
62         public String getOnapName() {
63                 return onapName;
64         }
65         
66         /**
67      * Gets the onapName of the Decision Request Parameters. 
68      * 
69      * @return onapName the <code>String</code> format of the onapName of the Decision Request Parameters.
70      * @deprecated use {@link #getOnapName()} instead. 
71      */
72         @Deprecated
73     public String getECOMPComponentName() {
74         return onapName;
75     }
76         
77         /**
78          * Sets the onapName of the Decision Request parameters.  
79          * 
80          * @param onapName the <code>String</code> format of the onapName whose Decision is required.
81          */
82         public void setOnapName(String onapName) {
83                 this.onapName = onapName;
84         }
85         
86         /**
87      * Sets the ecompComponentName of the Decision Request parameters.  
88      * 
89      * @param ecompName the <code>String</code> format of the onapName whose Decision is required.
90      * @deprecated use {@link #setOnapName(String)} instead. 
91      */
92         @Deprecated
93     public void setECOMPComponentName(String ecompName) {
94         this.onapName = ecompName;
95     }
96         
97         /**
98          * Gets the Decision Attributes from Decision Request Parameters. 
99          * 
100          * @return decisionAttributes the <code>Map</code> of <code>String,String</code> format of the decisionAttributes that contain the ID and values.
101          */
102         public Map<String,String> getDecisionAttributes() {
103                 return decisionAttributes;
104         }
105         /**
106          * Sets the Decision Attributes which contain ID and values for obtaining Decision from PDP. 
107          * 
108          * @param decisionAttributes the <code>Map</code> of <code>String,String</code> format of the decisionAttributes that must contain the ID and values.
109          */
110         public void setDecisionAttributes(Map<String,String> decisionAttributes) {
111                 this.decisionAttributes = decisionAttributes;
112         }
113         /**
114          * Gets the request ID of Decision Request Parameters. 
115          * 
116          * @return the requestID unique request ID which will be passed throughout the ONAP components to correlate logging messages.
117          */
118         public UUID getRequestID() {
119                 return requestID;
120         }
121         /**
122          * Sets the ReqestID of Decision Request Parameters which will be passed around ONAP requests.
123          * 
124          * @param requestID unique request ID which will be passed throughout the ONAP components to correlate logging messages.
125          */
126         public void setRequestID(UUID requestID) {
127                 this.requestID = requestID;
128         }
129 }