diff options
author | Michael Mokry <mm117s@att.com> | 2018-09-10 15:23:15 -0500 |
---|---|---|
committer | Michael Mokry <mm117s@att.com> | 2018-09-11 10:31:26 -0500 |
commit | e957a1d9a9fa6bd0f9f8348d1e864c09cfe2cb92 (patch) | |
tree | a09024bc2c7e6a3b69affd95de9352c7d4d5c468 /POLICY-SDK-APP/src/main/java | |
parent | 1134bd40da28d3833a0dd4f821e75ec938f6061f (diff) |
New min/max Guard Policy
Made changes to support Guard policy create/update and other policy manager
functions including deletePolicy and pushPolicy.
Includes changes for new Guard policy support using GUI and API (Rest and Java Client)
Made changes to address Jim's comments
Made changes to address Liam's comments
Change-Id: I133fe1fd9287ea77ea41a2788de90c7642c36b6a
Issue-ID: POLICY-1038
Signed-off-by: Mike Mokry <mm117s@att.com>
Diffstat (limited to 'POLICY-SDK-APP/src/main/java')
-rw-r--r-- | POLICY-SDK-APP/src/main/java/org/onap/policy/controller/DecisionPolicyController.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/DecisionPolicyController.java b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/DecisionPolicyController.java index 69c3d2fcb..4e8c8c141 100644 --- a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/DecisionPolicyController.java +++ b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/DecisionPolicyController.java @@ -69,6 +69,7 @@ public class DecisionPolicyController extends RestrictedBaseController { private static final String DECISIONRAWTYPE = "@#RuleProvider@#Decision_Raw@#RuleProvider@#"; private static final String GUARD_YAML= "GUARD_YAML"; private static final String GUARD_BL_YAML= "GUARD_BL_YAML"; + private static final String GUARD_MIN_MAX= "GUARD_MIN_MAX"; protected PolicyRestAdapter policyAdapter = null; private ArrayList<Object> ruleAlgorithmList; @@ -233,6 +234,9 @@ public class DecisionPolicyController extends RestrictedBaseController { } else if (GUARD_BL_YAML.equalsIgnoreCase(((RuleType) object).getAdviceExpressions() .getAdviceExpression().get(0).getAdviceId())) { policyAdapter.setRuleProvider(GUARD_BL_YAML); + } else if (GUARD_MIN_MAX.equalsIgnoreCase(((RuleType) object).getAdviceExpressions() + .getAdviceExpression().get(0).getAdviceId())) { + policyAdapter.setRuleProvider(GUARD_MIN_MAX); } } else { policyAdapter.setRuleProvider("Custom"); @@ -244,7 +248,8 @@ public class DecisionPolicyController extends RestrictedBaseController { ruleAlgoirthmTracker = new LinkedList<>(); if (policyAdapter.getRuleProvider() != null && (GUARD_YAML.equals(policyAdapter.getRuleProvider()) - || (GUARD_BL_YAML.equals(policyAdapter.getRuleProvider())))) { + || (GUARD_BL_YAML.equals(policyAdapter.getRuleProvider())) + || (GUARD_MIN_MAX.equals(policyAdapter.getRuleProvider())))){ YAMLParams yamlParams = new YAMLParams(); for (int i = 0; i < attributeList.size(); i++) { Map<String, String> map = (Map<String, String>) attributeList.get(i); @@ -256,6 +261,10 @@ public class DecisionPolicyController extends RestrictedBaseController { yamlParams.setTargets(Arrays.asList(map.get("value").split("\\|"))); } else if ("clname".equals(map.get("key"))) { yamlParams.setClname(map.get("value")); + } else if ("min".equals(map.get("key"))) { + yamlParams.setMin(map.get("value")); + } else if ("max".equals(map.get("key"))) { + yamlParams.setMax(map.get("value")); } } ApplyType apply = |