summaryrefslogtreecommitdiffstats
path: root/PolicyEngineAPI
diff options
context:
space:
mode:
authorpa834y <pa834y@att.com>2019-04-04 09:02:48 -0400
committerpa834y <pa834y@att.com>2019-04-05 16:06:57 -0400
commit6d72b847fe202bc1cd6fb3922755be774de0df69 (patch)
tree97a8fd76d296d6788d8dbb0b52b97fbc40d64c3d /PolicyEngineAPI
parentd5f95d08ffd3f2e16b67aadae7007c7a51dfae19 (diff)
Make clientAuth header optional and log request
Change-Id: Ifc44740a71c2b60d5474cd665bbfca94dcc0c9a7 Issue-ID: POLICY-1418 Signed-off-by: pa834y <pa834y@att.com>
Diffstat (limited to 'PolicyEngineAPI')
-rw-r--r--PolicyEngineAPI/src/main/java/org/onap/policy/api/ConfigNameRequest.java5
-rw-r--r--PolicyEngineAPI/src/main/java/org/onap/policy/api/ConfigRequestParameters.java285
-rw-r--r--PolicyEngineAPI/src/main/java/org/onap/policy/api/DecisionRequestParameters.java205
-rw-r--r--PolicyEngineAPI/src/main/java/org/onap/policy/api/DeletePolicyParameters.java23
-rw-r--r--PolicyEngineAPI/src/main/java/org/onap/policy/api/DictionaryParameters.java134
-rw-r--r--PolicyEngineAPI/src/main/java/org/onap/policy/api/PushPolicyParameters.java224
6 files changed, 473 insertions, 403 deletions
diff --git a/PolicyEngineAPI/src/main/java/org/onap/policy/api/ConfigNameRequest.java b/PolicyEngineAPI/src/main/java/org/onap/policy/api/ConfigNameRequest.java
index 1a64757ca..c5c10b07d 100644
--- a/PolicyEngineAPI/src/main/java/org/onap/policy/api/ConfigNameRequest.java
+++ b/PolicyEngineAPI/src/main/java/org/onap/policy/api/ConfigNameRequest.java
@@ -25,6 +25,7 @@ import java.io.Serializable;
public class ConfigNameRequest implements Serializable {
private static final long serialVersionUID = 4487978240532425305L;
+ private static final Gson GSON = new Gson();
private String policyName = null;
@@ -37,12 +38,12 @@ public class ConfigNameRequest implements Serializable {
}
/**
- * Used to print the input Params for getCOnfig REST call.
+ * Used to print the input Params for getConfig REST call.
*
* @return JSON String of this object.
*/
@Override
public String toString() {
- return new Gson().toJson(this);
+ return GSON.toJson(this);
}
}
diff --git a/PolicyEngineAPI/src/main/java/org/onap/policy/api/ConfigRequestParameters.java b/PolicyEngineAPI/src/main/java/org/onap/policy/api/ConfigRequestParameters.java
index dcdc17802..35169a39e 100644
--- a/PolicyEngineAPI/src/main/java/org/onap/policy/api/ConfigRequestParameters.java
+++ b/PolicyEngineAPI/src/main/java/org/onap/policy/api/ConfigRequestParameters.java
@@ -2,14 +2,14 @@
* ============LICENSE_START=======================================================
* PolicyEngineAPI
* ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017,2019 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -20,151 +20,166 @@
package org.onap.policy.api;
+import com.google.gson.Gson;
import java.util.Map;
import java.util.UUID;
/**
- * <code>ConfigRequestParameters</code> defines the Config Policy Request Parameters
- * which retrieve(s) the policy from PDP if the request parameters match with any Config Policy.
- *
+ * <code>ConfigRequestParameters</code> defines the Config Policy Request Parameters which retrieve(s) the policy from
+ * PDP if the request parameters match with any Config Policy.
+ *
* @version 0.1
*/
public class ConfigRequestParameters {
- private String policyName;
- private String onapName;
- private String configName;
- private Map<String,String> configAttributes;
- private UUID requestID;
- private Boolean unique = false;
-
- /**
- * Sets the PolicyName of the Config policy which needs to be retrieved.
- *
- * @param policyName the <code>String</code> format of the PolicyFile Name whose configuration is required.
- */
- public void setPolicyName(String policyName){
- this.policyName = policyName;
- }
-
- /**
- * Sets the ONAP Component Name of the Config policy which needs to be retrieved.
- *
- * @param onapName the <code>String</code> format of the onapName whose configuration is required.
- */
- public void setOnapName(String onapName){
- this.onapName = onapName;
- }
-
- /**
- * Sets the ONAP Component Name of the Config policy which needs to be retrieved.
- *
+ private static final Gson GSON = new Gson();
+ private String policyName;
+ private String onapName;
+ private String configName;
+ private Map<String, String> configAttributes;
+ private UUID requestID;
+ private Boolean unique = false;
+
+ /**
+ * Sets the PolicyName of the Config policy which needs to be retrieved.
+ *
+ * @param policyName the <code>String</code> format of the PolicyFile Name whose configuration is required.
+ */
+ public void setPolicyName(String policyName) {
+ this.policyName = policyName;
+ }
+
+ /**
+ * Sets the ONAP Component Name of the Config policy which needs to be retrieved.
+ *
+ * @param onapName the <code>String</code> format of the onapName whose configuration is required.
+ */
+ public void setOnapName(String onapName) {
+ this.onapName = onapName;
+ }
+
+ /**
+ * Sets the ONAP Component Name of the Config policy which needs to be retrieved.
+ *
* @param ecompName the <code>String</code> format of the onapName whose configuration is required.
- * @deprecated use {@link #setOnapName(String)} instead.
+ * @deprecated use {@link #setOnapName(String)} instead.
*/
- @Deprecated
- public void setEcompName(String ecompName){
+ @Deprecated
+ public void setEcompName(String ecompName) {
this.onapName = ecompName;
}
-
- /**
- * Sets the Config Name of the Config policy which needs to be retrieved.
- *
- * @param configName the <code>String</code> format of the configurationName whose configuration is required.
- */
- public void setConfigName(String configName){
- this.configName = configName;
- }
-
- /**
- * Sets the ConfigAttributes of the Config policy which needs to be retrieved.
- *
- * @param configAttributes the <code>Map</code> of <code>String,String</code> format of the configuration attributes which are required.
- */
- public void setConfigAttributes(Map<String, String> configAttributes){
- this.configAttributes = configAttributes;
- }
-
- /**
- * Sets the Request ID of the ONAP request.
- *
- * @param requestID unique <code>UUID</code> requestID which will be passed throughout the ONAP components to correlate logging messages.
- */
- public void setRequestID(UUID requestID){
- this.requestID = requestID;
- }
-
- /**
- * Gets the policyName of the Request Parameters.
- *
- * @return <code>String</code> format of the policyName.
- */
- public String getPolicyName(){
- return policyName;
- }
-
- /**
- * Gets the ONAP Component Name of the Request Parameters.
- *
- * @return <code>String</code> format of the ONAP Component Name.
- */
- public String getOnapName(){
- return onapName;
- }
-
- /**
- * Gets the ONAP Component Name of the Request Parameters.
- *
- * @return <code>String</code> format of the ONAP Component Name.
- * @deprecated use {@link #getOnapName()} instead.
+
+ /**
+ * Sets the Config Name of the Config policy which needs to be retrieved.
+ *
+ * @param configName the <code>String</code> format of the configurationName whose configuration is required.
+ */
+ public void setConfigName(String configName) {
+ this.configName = configName;
+ }
+
+ /**
+ * Sets the ConfigAttributes of the Config policy which needs to be retrieved.
+ *
+ * @param configAttributes the <code>Map</code> of <code>String,String</code> format of the configuration attributes
+ * which are required.
+ */
+ public void setConfigAttributes(Map<String, String> configAttributes) {
+ this.configAttributes = configAttributes;
+ }
+
+ /**
+ * Sets the Request ID of the ONAP request.
+ *
+ * @param requestID unique <code>UUID</code> requestID which will be passed throughout the ONAP components to
+ * correlate logging messages.
+ */
+ public void setRequestID(UUID requestID) {
+ this.requestID = requestID;
+ }
+
+ /**
+ * Gets the policyName of the Request Parameters.
+ *
+ * @return <code>String</code> format of the policyName.
*/
- @Deprecated
- public String getEcompName(){
+ public String getPolicyName() {
+ return policyName;
+ }
+
+ /**
+ * Gets the ONAP Component Name of the Request Parameters.
+ *
+ * @return <code>String</code> format of the ONAP Component Name.
+ */
+ public String getOnapName() {
return onapName;
}
-
- /**
- * Gets the Config name of the Request Parameters.
- *
- * @return <code>String</code> format of the Config Name.
- */
- public String getConfigName(){
- return configName;
- }
-
- /**
- * Gets the Config Attributes of the Request Parameters.
- *
- * @return <code>Map</code> of <code>String</code>,<code>String</code> format of the config Attributes.
- */
- public Map<String,String> getConfigAttributes(){
- return configAttributes;
- }
-
- /**
- * Gets the Request ID of the Request Paramters.
- *
- * @return <code>UUID</code> format of requestID.
- */
- public UUID getRequestID(){
- return requestID;
- }
-
- /**
- * Makes the results Unique, priority based. If set to True. Default Value is set to False.
- *
- * @param unique flag which is either true or false.
- */
- public void makeUnique(Boolean unique){
- this.unique = unique;
- }
-
- /**
- * Gets the Unique flag value from the Config Request Parameters.
- *
- * @return unique flag which is either true or false.
- */
- public Boolean getUnique(){
- return this.unique;
- }
+
+ /**
+ * Gets the ONAP Component Name of the Request Parameters.
+ *
+ * @return <code>String</code> format of the ONAP Component Name.
+ * @deprecated use {@link #getOnapName()} instead.
+ */
+ @Deprecated
+ public String getEcompName() {
+ return onapName;
+ }
+
+ /**
+ * Gets the Config name of the Request Parameters.
+ *
+ * @return <code>String</code> format of the Config Name.
+ */
+ public String getConfigName() {
+ return configName;
+ }
+
+ /**
+ * Gets the Config Attributes of the Request Parameters.
+ *
+ * @return <code>Map</code> of <code>String</code>,<code>String</code> format of the config Attributes.
+ */
+ public Map<String, String> getConfigAttributes() {
+ return configAttributes;
+ }
+
+ /**
+ * Gets the Request ID of the Request Paramters.
+ *
+ * @return <code>UUID</code> format of requestID.
+ */
+ public UUID getRequestID() {
+ return requestID;
+ }
+
+ /**
+ * Makes the results Unique, priority based. If set to True. Default Value is set to False.
+ *
+ * @param unique flag which is either true or false.
+ */
+ public void makeUnique(Boolean unique) {
+ this.unique = unique;
+ }
+
+ /**
+ * Gets the Unique flag value from the Config Request Parameters.
+ *
+ * @return unique flag which is either true or false.
+ */
+ public Boolean getUnique() {
+ return this.unique;
+ }
+
+ /**
+ * Used to print the input Params for getCOnfig REST call.
+ *
+ * @return JSON String of this object.
+ */
+ @Override
+ public String toString() {
+ return GSON.toJson(this);
+ }
+
}
diff --git a/PolicyEngineAPI/src/main/java/org/onap/policy/api/DecisionRequestParameters.java b/PolicyEngineAPI/src/main/java/org/onap/policy/api/DecisionRequestParameters.java
index 2163bf555..a95063ed9 100644
--- a/PolicyEngineAPI/src/main/java/org/onap/policy/api/DecisionRequestParameters.java
+++ b/PolicyEngineAPI/src/main/java/org/onap/policy/api/DecisionRequestParameters.java
@@ -2,14 +2,14 @@
* ============LICENSE_START=======================================================
* PolicyEngineAPI
* ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -20,110 +20,131 @@
package org.onap.policy.api;
+import com.google.gson.Gson;
import java.util.Map;
import java.util.UUID;
/**
- * <code>DecisionRequestParameters</code> defines the Decision Policy Request Parameters
- * which retrieve(s) the response from PDP if the request parameters match with any Decision Policy.
- *
+ * <code>DecisionRequestParameters</code> defines the Decision Policy Request Parameters which retrieve(s) the response
+ * from PDP if the request parameters match with any Decision Policy.
+ *
* @version 0.1
*/
public class DecisionRequestParameters {
- private String onapName;
- private Map<String,String> decisionAttributes;
- private UUID requestID;
-
- /**
- * Constructor with no Parameters
- */
- public DecisionRequestParameters(){
- // Empty constructor
- }
-
- /**
- * Constructor with Parameters
- *
- * @param onapName the <code>String</code> format of the onapName whose Decision is required.
- * @param decisionAttributes the <code>Map</code> of <code>String,String</code> format of the decisionAttributes that contain the ID and values.
- * @param requestID unique request ID which will be passed throughout the ONAP components to correlate logging messages.
- */
- public DecisionRequestParameters(String onapName, Map<String,String> decisionAttributes, UUID requestID){
- this.onapName = onapName;
- this.decisionAttributes = decisionAttributes;
- this.requestID = requestID;
- }
-
- /**
- * Gets the onapName of the Decision Request Parameters.
- *
- * @return onapName the <code>String</code> format of the onapName of the Decision Request Parameters.
- */
- public String getOnapName() {
- return onapName;
- }
-
- /**
- * Gets the onapName of the Decision Request Parameters.
- *
+ private static final Gson GSON = new Gson();
+ private String onapName;
+ private Map<String, String> decisionAttributes;
+ private UUID requestID;
+
+ /**
+ * Constructor with no Parameters
+ */
+ public DecisionRequestParameters() {
+ // Empty constructor
+ }
+
+ /**
+ * Constructor with Parameters
+ *
+ * @param onapName the <code>String</code> format of the onapName whose Decision is required.
+ * @param decisionAttributes the <code>Map</code> of <code>String,String</code> format of the decisionAttributes
+ * that contain the ID and values.
+ * @param requestID unique request ID which will be passed throughout the ONAP components to correlate logging
+ * messages.
+ */
+ public DecisionRequestParameters(String onapName, Map<String, String> decisionAttributes, UUID requestID) {
+ this.onapName = onapName;
+ this.decisionAttributes = decisionAttributes;
+ this.requestID = requestID;
+ }
+
+ /**
+ * Gets the onapName of the Decision Request Parameters.
+ *
+ * @return onapName the <code>String</code> format of the onapName of the Decision Request Parameters.
+ */
+ public String getOnapName() {
+ return onapName;
+ }
+
+ /**
+ * Gets the onapName of the Decision Request Parameters.
+ *
* @return onapName the <code>String</code> format of the onapName of the Decision Request Parameters.
- * @deprecated use {@link #getOnapName()} instead.
+ * @deprecated use {@link #getOnapName()} instead.
*/
- @Deprecated
+ @Deprecated
public String getECOMPComponentName() {
return onapName;
}
-
- /**
- * Sets the onapName of the Decision Request parameters.
- *
- * @param onapName the <code>String</code> format of the onapName whose Decision is required.
- */
- public void setOnapName(String onapName) {
- this.onapName = onapName;
- }
-
- /**
- * Sets the ecompComponentName of the Decision Request parameters.
- *
+
+ /**
+ * Sets the onapName of the Decision Request parameters.
+ *
+ * @param onapName the <code>String</code> format of the onapName whose Decision is required.
+ */
+ public void setOnapName(String onapName) {
+ this.onapName = onapName;
+ }
+
+ /**
+ * Sets the ecompComponentName of the Decision Request parameters.
+ *
* @param ecompName the <code>String</code> format of the onapName whose Decision is required.
- * @deprecated use {@link #setOnapName(String)} instead.
+ * @deprecated use {@link #setOnapName(String)} instead.
*/
- @Deprecated
+ @Deprecated
public void setECOMPComponentName(String ecompName) {
this.onapName = ecompName;
}
-
- /**
- * Gets the Decision Attributes from Decision Request Parameters.
- *
- * @return decisionAttributes the <code>Map</code> of <code>String,String</code> format of the decisionAttributes that contain the ID and values.
- */
- public Map<String,String> getDecisionAttributes() {
- return decisionAttributes;
- }
- /**
- * Sets the Decision Attributes which contain ID and values for obtaining Decision from PDP.
- *
- * @param decisionAttributes the <code>Map</code> of <code>String,String</code> format of the decisionAttributes that must contain the ID and values.
- */
- public void setDecisionAttributes(Map<String,String> decisionAttributes) {
- this.decisionAttributes = decisionAttributes;
- }
- /**
- * Gets the request ID of Decision Request Parameters.
- *
- * @return the requestID unique request ID which will be passed throughout the ONAP components to correlate logging messages.
- */
- public UUID getRequestID() {
- return requestID;
- }
- /**
- * Sets the ReqestID of Decision Request Parameters which will be passed around ONAP requests.
- *
- * @param requestID unique request ID which will be passed throughout the ONAP components to correlate logging messages.
- */
- public void setRequestID(UUID requestID) {
- this.requestID = requestID;
- }
+
+ /**
+ * Gets the Decision Attributes from Decision Request Parameters.
+ *
+ * @return decisionAttributes the <code>Map</code> of <code>String,String</code> format of the decisionAttributes
+ * that contain the ID and values.
+ */
+ public Map<String, String> getDecisionAttributes() {
+ return decisionAttributes;
+ }
+
+ /**
+ * Sets the Decision Attributes which contain ID and values for obtaining Decision from PDP.
+ *
+ * @param decisionAttributes the <code>Map</code> of <code>String,String</code> format of the decisionAttributes
+ * that must contain the ID and values.
+ */
+ public void setDecisionAttributes(Map<String, String> decisionAttributes) {
+ this.decisionAttributes = decisionAttributes;
+ }
+
+ /**
+ * Gets the request ID of Decision Request Parameters.
+ *
+ * @return the requestID unique request ID which will be passed throughout the ONAP components to correlate logging
+ * messages.
+ */
+ public UUID getRequestID() {
+ return requestID;
+ }
+
+ /**
+ * Sets the ReqestID of Decision Request Parameters which will be passed around ONAP requests.
+ *
+ * @param requestID unique request ID which will be passed throughout the ONAP components to correlate logging
+ * messages.
+ */
+ public void setRequestID(UUID requestID) {
+ this.requestID = requestID;
+ }
+
+ /**
+ * Used to print the input Params for getDecision REST call.
+ *
+ * @return JSON String of this object.
+ */
+ @Override
+ public String toString() {
+ return GSON.toJson(this);
+ }
}
diff --git a/PolicyEngineAPI/src/main/java/org/onap/policy/api/DeletePolicyParameters.java b/PolicyEngineAPI/src/main/java/org/onap/policy/api/DeletePolicyParameters.java
index af2aed79c..8c56f5714 100644
--- a/PolicyEngineAPI/src/main/java/org/onap/policy/api/DeletePolicyParameters.java
+++ b/PolicyEngineAPI/src/main/java/org/onap/policy/api/DeletePolicyParameters.java
@@ -2,14 +2,14 @@
* ============LICENSE_START=======================================================
* PolicyEngineAPI
* ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017,2019 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -20,16 +20,16 @@
package org.onap.policy.api;
+import com.google.gson.Gson;
import java.util.UUID;
/**
- * <code>PushPolicyParameters</code> defines the Policy Parameters which are required to Push a
- * Policy to PDPGroup.
- *
+ * <code>PushPolicyParameters</code> defines the Policy Parameters which are required to Push a Policy to PDPGroup.
+ *
* @version 0.1
*/
public class DeletePolicyParameters {
-
+ private static final Gson GSON = new Gson();
private String policyName;
private String policyType;
private String policyComponent;
@@ -121,10 +121,13 @@ public class DeletePolicyParameters {
this.pdpGroup = pdpGroup;
}
+ /**
+ * Used to print the input Params for REST call.
+ *
+ * @return JSON String of this object.
+ */
@Override
public String toString() {
- return "DeletePolicyParameters [policyName=" + policyName + ", policyType=" + policyType + ", policyComponent="
- + policyComponent + ", deleteCondition=" + deleteCondition + ", pdpGroup=" + pdpGroup + ", requestID="
- + requestID + "]";
+ return GSON.toJson(this);
}
}
diff --git a/PolicyEngineAPI/src/main/java/org/onap/policy/api/DictionaryParameters.java b/PolicyEngineAPI/src/main/java/org/onap/policy/api/DictionaryParameters.java
index e4aa5e1a5..23855ee84 100644
--- a/PolicyEngineAPI/src/main/java/org/onap/policy/api/DictionaryParameters.java
+++ b/PolicyEngineAPI/src/main/java/org/onap/policy/api/DictionaryParameters.java
@@ -2,14 +2,14 @@
* ============LICENSE_START=======================================================
* PolicyEngineAPI
* ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017,2019 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -20,63 +20,81 @@
package org.onap.policy.api;
+import com.google.gson.Gson;
import java.util.UUID;
public class DictionaryParameters {
-
- private DictionaryType dictionaryType;
- private String dictionary;
- private String dictionaryJson;
- private UUID requestID;
-
-
- /**
- * @return the dictionaryType
- */
- public DictionaryType getDictionaryType() {
- return dictionaryType;
- }
- /**
- * @param dictionaryType the dictionaryType to set
- */
- public void setDictionaryType(DictionaryType dictionaryType) {
- this.dictionaryType = dictionaryType;
- }
- /**
- * @return the dictionary
- */
- public String getDictionary() {
- return dictionary;
- }
- /**
- * @param dictionary the dictionary to set
- */
- public void setDictionary(String dictionary) {
- this.dictionary = dictionary;
- }
- /**
- * @return the dictionaryFields
- */
- public String getDictionaryJson() {
- return dictionaryJson;
- }
- /**
- * @param dictionaryFields the dictionaryFields to set
- */
- public void setDictionaryJson(String dictionaryJson) {
- this.dictionaryJson = dictionaryJson;
- }
- /**
- * @return the requestID
- */
- public UUID getRequestID() {
- return requestID;
- }
- /**
- * @param requestID the requestID to set
- */
- public void setRequestID(UUID requestID) {
- this.requestID = requestID;
- }
+ private static final Gson GSON = new Gson();
+ private DictionaryType dictionaryType;
+ private String dictionary;
+ private String dictionaryJson;
+ private UUID requestID;
+
+
+ /**
+ * @return the dictionaryType
+ */
+ public DictionaryType getDictionaryType() {
+ return dictionaryType;
+ }
+
+ /**
+ * @param dictionaryType the dictionaryType to set
+ */
+ public void setDictionaryType(DictionaryType dictionaryType) {
+ this.dictionaryType = dictionaryType;
+ }
+
+ /**
+ * @return the dictionary
+ */
+ public String getDictionary() {
+ return dictionary;
+ }
+
+ /**
+ * @param dictionary the dictionary to set
+ */
+ public void setDictionary(String dictionary) {
+ this.dictionary = dictionary;
+ }
+
+ /**
+ * @return the dictionaryFields
+ */
+ public String getDictionaryJson() {
+ return dictionaryJson;
+ }
+
+ /**
+ * @param dictionaryFields the dictionaryFields to set
+ */
+ public void setDictionaryJson(String dictionaryJson) {
+ this.dictionaryJson = dictionaryJson;
+ }
+
+ /**
+ * @return the requestID
+ */
+ public UUID getRequestID() {
+ return requestID;
+ }
+
+ /**
+ * @param requestID the requestID to set
+ */
+ public void setRequestID(UUID requestID) {
+ this.requestID = requestID;
+ }
+
+ /**
+ * Used to print the input Params for REST call.
+ *
+ * @return JSON String of this object.
+ */
+ @Override
+ public String toString() {
+ return GSON.toJson(this);
+ }
}
diff --git a/PolicyEngineAPI/src/main/java/org/onap/policy/api/PushPolicyParameters.java b/PolicyEngineAPI/src/main/java/org/onap/policy/api/PushPolicyParameters.java
index a55cd6ed3..27f9c4058 100644
--- a/PolicyEngineAPI/src/main/java/org/onap/policy/api/PushPolicyParameters.java
+++ b/PolicyEngineAPI/src/main/java/org/onap/policy/api/PushPolicyParameters.java
@@ -2,14 +2,14 @@
* ============LICENSE_START=======================================================
* PolicyEngineAPI
* ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017,2019 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -20,113 +20,125 @@
package org.onap.policy.api;
+import com.google.gson.Gson;
import java.util.UUID;
/**
- * <code>PushPolicyParameters</code> defines the Policy Parameters
- * which are required to Push a Policy to PDPGroup.
- *
+ * <code>PushPolicyParameters</code> defines the Policy Parameters which are required to Push a Policy to PDPGroup.
+ *
* @version 0.1
*/
public class PushPolicyParameters {
- private String policyName;
- private String policyType;
- private String pdpGroup;
- private UUID requestID;
-
- /**
- * Constructor with no Parameters.
- */
- public PushPolicyParameters(){
- // Empty constructor
- }
-
- /**
- * Constructor with Parameters.
- *
- * @param policyName the <code>String</code> format of the Policy Name
- * @param policyType the <code>String</code> format of the Policy Type
- * @param pdpGroup the <code>String</code> format of the PDPGroup
- * @param requestID unique request ID which will be passed throughout the ONAP components to correlate logging messages.
- */
- public PushPolicyParameters(String policyName, String policyType, String pdpGroup, UUID requestID){
- this.policyName = policyName;
- this.policyType = policyType;
- this.pdpGroup = pdpGroup;
- this.requestID = requestID;
- }
-
- /**
- * Gets the PolicyName of the Push Policy Parameters.
- *
- * @return policyName the <code>String</code> format of the Policy Name
- */
- public String getPolicyName() {
- return policyName;
- }
-
- /**
- * Sets the policyName of the Push Policy Parameters.
- *
- * @param policyName the <code>String</code> format of the Policy Name
- */
- public void setPolicyName(String policyName) {
- this.policyName = policyName;
- }
-
- /**
- * Gets the PolicyType of the Push Policy Parameters.
- *
- * @return policyType the <code>String</code> format of the Policy Type
- */
- public String getPolicyType() {
- return policyType;
- }
-
- /**
- * Sets the policyType of the Push Policy Parameters.
- *
- * @param policyType the <code>String</code> format of the Policy Type
- */
- public void setPolicyType(String policyType) {
- this.policyType = policyType;
- }
-
- /**
- * Gets the PDPGroup of the Push Policy Parameters.
- *
- * @return pdpGroup the <code>String</code> format of the PDPGroup
- */
- public String getPdpGroup() {
- return pdpGroup;
- }
-
- /**
- * Sets the PDPGroup of the Push Policy Parameters.
- *
- * @param pdpGroup the <code>String</code> format of the PDPGroup
- */
- public void setPdpGroup(String pdpGroup) {
- this.pdpGroup = pdpGroup;
- }
-
- /**
- * Gets the requestID of the Push Policy Parameters.
- *
- * @return unique request ID which will be passed throughout the ONAP components to correlate logging messages.
- */
- public UUID getRequestID() {
- return requestID;
- }
-
- /**
- * Sets the requestID of the Push Policy Parameters.
- *
- * @param requestID unique request ID which will be passed throughout the ONAP components to correlate logging messages.
- */
- public void setRequestID(UUID requestID) {
- this.requestID = requestID;
- }
-
-
+ private static final Gson GSON = new Gson();
+ private String policyName;
+ private String policyType;
+ private String pdpGroup;
+ private UUID requestID;
+
+ /**
+ * Constructor with no Parameters.
+ */
+ public PushPolicyParameters() {
+ // Empty constructor
+ }
+
+ /**
+ * Constructor with Parameters.
+ *
+ * @param policyName the <code>String</code> format of the Policy Name
+ * @param policyType the <code>String</code> format of the Policy Type
+ * @param pdpGroup the <code>String</code> format of the PDPGroup
+ * @param requestID unique request ID which will be passed throughout the ONAP components to correlate logging
+ * messages.
+ */
+ public PushPolicyParameters(String policyName, String policyType, String pdpGroup, UUID requestID) {
+ this.policyName = policyName;
+ this.policyType = policyType;
+ this.pdpGroup = pdpGroup;
+ this.requestID = requestID;
+ }
+
+ /**
+ * Gets the PolicyName of the Push Policy Parameters.
+ *
+ * @return policyName the <code>String</code> format of the Policy Name
+ */
+ public String getPolicyName() {
+ return policyName;
+ }
+
+ /**
+ * Sets the policyName of the Push Policy Parameters.
+ *
+ * @param policyName the <code>String</code> format of the Policy Name
+ */
+ public void setPolicyName(String policyName) {
+ this.policyName = policyName;
+ }
+
+ /**
+ * Gets the PolicyType of the Push Policy Parameters.
+ *
+ * @return policyType the <code>String</code> format of the Policy Type
+ */
+ public String getPolicyType() {
+ return policyType;
+ }
+
+ /**
+ * Sets the policyType of the Push Policy Parameters.
+ *
+ * @param policyType the <code>String</code> format of the Policy Type
+ */
+ public void setPolicyType(String policyType) {
+ this.policyType = policyType;
+ }
+
+ /**
+ * Gets the PDPGroup of the Push Policy Parameters.
+ *
+ * @return pdpGroup the <code>String</code> format of the PDPGroup
+ */
+ public String getPdpGroup() {
+ return pdpGroup;
+ }
+
+ /**
+ * Sets the PDPGroup of the Push Policy Parameters.
+ *
+ * @param pdpGroup the <code>String</code> format of the PDPGroup
+ */
+ public void setPdpGroup(String pdpGroup) {
+ this.pdpGroup = pdpGroup;
+ }
+
+ /**
+ * Gets the requestID of the Push Policy Parameters.
+ *
+ * @return unique request ID which will be passed throughout the ONAP components to correlate logging messages.
+ */
+ public UUID getRequestID() {
+ return requestID;
+ }
+
+ /**
+ * Sets the requestID of the Push Policy Parameters.
+ *
+ * @param requestID unique request ID which will be passed throughout the ONAP components to correlate logging
+ * messages.
+ */
+ public void setRequestID(UUID requestID) {
+ this.requestID = requestID;
+ }
+
+ /**
+ * Used to print the input Params for PushPolicy REST call.
+ *
+ * @return JSON String of this object.
+ */
+ @Override
+ public String toString() {
+ return GSON.toJson(this);
+ }
+
}