diff options
author | rb7147 <rb7147@att.com> | 2018-07-18 12:50:06 -0400 |
---|---|---|
committer | rb7147 <rb7147@att.com> | 2018-07-24 14:16:12 -0400 |
commit | 95524c8ef8be0d41de8bb2b918f320e464ebb897 (patch) | |
tree | d3b5cdf4ebd9b42aff5e48e54cfd45f353c89f52 /ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/policycontroller/PolicyCreation.java | |
parent | 9bfa1d61dc77973f85a42174b199d4c744265521 (diff) |
Decision BlackList Guard Enhancements
While creating a decision Bl Guard Policy we are allowing to add
Blacklist entries through file upload for bulk from GUI.
Issue-ID: POLICY-901
Change-Id: I4031fd4a96937b9facc330cecf72777d701d4678
Signed-off-by: rb7147 <rb7147@att.com>
Diffstat (limited to 'ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/policycontroller/PolicyCreation.java')
-rw-r--r-- | ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/policycontroller/PolicyCreation.java | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/policycontroller/PolicyCreation.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/policycontroller/PolicyCreation.java index f7ef1a097..a6cda5e68 100644 --- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/policycontroller/PolicyCreation.java +++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/policycontroller/PolicyCreation.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP-PAP-REST * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2018 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. @@ -416,6 +416,16 @@ public class PolicyCreation extends AbstractPolicyCreation{ String blackList = StringUtils.join(policyData.getYamlparams().getBlackList(), ","); attributeMap.put("blackList", blackList); } + if(DecisionPolicy.GUARD_BL_YAML.equals(policyData.getRuleProvider()) && "Use File Upload".equals(policyData.getBlackListEntryType())){ + if(policyData.getBlackListEntries() != null && !policyData.getBlackListEntries().isEmpty()){ + String blackList = StringUtils.join(policyData.getBlackListEntries(), ","); + attributeMap.put("blackList", blackList); + } + if(policyData.getAppendBlackListEntries() != null && !policyData.getAppendBlackListEntries().isEmpty()){ + String blackList = StringUtils.join(policyData.getAppendBlackListEntries(), ","); + attributeMap.put("appendBlackList", blackList); + } + } if(policyData.getYamlparams().getTargets()!=null){ String targets = StringUtils.join(policyData.getYamlparams().getTargets(),","); attributeMap.put("targets", targets); |