diff options
author | Lukasz Muszkieta <lukasz.muszkieta@nokia.com> | 2018-04-27 15:22:06 +0200 |
---|---|---|
committer | Lukasz Muszkieta <lukasz.muszkieta@nokia.com> | 2018-04-27 15:24:22 +0200 |
commit | dd233a2aafcdb092535af1eca5a49a090c570394 (patch) | |
tree | 1070b2dabbd57e8191649f55f387144d09e8b907 /mso-api-handlers | |
parent | b882d58c3e1e94216fb104d0520b1dfc4ff74d3a (diff) |
Add correlationId to ServiceInstancesRequest
Change-Id: Idc5ee56660da31f08fd8ed3a67b7cd28f9844f43
Issue-ID: SO-596
Signed-off-by: Lukasz Muszkieta <lukasz.muszkieta@nokia.com>
Diffstat (limited to 'mso-api-handlers')
-rw-r--r-- | mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/ServiceInstances.java | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/ServiceInstances.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/ServiceInstances.java index fc8e8d9d6a..7c3a3df0e2 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/ServiceInstances.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/ServiceInstances.java @@ -77,7 +77,6 @@ import com.wordnik.swagger.annotations.ApiOperation; @Api(value="/serviceInstances",description="API Requests for Service Instances") public class ServiceInstances { - private HashMap<String, String> instanceIdMap = new HashMap<>(); private static MsoLogger msoLogger = MsoLogger.getMsoLogger (MsoLogger.Catalog.APIH); private static MsoAlarmLogger alarmLogger = new MsoAlarmLogger (); @@ -508,7 +507,7 @@ public class ServiceInstances { MsoRequest msoRequest = new MsoRequest (requestId); try { - sir = convertJsonToServiceInstanceRequest(requestJSON, action, startTime, sir, msoRequest); + sir = convertJsonToServiceInstanceRequest(requestJSON, action, startTime, msoRequest); } catch(Exception e) { msoLogger.debug("Exception occurred while mapping of request to JSON object ", e); Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_BAD_REQUEST, MsoException.ServiceException, @@ -907,11 +906,10 @@ public class ServiceInstances { } private ServiceInstancesRequest convertJsonToServiceInstanceRequest(String requestJSON, Action action, long startTime, - ServiceInstancesRequest sir, MsoRequest msoRequest) throws Exception { + MsoRequest msoRequest) throws Exception { try{ ObjectMapper mapper = new ObjectMapper(); - sir = mapper.readValue(requestJSON, ServiceInstancesRequest.class); - + return mapper.readValue(requestJSON, ServiceInstancesRequest.class); } catch(Exception e){ msoLogger.debug ("Mapping of request to JSON object failed : ", e); if (msoRequest.getRequestId () != null) { @@ -922,7 +920,6 @@ public class ServiceInstances { msoLogger.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.SchemaError, "Mapping of request to JSON object failed"); throw new Exception(e); } - return sir; } private RecipeLookupResult getServiceInstanceOrchestrationURI (CatalogDatabase db, MsoRequest msoRequest, Action action) throws Exception { @@ -1233,7 +1230,7 @@ public class ServiceInstances { MsoRequest msoRequest = new MsoRequest (requestId); try { - sir = convertJsonToServiceInstanceRequest(requestJSON, action, startTime, sir, msoRequest); + sir = convertJsonToServiceInstanceRequest(requestJSON, action, startTime, msoRequest); } catch(Exception e) { Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_BAD_REQUEST, MsoException.ServiceException, "Mapping of request to JSON object failed. " + e.getMessage(), |