summaryrefslogtreecommitdiffstats
path: root/applications/common/src/main/java
diff options
context:
space:
mode:
authorAli Hockla <ah999m@att.com>2019-11-08 12:54:02 -0600
committerAli Hockla <ah999m@att.com>2019-11-12 08:06:23 -0600
commit8d28c6fc936eb4bd95ad1ebd013996cff4787e0e (patch)
treece1a83362e61812de0edadc1e03635f071c07286 /applications/common/src/main/java
parentdd69ccf79236b5268cc8cac2638fcd07f373bd4d (diff)
Added support to return status and error if pdp-x failed to load policy
Issue-ID: POLICY-2175 Change-Id: I32d2fe78846f58d6e700100dd523732817f1f04d Signed-off-by: Ali Hockla <ah999m@att.com>
Diffstat (limited to 'applications/common/src/main/java')
-rw-r--r--applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/XacmlApplicationServiceProvider.java2
-rw-r--r--applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/std/StdXacmlApplicationServiceProvider.java6
2 files changed, 3 insertions, 5 deletions
diff --git a/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/XacmlApplicationServiceProvider.java b/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/XacmlApplicationServiceProvider.java
index 0b9975f7..edd33c0e 100644
--- a/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/XacmlApplicationServiceProvider.java
+++ b/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/XacmlApplicationServiceProvider.java
@@ -89,7 +89,7 @@ public interface XacmlApplicationServiceProvider {
*
* @param toscaPolicy object
*/
- boolean loadPolicy(ToscaPolicy toscaPolicy) throws XacmlApplicationException;
+ void loadPolicy(ToscaPolicy toscaPolicy) throws XacmlApplicationException;
/**
* unloadPolicy a Tosca Policy.
diff --git a/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/std/StdXacmlApplicationServiceProvider.java b/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/std/StdXacmlApplicationServiceProvider.java
index 12135f4a..5aea3457 100644
--- a/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/std/StdXacmlApplicationServiceProvider.java
+++ b/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/std/StdXacmlApplicationServiceProvider.java
@@ -116,7 +116,7 @@ public abstract class StdXacmlApplicationServiceProvider implements XacmlApplica
}
@Override
- public synchronized boolean loadPolicy(ToscaPolicy toscaPolicy) {
+ public synchronized void loadPolicy(ToscaPolicy toscaPolicy) throws XacmlApplicationException {
try {
//
// Convert the policies first
@@ -165,10 +165,8 @@ public abstract class StdXacmlApplicationServiceProvider implements XacmlApplica
//
this.mapLoadedPolicies.put(toscaPolicy, refPath);
} catch (IOException | ToscaPolicyConversionException e) {
- LOGGER.error("Failed to loadPolicies {}", e);
- return false;
+ throw new XacmlApplicationException("loadPolicy failed", e);
}
- return true;
}
@Override