From 88f7235a08466ca2700a0255fcb25fa875ccb982 Mon Sep 17 00:00:00 2001 From: hetengjiao Date: Thu, 26 Nov 2020 11:02:42 +0800 Subject: New attributes are added according to the standard and fixed TN allocate response Issue-ID: SO-2963 Signed-off-by: hetengjiao Change-Id: I4a2dfccbfa9dcdbe93d50a03b307061dca45c81a --- .../so/adapters/nssmf/manager/impl/BaseNssmfManager.java | 2 -- .../adapters/nssmf/manager/impl/ExternalNssmfManager.java | 2 ++ .../adapters/nssmf/manager/impl/InternalNssmfManager.java | 15 ++++++++------- 3 files changed, 10 insertions(+), 9 deletions(-) (limited to 'adapters/mso-nssmf-adapter/src/main/java') diff --git a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/BaseNssmfManager.java b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/BaseNssmfManager.java index fb880a91e3..0456c90fae 100644 --- a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/BaseNssmfManager.java +++ b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/BaseNssmfManager.java @@ -173,8 +173,6 @@ public abstract class BaseNssmfManager implements NssmfManager { logger.info("Query operations: nsiId = [{}], jobId = [{}], serviceUuid = [{}]", nsiId, jobId, serviceUuid); - ResourceOperationStatus status = new ResourceOperationStatus(nsiId, jobId, serviceUuid); - List resourceOperationStatuses = repository.findByServiceIdAndOperationId(nsiId, jobId); diff --git a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/ExternalNssmfManager.java b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/ExternalNssmfManager.java index 4b0e98e8ec..7ec6c0f9e1 100644 --- a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/ExternalNssmfManager.java +++ b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/ExternalNssmfManager.java @@ -235,6 +235,8 @@ public abstract class ExternalNssmfManager extends BaseNssmfManager { status.setOperType(actionType.toString()); status.setProgress("0"); + response.setStatus(STARTED.toString()); + restResponse.setResponseContent(marshal(response)); updateDbStatus(status, restResponse.getStatus(), STARTED, NssmfAdapterUtil.getStatusDesc(actionType)); } } diff --git a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/InternalNssmfManager.java b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/InternalNssmfManager.java index e89160c4ae..64ab199bc1 100644 --- a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/InternalNssmfManager.java +++ b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/InternalNssmfManager.java @@ -66,19 +66,20 @@ public abstract class InternalNssmfManager extends BaseNssmfManager { } private RestResponse responseDBStatus(ResourceOperationStatus status) throws ApplicationException { + JobStatusResponse statusResponse = new JobStatusResponse(); ResponseDescriptor descriptor = new ResponseDescriptor(); if (status == null) { descriptor.setProgress(0); descriptor.setStatus(PROCESSING.name()); descriptor.setStatusDescription("Initiating Nssi Instance"); - return restUtil.createResponse(200, marshal(descriptor)); + } else { + descriptor.setStatus(status.getStatus()); + descriptor.setStatusDescription(status.getStatusDescription()); + descriptor.setProgress(Integer.parseInt(status.getProgress())); + descriptor.setNssiId(status.getResourceInstanceID()); } - descriptor.setStatus(status.getStatus()); - descriptor.setStatusDescription(status.getStatusDescription()); - descriptor.setProgress(Integer.parseInt(status.getProgress())); - descriptor.setNssiId(status.getResourceInstanceID()); - // descriptor.setResponseId(status.getOperationId()); - return restUtil.createResponse(200, marshal(descriptor)); + statusResponse.setResponseDescriptor(descriptor); + return restUtil.createResponse(200, marshal(statusResponse)); } @Override -- cgit 1.2.3-korg