diff options
Diffstat (limited to 'adapters/mso-nssmf-adapter')
4 files changed, 29 insertions, 6 deletions
diff --git a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/extclients/aai/AaiServiceProviderImpl.java b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/extclients/aai/AaiServiceProviderImpl.java index 442339d9fe..b972517338 100644 --- a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/extclients/aai/AaiServiceProviderImpl.java +++ b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/extclients/aai/AaiServiceProviderImpl.java @@ -59,8 +59,8 @@ public class AaiServiceProviderImpl implements AaiServiceProvider { public EsrSystemInfoList invokeGetThirdPartySdncEsrSystemInfo(String sdncId) { return aaiClientProvider.getAaiClient() .get(EsrSystemInfoList.class, - AAIUriFactory - .createResourceUri(AAIFluentTypeBuilder.externalSystem().esrThirdpartySdnc((sdncId)))) + AAIUriFactory.createResourceUri( + AAIFluentTypeBuilder.externalSystem().esrThirdpartySdnc((sdncId)).esrSystemInfoList())) .orElseGet(() -> { logger.debug("VNFM not found in AAI"); return null; 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 97a4c5e889..2ccd88a358 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 @@ -141,7 +141,9 @@ public abstract class BaseNssmfManager implements NssmfManager { public RestResponse queryJobStatus(NssmfAdapterNBIRequest jobReq, String jobId) throws ApplicationException { this.params.clear(); this.params.put("jobId", jobId); - this.params.put("responseId", jobReq.getResponseId()); + if (jobReq.getResponseId() != null) { + this.params.put("responseId", jobReq.getResponseId()); + } this.urlHandler(); /** 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 d8a9088a42..0d0d896370 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 @@ -127,8 +127,8 @@ public abstract class ExternalNssmfManager extends BaseNssmfManager { return restUtil.send(nssmfUrl, this.httpMethod, content, header); } - private void updateRequestDbJobStatus(ResponseDescriptor rspDesc, ResourceOperationStatus status, RestResponse rsp) - throws ApplicationException { + protected void updateRequestDbJobStatus(ResponseDescriptor rspDesc, ResourceOperationStatus status, + RestResponse rsp) throws ApplicationException { switch (fromString(rspDesc.getStatus())) { case STARTED: diff --git a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/external/ExternalAnNssmfManager.java b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/external/ExternalAnNssmfManager.java index bc7a3d0bb7..491da0aab4 100644 --- a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/external/ExternalAnNssmfManager.java +++ b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/external/ExternalAnNssmfManager.java @@ -30,6 +30,8 @@ import org.onap.so.adapters.nssmf.util.NssmfAdapterUtil; import org.onap.so.beans.nsmf.DeAllocateNssi; import org.onap.so.beans.nsmf.NssiResponse; import org.onap.so.beans.nsmf.NssmfAdapterNBIRequest; +import org.onap.so.beans.nsmf.ResponseDescriptor; +import org.onap.so.beans.nsmf.JobStatusResponse; import org.onap.so.db.request.beans.ResourceOperationStatus; import java.util.HashMap; import java.util.Map; @@ -72,7 +74,7 @@ public class ExternalAnNssmfManager extends ExternalNssmfManager { restResponse = returnRsp; ResourceOperationStatus status = - new ResourceOperationStatus(serviceInfo.getNsiId(), nssiId, serviceInfo.getServiceUuid()); + new ResourceOperationStatus(serviceInfo.getNsiId(), resp.getJobId(), serviceInfo.getServiceUuid()); status.setResourceInstanceID(nssiId); updateDbStatus(status, restResponse.getStatus(), JobStatus.FINISHED, @@ -111,6 +113,25 @@ public class ExternalAnNssmfManager extends ExternalNssmfManager { } @Override + protected RestResponse doQueryJobStatus(ResourceOperationStatus status) throws ApplicationException { + ResponseDescriptor responseDescriptor = new ResponseDescriptor(); + responseDescriptor.setStatus(JobStatus.FINISHED.toString()); + responseDescriptor.setProgress(100); + responseDescriptor.setStatusDescription("Finished"); + + JobStatusResponse jobStatusResponse = new JobStatusResponse(); + jobStatusResponse.setResponseDescriptor(responseDescriptor); + + RestResponse restResponse = new RestResponse(); + restResponse.setStatus(200); + restResponse.setResponseContent(marshal(jobStatusResponse)); + + updateRequestDbJobStatus(responseDescriptor, status, restResponse); + + return restResponse; + } + + @Override protected SelectionType doQueryNSSISelectionCapability() { return SelectionType.NSSMF; } |