summaryrefslogtreecommitdiffstats
path: root/appc-dispatcher/appc-command-executor/appc-command-executor-core/src/main/java/org
diff options
context:
space:
mode:
Diffstat (limited to 'appc-dispatcher/appc-command-executor/appc-command-executor-core/src/main/java/org')
-rw-r--r--appc-dispatcher/appc-command-executor/appc-command-executor-core/src/main/java/org/openecomp/appc/executor/impl/CommandTask.java4
-rw-r--r--appc-dispatcher/appc-command-executor/appc-command-executor-core/src/main/java/org/openecomp/appc/executor/impl/LCMCommandTask.java9
-rw-r--r--appc-dispatcher/appc-command-executor/appc-command-executor-core/src/main/java/org/openecomp/appc/executor/impl/LCMReadonlyCommandTask.java6
3 files changed, 5 insertions, 14 deletions
diff --git a/appc-dispatcher/appc-command-executor/appc-command-executor-core/src/main/java/org/openecomp/appc/executor/impl/CommandTask.java b/appc-dispatcher/appc-command-executor/appc-command-executor-core/src/main/java/org/openecomp/appc/executor/impl/CommandTask.java
index 6418002c2..0037434ff 100644
--- a/appc-dispatcher/appc-command-executor/appc-command-executor-core/src/main/java/org/openecomp/appc/executor/impl/CommandTask.java
+++ b/appc-dispatcher/appc-command-executor/appc-command-executor-core/src/main/java/org/openecomp/appc/executor/impl/CommandTask.java
@@ -119,8 +119,4 @@ public abstract class CommandTask<M> implements Runnable {
this.onRequestCompletion(commandRequest,commandResponse);
}
- public static void fillStatus(Status status, LCMCommandStatus lcmCommandStatus, Params params) {
- status.setCode(lcmCommandStatus.getResponseCode());
- status.setMessage(lcmCommandStatus.getFormattedMessage(params));
- }
}
diff --git a/appc-dispatcher/appc-command-executor/appc-command-executor-core/src/main/java/org/openecomp/appc/executor/impl/LCMCommandTask.java b/appc-dispatcher/appc-command-executor/appc-command-executor-core/src/main/java/org/openecomp/appc/executor/impl/LCMCommandTask.java
index 6e64a546b..9f7c13513 100644
--- a/appc-dispatcher/appc-command-executor/appc-command-executor-core/src/main/java/org/openecomp/appc/executor/impl/LCMCommandTask.java
+++ b/appc-dispatcher/appc-command-executor/appc-command-executor-core/src/main/java/org/openecomp/appc/executor/impl/LCMCommandTask.java
@@ -147,22 +147,19 @@ public class LCMCommandTask extends CommandTask<LCMCommandRequest> {
isAAIUpdated= postVnfdata(vnfId, nextState,"onRequestExecutionStart",ctx);
} catch (NoTransitionDefinedException e) {
logger.error("Error getting Next State for AAI Update: " + e.getMessage(), e);
- Status status = request.getCommandExecutorInput().getRuntimeContext().getResponseContext().getStatus();
Params params = new Params().addParam("actionName",e.event).addParam("currentState",e.currentState);
- fillStatus(status, LCMCommandStatus.NO_TRANSITION_DEFINE_FAILURE, params);
+ request.getCommandExecutorInput().getRuntimeContext().getResponseContext().setStatus(LCMCommandStatus.NO_TRANSITION_DEFINE_FAILURE.toStatus(params));
isAAIUpdated = false;
} catch (UnstableVNFException e) {
logger.error(e.getMessage(), e);
- Status status = request.getCommandExecutorInput().getRuntimeContext().getResponseContext().getStatus();
Params params = new Params().addParam("vnfId",vnfId);
- fillStatus(status, LCMCommandStatus.UNSTABLE_VNF_FAILURE, params);
+ request.getCommandExecutorInput().getRuntimeContext().getResponseContext().setStatus(LCMCommandStatus.UNSTABLE_VNF_FAILURE.toStatus(params));
isAAIUpdated = false;
}catch (Exception e) {
logger.error("Error before Request Execution starts.", e);
- Status status = request.getCommandExecutorInput().getRuntimeContext().getResponseContext().getStatus();
String errorMsg = StringUtils.isEmpty(e.getMessage()) ? e.toString() : e.getMessage();
Params params = new Params().addParam("errorMsg",errorMsg);
- fillStatus(status, LCMCommandStatus.UNEXPECTED_FAILURE, params);
+ request.getCommandExecutorInput().getRuntimeContext().getResponseContext().setStatus(LCMCommandStatus.UNEXPECTED_FAILURE.toStatus(params));
isAAIUpdated = false;
}
diff --git a/appc-dispatcher/appc-command-executor/appc-command-executor-core/src/main/java/org/openecomp/appc/executor/impl/LCMReadonlyCommandTask.java b/appc-dispatcher/appc-command-executor/appc-command-executor-core/src/main/java/org/openecomp/appc/executor/impl/LCMReadonlyCommandTask.java
index 137a2e4b5..201662a6c 100644
--- a/appc-dispatcher/appc-command-executor/appc-command-executor-core/src/main/java/org/openecomp/appc/executor/impl/LCMReadonlyCommandTask.java
+++ b/appc-dispatcher/appc-command-executor/appc-command-executor-core/src/main/java/org/openecomp/appc/executor/impl/LCMReadonlyCommandTask.java
@@ -67,15 +67,13 @@ public class LCMReadonlyCommandTask extends CommandTask<LCMReadOnlyCommandReques
super.execute();
} catch (UnstableVNFException e) {
logger.error(e.getMessage(), e);
- Status status = request.getCommandExecutorInput().getRuntimeContext().getResponseContext().getStatus();
Params params = new Params().addParam("vnfId",vnfId);
- fillStatus(status, LCMCommandStatus.UNSTABLE_VNF_FAILURE, params);
+ request.getCommandExecutorInput().getRuntimeContext().getResponseContext().setStatus(LCMCommandStatus.UNSTABLE_VNF_FAILURE.toStatus(params));
}catch (Exception e) {
logger.error("Error during runing LCMReadonlyCommandTask.", e);
- Status status = request.getCommandExecutorInput().getRuntimeContext().getResponseContext().getStatus();
String errorMsg = StringUtils.isEmpty(e.getMessage()) ? e.toString() : e.getMessage();
Params params = new Params().addParam("errorMsg",errorMsg);
- fillStatus(status, LCMCommandStatus.UNEXPECTED_FAILURE, params);
+ request.getCommandExecutorInput().getRuntimeContext().getResponseContext().setStatus(LCMCommandStatus.UNEXPECTED_FAILURE.toStatus(params));
}
}
}