aboutsummaryrefslogtreecommitdiffstats
path: root/policy-management/src
diff options
context:
space:
mode:
Diffstat (limited to 'policy-management/src')
-rw-r--r--policy-management/src/main/java/org/onap/policy/drools/server/restful/RestManager.java8
-rw-r--r--policy-management/src/main/java/org/onap/policy/drools/system/PolicyEngineManager.java2
-rw-r--r--policy-management/src/test/java/org/onap/policy/drools/system/PolicyEngineManagerTest.java1
3 files changed, 5 insertions, 6 deletions
diff --git a/policy-management/src/main/java/org/onap/policy/drools/server/restful/RestManager.java b/policy-management/src/main/java/org/onap/policy/drools/server/restful/RestManager.java
index c5841b06..8b807387 100644
--- a/policy-management/src/main/java/org/onap/policy/drools/server/restful/RestManager.java
+++ b/policy-management/src/main/java/org/onap/policy/drools/server/restful/RestManager.java
@@ -89,6 +89,7 @@ import org.slf4j.LoggerFactory;
tags = {@Tag(name = "pdp-d-telemetry", description = "Drools PDP Telemetry Operations")})
public class RestManager {
+ private static final String OFFER_FAILED = "{}: cannot offer to topic {} because of {}";
private static final String CANNOT_PERFORM_OPERATION = "cannot perform operation";
private static final String NO_FILTERS = " no filters";
private static final String NOT_FOUND = " not found: ";
@@ -2085,17 +2086,16 @@ public class RestManager {
.build();
}
} catch (IllegalArgumentException e) {
- logger.debug("{}: cannot offer to topic {} because of {}", this, topic, e.getMessage(),
- e);
+ logger.debug(OFFER_FAILED, this, topic, e.getMessage(), e);
return Response.status(Response.Status.NOT_FOUND)
.entity(new Error(topic + NOT_FOUND_MSG)).build();
} catch (IllegalStateException e) {
- logger.debug("{}: cannot offer to topic {} because of {}", this, topic, e.getMessage(),
- e);
+ logger.debug(OFFER_FAILED, this, topic, e.getMessage(), e);
return Response.status(Response.Status.NOT_ACCEPTABLE)
.entity(new Error(topic + " not acceptable due to current state"))
.build();
} catch (Exception e) {
+ logger.debug(OFFER_FAILED, this, topic, e.getMessage(), e);
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(new Error(e.getMessage()))
.build();
}
diff --git a/policy-management/src/main/java/org/onap/policy/drools/system/PolicyEngineManager.java b/policy-management/src/main/java/org/onap/policy/drools/system/PolicyEngineManager.java
index c924fd69..757b67fa 100644
--- a/policy-management/src/main/java/org/onap/policy/drools/system/PolicyEngineManager.java
+++ b/policy-management/src/main/java/org/onap/policy/drools/system/PolicyEngineManager.java
@@ -841,8 +841,8 @@ class PolicyEngineManager implements PolicyEngine {
logger.warn("{}: abnormal termination - shutdown graceful time period expiration",
PolicyEngineManager.this);
} catch (final InterruptedException e) {
- /* courtesy to shutdown() to allow it to return */
synchronized (PolicyEngineManager.this) {
+ /* courtesy to shutdown() to allow it to return */
}
logger.info("{}: finishing a graceful shutdown ", PolicyEngineManager.this, e);
} finally {
diff --git a/policy-management/src/test/java/org/onap/policy/drools/system/PolicyEngineManagerTest.java b/policy-management/src/test/java/org/onap/policy/drools/system/PolicyEngineManagerTest.java
index fe1a2345..397e9539 100644
--- a/policy-management/src/test/java/org/onap/policy/drools/system/PolicyEngineManagerTest.java
+++ b/policy-management/src/test/java/org/onap/policy/drools/system/PolicyEngineManagerTest.java
@@ -58,7 +58,6 @@ import org.onap.policy.common.utils.gson.GsonTestUtils;
import org.onap.policy.drools.controller.DroolsController;
import org.onap.policy.drools.core.lock.Lock;
import org.onap.policy.drools.core.lock.LockCallback;
-import org.onap.policy.drools.core.lock.LockImpl;
import org.onap.policy.drools.core.lock.PolicyResourceLockManager;
import org.onap.policy.drools.features.PolicyControllerFeatureApi;
import org.onap.policy.drools.features.PolicyEngineFeatureApi;