Continue addressing technical debt for ONAP-XACML 89/29889/1
authorGao, Chenfei (cg287m) <cgao@research.att.com>
Wed, 31 Jan 2018 22:01:05 +0000 (17:01 -0500)
committerGao, Chenfei (cg287m) <cgao@research.att.com>
Wed, 31 Jan 2018 22:02:26 +0000 (17:02 -0500)
Follow the list of acceptable fixes in POLICY-336 description

Issue-ID: POLICY-475
Change-Id: I67f46bb383db1ac4feecb0223df98d180733fc95
Signed-off-by: Gao, Chenfei (cg287m) <cgao@research.att.com>
ONAP-XACML/src/main/java/org/onap/policy/xacml/std/pap/StdEngine.java
ONAP-XACML/src/main/java/org/onap/policy/xacml/std/pap/StdPAPPolicy.java
ONAP-XACML/src/main/java/org/onap/policy/xacml/std/pap/StdPDPGroup.java
ONAP-XACML/src/main/java/org/onap/policy/xacml/util/XACMLPolicyWriter.java

index d43a890..3173bc1 100644 (file)
@@ -625,16 +625,16 @@ public class StdEngine extends StdPDPItemSetChangeNotifier implements PAPPolicyE
                List<String> ids = new ArrayList<>();
                for (PDPGroup group : this.groups) {
                        ids.add(group.getId());
-                       properties.setProperty(group.getId() + ".name", (group.getName() == null ? "" : group.getName()));
-                       properties.setProperty(group.getId() + ".description", (group.getDescription() == null ? "" : group.getDescription()));
+                       properties.setProperty(group.getId() + ".name", group.getName() == null ? "" : group.getName());
+                       properties.setProperty(group.getId() + ".description", group.getDescription() == null ? "" : group.getDescription());
                        //
                        // Iterate its PDPs
                        //
                        List<String> pdps = new ArrayList<>();
                        for (PDP pdp : group.getPdps()) {
                                pdps.add(pdp.getId());
-                               properties.setProperty(pdp.getId() + ".name", (pdp.getName() == null ? "" : pdp.getName()));
-                               properties.setProperty(pdp.getId() + ".description", (pdp.getDescription() == null ? "" : pdp.getDescription()));
+                               properties.setProperty(pdp.getId() + ".name", pdp.getName() == null ? "" : pdp.getName());
+                               properties.setProperty(pdp.getId() + ".description", pdp.getDescription() == null ? "" : pdp.getDescription());
                                if (pdp instanceof OnapPDP) {
                                        properties.setProperty(pdp.getId() + ".jmxport", (((OnapPDP)pdp).getJmxPort()==0 ? "" : ((OnapPDP)pdp).getJmxPort()).toString());
                                }
index 21381c1..c66d11b 100644 (file)
@@ -21,7 +21,6 @@ package org.onap.policy.xacml.std.pap;
 
 import java.io.Serializable;
 import java.net.URI;
-import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
index 745a43d..9289c24 100644 (file)
@@ -47,7 +47,6 @@ import org.onap.policy.xacml.std.pap.StdPDPItemSetChangeNotifier.StdItemSetChang
 
 import com.att.research.xacml.api.pap.PAPException;
 import com.att.research.xacml.api.pap.PDP;
-//import com.att.research.xacml.api.pap.PDPGroup;
 import com.att.research.xacml.api.pap.PDPGroupStatus;
 import com.att.research.xacml.api.pap.PDPGroupStatus.Status;
 import com.att.research.xacml.api.pap.PDPPIPConfig;
index 5e60e37..0807f75 100644 (file)
@@ -252,7 +252,7 @@ public class XACMLPolicyWriter {
                                                                                                                txtFileName = txtFileName.substring(0, txtFileName.lastIndexOf(".")+1) + origExtension;
                                                                                                                txtFileName = configUrl+ File.separator + "Config" + File.separator + domain + txtFileName;
                                                                                                                attributeValueType1.getContent().add(txtFileName);      
-                                                                                                       } else if (attributeAssignmentExpressionType.getAttributeId().equals("PolicyName")) {
+                                                                                                       } else if ("PolicyName".equals(attributeAssignmentExpressionType.getAttributeId())) {
                                                                                                                JAXBElement<AttributeValueType> attributeValueType = (JAXBElement<AttributeValueType>) attributeAssignmentExpressionType.getExpression();
                                                                                                                AttributeValueType attributeValueType1 = attributeValueType.getValue();
                                                                                                                List<Object> contents = attributeValueType1.getContent();