diff options
author | Michael Mokry <mm117s@att.com> | 2017-09-26 08:49:34 -0500 |
---|---|---|
committer | Michael Mokry <mm117s@att.com> | 2017-09-26 09:40:47 -0500 |
commit | d86da782fa13652ab4fa7227394d4a3d1fe55e18 (patch) | |
tree | 409466e9afd7685fcfa5e7b6810383c2fbb83b95 /ONAP-XACML/src/main | |
parent | 04c6945fea6a17b89affe2e1a1304e03005136b7 (diff) |
Policy API support for Rainy Day Decision Policy
Enhances the Rainy Day Decision Policy by providing API support to
manage Rainy Day Decision policies and dictionaries
Change-Id: Ia7c49199ac057fa8bcc9de74f5e0b8dba395d43a
Issue-ID: POLICY-269
Signed-off-by: Michael Mokry <mm117s@att.com>
Diffstat (limited to 'ONAP-XACML/src/main')
-rw-r--r-- | ONAP-XACML/src/main/java/org/onap/policy/xacml/api/pap/OnapPAPPolicy.java | 2 | ||||
-rw-r--r-- | ONAP-XACML/src/main/java/org/onap/policy/xacml/std/pap/StdPAPPolicy.java | 22 |
2 files changed, 18 insertions, 6 deletions
diff --git a/ONAP-XACML/src/main/java/org/onap/policy/xacml/api/pap/OnapPAPPolicy.java b/ONAP-XACML/src/main/java/org/onap/policy/xacml/api/pap/OnapPAPPolicy.java index 78ce354e0..4539b4225 100644 --- a/ONAP-XACML/src/main/java/org/onap/policy/xacml/api/pap/OnapPAPPolicy.java +++ b/ONAP-XACML/src/main/java/org/onap/policy/xacml/api/pap/OnapPAPPolicy.java @@ -46,6 +46,7 @@ public interface OnapPAPPolicy { public String getOnapName(); public String getConfigName(); public Map<String, String> getDynamicFieldConfigAttributes(); + public Map<String, String> getTreatments(); public Map<String, String> getDynamicSettingsMap(); public List<String> getDynamicRuleAlgorithmLabels(); public List<String> getDynamicRuleAlgorithmCombo(); @@ -81,7 +82,6 @@ public interface OnapPAPPolicy { public String getDictionaryType(); public String getDictionary(); public String getDictionaryFields(); - public String getRiskLevel(); public String getGuard(); public String getRiskType(); diff --git a/ONAP-XACML/src/main/java/org/onap/policy/xacml/std/pap/StdPAPPolicy.java b/ONAP-XACML/src/main/java/org/onap/policy/xacml/std/pap/StdPAPPolicy.java index 56676f38b..034c08bfa 100644 --- a/ONAP-XACML/src/main/java/org/onap/policy/xacml/std/pap/StdPAPPolicy.java +++ b/ONAP-XACML/src/main/java/org/onap/policy/xacml/std/pap/StdPAPPolicy.java @@ -36,6 +36,7 @@ public class StdPAPPolicy implements OnapPAPPolicy, Serializable{ private String onapName = null; private String configName = null; private Map<String, String> dyanamicFieldConfigAttributes = new HashMap<>(); + private Map<String, String> treatments = new HashMap<>(); private Map<String, String> dropDownMap = new HashMap<>(); private Map<String, String> dynamicSettingsMap = new HashMap<>(); private List<String> dynamicRuleAlgorithmLabels; @@ -125,8 +126,9 @@ public class StdPAPPolicy implements OnapPAPPolicy, Serializable{ } - //Constructor for Create/Update Decision Policies from Admin Console - public StdPAPPolicy(String policyName, String description, String onapName, String providerComboBox, Map<String, String> attributes, Map<String, String> settings, + //Constructor for Create/Update Decision Policies + public StdPAPPolicy(String policyName, String description, String onapName, String providerComboBox, + Map<String, String> attributes, Map<String, String> settings, Map<String, String> treatments, List<String> dynamicRuleAlgorithmLabels, List<String> dynamicRuleAlgorithmCombo, List<String> dynamicRuleAlgorithmField1, List<String> dynamicRuleAlgorithmField2, Map<String, String> dropDownMap, List<Object> dynamicVariableList, List<String> dataTypeList, Boolean editPolicy, String domain, int highestVersion) { @@ -147,10 +149,10 @@ public class StdPAPPolicy implements OnapPAPPolicy, Serializable{ this.editPolicy = editPolicy; this.domain = domain; this.highestVersion = highestVersion; + this.treatments = treatments; } - //Constructor for Create Config Policies from API and Admin Console //Constructor for Updating Config Policies from the API public StdPAPPolicy(String configPolicyType, String policyName, String description, String onapName, String configName, Map<String, String> attributes, String configType, @@ -675,6 +677,11 @@ public class StdPAPPolicy implements OnapPAPPolicy, Serializable{ } @Override + public Map<String, String> getTreatments() { + return treatments; + } + + @Override public String toString() { return "StdPAPPolicy [policyName=" + policyName + ", policyDescription=" + policyDescription + ", onapName=" + onapName + ", configName=" + configName + ", dyanamicFieldConfigAttributes=" + dyanamicFieldConfigAttributes + ", configBodyData=" + configBodyData @@ -688,9 +695,10 @@ public class StdPAPPolicy implements OnapPAPPolicy, Serializable{ + ",dataTypeList=" + dataTypeList + ",draft=" + ",oldPolicyFileName=" + oldPolicyFileName + ",serviceType=" + serviceType + ",uuid=" + uuid + ",msLocation=" + msLocation + ",priority=" + priority + ",deleteCondition=" + deleteCondition + ",dictionaryType=" + dictionaryType + ",dictionary=" + dictionary + ",dictionaryFields=" + dictionaryFields + ",uuid=" + uuid + ",msLocation=" + msLocation + ",priority=" - + priority + ",deleteCondition=" + deleteCondition + ",riskType="+riskType + ",riskLevel="+riskLevel + ",guard="+ guard + ",ttlDate="+ ttlDate + "]"; + + priority + ",deleteCondition=" + deleteCondition + ",riskType="+riskType + ",riskLevel="+riskLevel + ",guard="+ guard + ",ttlDate="+ ttlDate + + ",treatments=" + treatments + "]"; } - + // Methods needed for JSON Deserialization public void setPolicyName(String policyName) { this.policyName = policyName; @@ -907,4 +915,8 @@ public class StdPAPPolicy implements OnapPAPPolicy, Serializable{ public void setBrmsDependency(ArrayList<String> brmsDependency) { this.brmsDependency = brmsDependency; } + + public void setTreatments(Map<String, String> treatments) { + this.treatments = treatments; + } }
\ No newline at end of file |