From a860e20b08c4b88b609cad90648c4db52bc2555f Mon Sep 17 00:00:00 2001 From: seshukm Date: Wed, 11 Oct 2017 14:17:50 +0530 Subject: Correct E2E svc to update RequestDb IssueId: SO-205 Change-Id: Ib5f634c13c09c9f5df04d3973dd6c95684520d0b Signed-off-by: seshukm --- .../openecomp/mso/apihandlerinfra/E2EServiceInstances.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'mso-api-handlers/mso-api-handler-infra/src/main/java') diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstances.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstances.java index 1c2ee95dd9..2386848ad5 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstances.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstances.java @@ -227,6 +227,20 @@ public class E2EServiceInstances { return response; } + try { + msoRequest.createRequestRecord (Status.PENDING, action); + } catch (Exception e) { + msoLogger.error (MessageEnum.APIH_DB_ACCESS_EXC_REASON, "Exception while creating record in DB", "", "", MsoLogger.ErrorCode.SchemaError, "Exception while creating record in DB", e); + msoRequest.setStatus (org.openecomp.mso.apihandlerinfra.vnfbeans.RequestStatusType.FAILED); + Response response = msoRequest.buildServiceErrorResponse (HttpStatus.SC_INTERNAL_SERVER_ERROR, + MsoException.ServiceException, + "Exception while creating record in DB " + e.getMessage(), + ErrorNumbers.SVC_BAD_PARAMETER, + null); + msoLogger.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DBAccessError, "Exception while creating record in DB"); + msoLogger.debug ("End of the transaction, the final response is: " + (String) response.getEntity ()); + return response; + } String modelInfo = sir.getService().getParameters().getNodeTemplateName(); String[] arrayOfInfo = modelInfo.split(":"); -- cgit 1.2.3-korg