2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017-2019 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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
21 package org.onap.policy.api;
23 import com.google.gson.Gson;
25 import java.util.UUID;
28 * <code>DecisionRequestParameters</code> defines the Decision Policy Request Parameters which retrieve(s) the response
29 * from PDP if the request parameters match with any Decision Policy.
33 public class DecisionRequestParameters {
34 private static final Gson GSON = new Gson();
35 private String onapName;
36 private Map<String, String> decisionAttributes;
37 private UUID requestID;
40 * Constructor with no Parameters
42 public DecisionRequestParameters() {
47 * Constructor with Parameters
49 * @param onapName the <code>String</code> format of the onapName whose Decision is required.
50 * @param decisionAttributes the <code>Map</code> of <code>String,String</code> format of the decisionAttributes
51 * that contain the ID and values.
52 * @param requestID unique request ID which will be passed throughout the ONAP components to correlate logging
55 public DecisionRequestParameters(String onapName, Map<String, String> decisionAttributes, UUID requestID) {
56 this.onapName = onapName;
57 this.decisionAttributes = decisionAttributes;
58 this.requestID = requestID;
62 * Gets the onapName of the Decision Request Parameters.
64 * @return onapName the <code>String</code> format of the onapName of the Decision Request Parameters.
66 public String getOnapName() {
71 * Gets the onapName of the Decision Request Parameters.
73 * @return onapName the <code>String</code> format of the onapName of the Decision Request Parameters.
74 * @deprecated use {@link #getOnapName()} instead.
77 public String getECOMPComponentName() {
82 * Sets the onapName of the Decision Request parameters.
84 * @param onapName the <code>String</code> format of the onapName whose Decision is required.
86 public void setOnapName(String onapName) {
87 this.onapName = onapName;
91 * Sets the ecompComponentName of the Decision Request parameters.
93 * @param ecompName the <code>String</code> format of the onapName whose Decision is required.
94 * @deprecated use {@link #setOnapName(String)} instead.
97 public void setECOMPComponentName(String ecompName) {
98 this.onapName = ecompName;
102 * Gets the Decision Attributes from Decision Request Parameters.
104 * @return decisionAttributes the <code>Map</code> of <code>String,String</code> format of the decisionAttributes
105 * that contain the ID and values.
107 public Map<String, String> getDecisionAttributes() {
108 return decisionAttributes;
112 * Sets the Decision Attributes which contain ID and values for obtaining Decision from PDP.
114 * @param decisionAttributes the <code>Map</code> of <code>String,String</code> format of the decisionAttributes
115 * that must contain the ID and values.
117 public void setDecisionAttributes(Map<String, String> decisionAttributes) {
118 this.decisionAttributes = decisionAttributes;
122 * Gets the request ID of Decision Request Parameters.
124 * @return the requestID unique request ID which will be passed throughout the ONAP components to correlate logging
127 public UUID getRequestID() {
132 * Sets the ReqestID of Decision Request Parameters which will be passed around ONAP requests.
134 * @param requestID unique request ID which will be passed throughout the ONAP components to correlate logging
137 public void setRequestID(UUID requestID) {
138 this.requestID = requestID;
142 * Used to print the input Params for getDecision REST call.
144 * @return JSON String of this object.
147 public String toString() {
148 return GSON.toJson(this);