aboutsummaryrefslogtreecommitdiffstats
path: root/controlloop/common/feature-controlloop-management
diff options
context:
space:
mode:
authorPamela Dragosh <pdragosh@research.att.com>2019-04-29 13:07:09 -0400
committerPamela Dragosh <pdragosh@research.att.com>2019-04-29 13:07:14 -0400
commit71b3a6b68a1a27839fde863b46c74587131be313 (patch)
tree4ca8d00285dd5a0f142d1ac7d7e316d3a959765e /controlloop/common/feature-controlloop-management
parent74f5aea3da13f47573bff055397c5bbe5e1db55f (diff)
Fix sonar bug and upgrade parent
* Fix simple sonar bug for logging errors * Private constructors to hide implicit. * Not enough arguments for debug statement * Upgrade to policy/parent released version Issue-ID: POLICY-1700 Change-Id: Id8040c2aa0abdbe4946db60f97cb279974817447 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
Diffstat (limited to 'controlloop/common/feature-controlloop-management')
-rw-r--r--controlloop/common/feature-controlloop-management/src/main/java/org/onap/policy/drools/server/restful/RestControlLoopManager.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/controlloop/common/feature-controlloop-management/src/main/java/org/onap/policy/drools/server/restful/RestControlLoopManager.java b/controlloop/common/feature-controlloop-management/src/main/java/org/onap/policy/drools/server/restful/RestControlLoopManager.java
index 0b4005a17..57ef17a33 100644
--- a/controlloop/common/feature-controlloop-management/src/main/java/org/onap/policy/drools/server/restful/RestControlLoopManager.java
+++ b/controlloop/common/feature-controlloop-management/src/main/java/org/onap/policy/drools/server/restful/RestControlLoopManager.java
@@ -45,6 +45,8 @@ import org.onap.policy.controlloop.processor.ControlLoopProcessor;
import org.onap.policy.drools.apps.controlloop.feature.management.ControlLoopManagementFeature;
import org.onap.policy.drools.controller.DroolsController;
import org.onap.policy.drools.system.PolicyController;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* Telemetry Extensions for Control Loops in the PDP-D.
@@ -55,6 +57,7 @@ import org.onap.policy.drools.system.PolicyController;
@Consumes(MediaType.APPLICATION_JSON)
@Api
public class RestControlLoopManager {
+ private static final Logger logger = LoggerFactory.getLogger(RestControlLoopManager.class);
/**
* GET control loops.
@@ -79,6 +82,7 @@ public class RestControlLoopManager {
return Response.status(Response.Status.OK).entity(controlLoopNames).build();
} catch (IllegalArgumentException e) {
+ logger.error("{}", e);
return Response.status(Response.Status.NOT_FOUND).entity(e.getMessage()).build();
}
}
@@ -108,6 +112,7 @@ public class RestControlLoopManager {
return Response.status(Response.Status.OK).entity(controlLoopParams).build();
} catch (IllegalArgumentException e) {
+ logger.error("{}", e);
return Response.status(Response.Status.NOT_FOUND).entity(e.getMessage()).build();
}
}
@@ -145,8 +150,10 @@ public class RestControlLoopManager {
return Response.status(Status.OK)
.entity(URLDecoder.decode(controlLoopParams.getControlLoopYaml(), "UTF-8")).build();
} catch (IllegalArgumentException e) {
+ logger.error("{}", e);
return Response.status(Response.Status.NOT_FOUND).entity(e.getMessage()).build();
} catch (UnsupportedEncodingException e) {
+ logger.error("{}", e);
return Response.status(Status.INTERNAL_SERVER_ERROR).entity("Unreadable Policy").build();
}
}
@@ -207,8 +214,10 @@ public class RestControlLoopManager {
return Response.status(Status.OK).entity(controlLoop).build();
} catch (IllegalArgumentException i) {
+ logger.error("{}", i);
return Response.status(Response.Status.NOT_FOUND).entity(i).build();
} catch (ControlLoopException | UnsupportedEncodingException e) {
+ logger.error("{}", e);
return Response.status(Status.NOT_ACCEPTABLE).entity(e).build();
}
}