From b618f528b62fe809030819bd310b4049e91f08a3 Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Fri, 2 Aug 2019 19:22:09 +0200 Subject: [PATCH] Fixed logs --- .../executor/rest/RestSmartExecutor.java | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/main/java/org/gcube/vremanagement/executor/rest/RestSmartExecutor.java b/src/main/java/org/gcube/vremanagement/executor/rest/RestSmartExecutor.java index a9d4608..008f0d9 100644 --- a/src/main/java/org/gcube/vremanagement/executor/rest/RestSmartExecutor.java +++ b/src/main/java/org/gcube/vremanagement/executor/rest/RestSmartExecutor.java @@ -52,10 +52,10 @@ public class RestSmartExecutor implements SmartExecutor { @Context protected UriInfo uriInfo; - protected void setCalledMethod(String method) { - logger.trace("Going to set calledMethod as '{}'", method); - CalledMethodProvider.instance.set(method); - logger.info("Arrived request at /{}", uriInfo.getPath()); + protected void setCalledMethod(String calledMethod) { + logger.trace("Going to set calledMethod as '{}'", calledMethod); + CalledMethodProvider.instance.set(calledMethod); + logger.info("Arrived request at {}", uriInfo.getAbsolutePath()); } protected ResponseBuilder addLocation(ResponseBuilder responseBuilder, String id) { @@ -167,18 +167,19 @@ public class RestSmartExecutor implements SmartExecutor { @PathParam(UUID_PATH_PARAM) String executionIdentifier, @QueryParam(RestConstants.UNSCHEDULE_PARAM) Boolean unschedule) throws ExecutorException { - if(unschedule) { - setCalledMethod(PURGE.class.getSimpleName() + " /" + RestConstants.PLUGINS_PATH_PART + "/" + pluginName - + "/" + RestConstants.EXECUTIONS_PATH_PART + "/{" + UUID_PATH_PARAM + "}"); - } else { - setCalledMethod(HttpMethod.DELETE + " /" + RestConstants.PLUGINS_PATH_PART + "/" - + pluginName + "/" + RestConstants.EXECUTIONS_PATH_PART + "/{" + UUID_PATH_PARAM + "}"); - } try { if(unschedule == null) { unschedule = false; } + if(unschedule) { + setCalledMethod(PURGE.class.getSimpleName() + " /" + RestConstants.PLUGINS_PATH_PART + "/" + pluginName + + "/" + RestConstants.EXECUTIONS_PATH_PART + "/{" + UUID_PATH_PARAM + "}"); + } else { + setCalledMethod(HttpMethod.DELETE + " /" + RestConstants.PLUGINS_PATH_PART + "/" + + pluginName + "/" + RestConstants.EXECUTIONS_PATH_PART + "/{" + UUID_PATH_PARAM + "}"); + } + logger.info("Requested to delete for {} with UUID {}{}", pluginName, executionIdentifier, unschedule ? "globally" : "");