summaryrefslogtreecommitdiffstats
path: root/controlloop
diff options
context:
space:
mode:
authorJorge Hernandez <jorge.hernandez-herrero@att.com>2019-05-08 12:47:31 +0000
committerGerrit Code Review <gerrit@onap.org>2019-05-08 12:47:31 +0000
commit01841878936986bc80a974977ccdeaceaf7f9a78 (patch)
tree74a48465850007cb930369e760bb674e78a52ae7 /controlloop
parente244e9998253c00b208a0f0bc29d6a16164b172f (diff)
parent3a7d82430eed5f8c3abbff9e2bfd8fb978f526e9 (diff)
Merge "Add debugging of REST call"
Diffstat (limited to 'controlloop')
-rw-r--r--controlloop/common/guard/src/main/java/org/onap/policy/guard/PolicyGuardXacmlHelper.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/controlloop/common/guard/src/main/java/org/onap/policy/guard/PolicyGuardXacmlHelper.java b/controlloop/common/guard/src/main/java/org/onap/policy/guard/PolicyGuardXacmlHelper.java
index 2d43c885e..8ff226f7a 100644
--- a/controlloop/common/guard/src/main/java/org/onap/policy/guard/PolicyGuardXacmlHelper.java
+++ b/controlloop/common/guard/src/main/java/org/onap/policy/guard/PolicyGuardXacmlHelper.java
@@ -95,7 +95,7 @@ public class PolicyGuardXacmlHelper {
return response;
} catch (Exception e) {
- logger.error("Error in sending RESTful request: ", e);
+ logger.error("Exception in sending RESTful request: ", e);
}
return Util.DENY;
@@ -117,14 +117,20 @@ public class PolicyGuardXacmlHelper {
Map<String, String> headers = new HashMap<>();
headers.put("Accepts", "application/json");
+ logger.info("Guard Decision Request: {}", jsonBody);
+
Pair<Integer, String> httpDetails = restManager.post(url, user, pwd, headers, "application/json", jsonBody);
if (httpDetails == null) {
+ logger.error("Guard rest call returned a null pair - defaulting to DENY");
return Util.DENY;
}
+ logger.info("Guard Decision REST Response {} {}", httpDetails.first, httpDetails.second);
+
if (httpDetails.first == 200) {
DecisionResponse decision = coder.decode(httpDetails.second, DecisionResponse.class);
+ logger.info("Guard Decision {}", decision);
return decision.getStatus();
}