X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=POLICY-SDK-APP%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fpolicy%2Fcomponents%2FHumanPolicyComponent.java;h=60029f8d7811be45898b289960952fce05b72e0f;hb=refs%2Fchanges%2F42%2F96642%2F2;hp=ea0dce2c06783c952c2108d0d22dcdf105c48f2f;hpb=75d9db3e29232580871c106560016be6492255d6;p=policy%2Fengine.git
diff --git a/POLICY-SDK-APP/src/main/java/org/onap/policy/components/HumanPolicyComponent.java b/POLICY-SDK-APP/src/main/java/org/onap/policy/components/HumanPolicyComponent.java
index ea0dce2c0..60029f8d7 100644
--- a/POLICY-SDK-APP/src/main/java/org/onap/policy/components/HumanPolicyComponent.java
+++ b/POLICY-SDK-APP/src/main/java/org/onap/policy/components/HumanPolicyComponent.java
@@ -2,7 +2,8 @@
* ============LICENSE_START=======================================================
* ONAP Policy Engine
* ================================================================================
- * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2019 Bell Canada
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -38,7 +39,9 @@ import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
+
import javax.xml.bind.JAXBElement;
+
import oasis.names.tc.xacml._3_0.core.schema.wd_17.AdviceExpressionType;
import oasis.names.tc.xacml._3_0.core.schema.wd_17.AdviceExpressionsType;
import oasis.names.tc.xacml._3_0.core.schema.wd_17.AllOfType;
@@ -56,6 +59,7 @@ import oasis.names.tc.xacml._3_0.core.schema.wd_17.PolicySetType;
import oasis.names.tc.xacml._3_0.core.schema.wd_17.PolicyType;
import oasis.names.tc.xacml._3_0.core.schema.wd_17.RuleType;
import oasis.names.tc.xacml._3_0.core.schema.wd_17.VariableReferenceType;
+
import org.apache.commons.io.FilenameUtils;
import org.json.JSONObject;
import org.onap.policy.common.logging.flexlogger.FlexLogger;
@@ -65,8 +69,6 @@ import org.onap.policy.rest.jpa.FunctionDefinition;
import org.onap.policy.xacml.api.XACMLErrorConstants;
import org.onap.policy.xacml.util.XACMLPolicyScanner;
-
-
public class HumanPolicyComponent {
private static final Logger LOGGER = FlexLogger.getLogger(HumanPolicyComponent.class);
@@ -96,7 +98,6 @@ public class HumanPolicyComponent {
public static final String EMPTY_STRING = "";
private static final String ENTER = "ENTER";
-
private static HtmlProcessor htmlProcessor;
private static File policyFile;
@@ -218,8 +219,7 @@ class HtmlProcessor extends SimpleCallback {
throw new IllegalArgumentException(msg);
}
- if (policyObject == null
- || (!(policyObject instanceof PolicySetType) && !(policyObject instanceof PolicyType))) {
+ if ((!(policyObject instanceof PolicySetType) && !(policyObject instanceof PolicyType))) {
String msg = "Invalid unmarshalled object: " + policyObject;
LOGGER.error(XACMLErrorConstants.ERROR_SCHEMA_INVALID + msg);
throw new IllegalArgumentException(msg);
@@ -359,7 +359,6 @@ class HtmlProcessor extends SimpleCallback {
String id = "-";
String version = "-";
-
if (policySet.getPolicyCombiningAlgId() != null)
combiningAlgorithm = extractLastIdentifier(policySet.getPolicyCombiningAlgId(), ":");
@@ -369,7 +368,6 @@ class HtmlProcessor extends SimpleCallback {
if (policySet.getVersion() != null)
version = policySet.getVersion();
-
htmlOut.println("<" + htmlListElement + ">Policy Set ID: " + id + " (v" + version + ") " + ""
+ htmlListElement + ">");
@@ -443,7 +441,6 @@ class HtmlProcessor extends SimpleCallback {
String id = "-";
String version = "-";
-
if (policy.getRuleCombiningAlgId() != null)
combiningAlgorithm = extractLastIdentifier(policy.getRuleCombiningAlgId(), ":");
@@ -479,7 +476,6 @@ class HtmlProcessor extends SimpleCallback {
}
}
-
@Override
public CallbackResult onPreVisitRule(PolicyType parent, RuleType rule) {
if (LOGGER.isTraceEnabled())