From c9373d8f5809fe650c30832e9409282cb34688f8 Mon Sep 17 00:00:00 2001 From: Gary Wu Date: Sat, 8 Apr 2017 14:36:17 -0700 Subject: Refactor Status to be immutable Change Status class to be immutable. Add convenience method to convert from a LCMCommandStatus to a Status object. Change-Id: I9e47750d15b5ee0f5649b2fabf6387aa12ff9c9d Signed-off-by: Gary Wu --- .../main/java/org/openecomp/appc/provider/AppcProviderLcm.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'appc-provider/appc-provider-bundle/src') diff --git a/appc-provider/appc-provider-bundle/src/main/java/org/openecomp/appc/provider/AppcProviderLcm.java b/appc-provider/appc-provider-bundle/src/main/java/org/openecomp/appc/provider/AppcProviderLcm.java index 5fe174e55..6d186ab5f 100644 --- a/appc-provider/appc-provider-bundle/src/main/java/org/openecomp/appc/provider/AppcProviderLcm.java +++ b/appc-provider/appc-provider-bundle/src/main/java/org/openecomp/appc/provider/AppcProviderLcm.java @@ -462,14 +462,10 @@ public class AppcProviderLcm implements AutoCloseable, AppcProviderLcmService { requestHandlerOutput = new RequestHandlerOutput(); requestHandlerOutput.setResponseContext(responseContext); responseContext.setCommonHeader(request.getRequestContext().getCommonHeader()); - final org.openecomp.appc.domainmodel.lcm.Status status = new org.openecomp.appc.domainmodel.lcm.Status(); - - responseContext.setStatus(status); - String errorMessage = e.getMessage() != null ? e.getMessage() : e.toString(); Params params = new Params().addParam("errorMsg", errorMessage); - status.setCode(LCMCommandStatus.UNEXPECTED_ERROR.getResponseCode()); - status.setMessage(LCMCommandStatus.UNEXPECTED_ERROR.getFormattedMessage(params)); + responseContext.setStatus(LCMCommandStatus.UNEXPECTED_ERROR.toStatus(params)); + LoggingUtils.logErrorMessage( LoggingConstants.TargetNames.APPC_PROVIDER, reason, -- cgit 1.2.3-korg