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>ConfigRequestParameters</code> defines the Config Policy Request Parameters which retrieve(s) the policy from
29 * PDP if the request parameters match with any Config Policy.
33 public class ConfigRequestParameters {
34 private static final Gson GSON = new Gson();
35 private String policyName;
36 private String onapName;
37 private String configName;
38 private Map<String, String> configAttributes;
39 private UUID requestID;
40 private Boolean unique = false;
43 * Sets the PolicyName of the Config policy which needs to be retrieved.
45 * @param policyName the <code>String</code> format of the PolicyFile Name whose configuration is required.
47 public void setPolicyName(String policyName) {
48 this.policyName = policyName;
52 * Sets the ONAP Component Name of the Config policy which needs to be retrieved.
54 * @param onapName the <code>String</code> format of the onapName whose configuration is required.
56 public void setOnapName(String onapName) {
57 this.onapName = onapName;
61 * Sets the ONAP Component Name of the Config policy which needs to be retrieved.
63 * @param ecompName the <code>String</code> format of the onapName whose configuration is required.
64 * @deprecated use {@link #setOnapName(String)} instead.
67 public void setEcompName(String ecompName) {
68 this.onapName = ecompName;
72 * Sets the Config Name of the Config policy which needs to be retrieved.
74 * @param configName the <code>String</code> format of the configurationName whose configuration is required.
76 public void setConfigName(String configName) {
77 this.configName = configName;
81 * Sets the ConfigAttributes of the Config policy which needs to be retrieved.
83 * @param configAttributes the <code>Map</code> of <code>String,String</code> format of the configuration attributes
86 public void setConfigAttributes(Map<String, String> configAttributes) {
87 this.configAttributes = configAttributes;
91 * Sets the Request ID of the ONAP request.
93 * @param requestID unique <code>UUID</code> requestID which will be passed throughout the ONAP components to
94 * correlate logging messages.
96 public void setRequestID(UUID requestID) {
97 this.requestID = requestID;
101 * Gets the policyName of the Request Parameters.
103 * @return <code>String</code> format of the policyName.
105 public String getPolicyName() {
110 * Gets the ONAP Component Name of the Request Parameters.
112 * @return <code>String</code> format of the ONAP Component Name.
114 public String getOnapName() {
119 * Gets the ONAP Component Name of the Request Parameters.
121 * @return <code>String</code> format of the ONAP Component Name.
122 * @deprecated use {@link #getOnapName()} instead.
125 public String getEcompName() {
130 * Gets the Config name of the Request Parameters.
132 * @return <code>String</code> format of the Config Name.
134 public String getConfigName() {
139 * Gets the Config Attributes of the Request Parameters.
141 * @return <code>Map</code> of <code>String</code>,<code>String</code> format of the config Attributes.
143 public Map<String, String> getConfigAttributes() {
144 return configAttributes;
148 * Gets the Request ID of the Request Paramters.
150 * @return <code>UUID</code> format of requestID.
152 public UUID getRequestID() {
157 * Makes the results Unique, priority based. If set to True. Default Value is set to False.
159 * @param unique flag which is either true or false.
161 public void makeUnique(Boolean unique) {
162 this.unique = unique;
166 * Gets the Unique flag value from the Config Request Parameters.
168 * @return unique flag which is either true or false.
170 public Boolean getUnique() {
175 * Used to print the input Params for getCOnfig REST call.
177 * @return JSON String of this object.
180 public String toString() {
181 return GSON.toJson(this);