diff options
Diffstat (limited to 'adapters/mso-nssmf-adapter')
6 files changed, 29 insertions, 46 deletions
diff --git a/adapters/mso-nssmf-adapter/pom.xml b/adapters/mso-nssmf-adapter/pom.xml index 45fe77eecc..0099bb3091 100644 --- a/adapters/mso-nssmf-adapter/pom.xml +++ b/adapters/mso-nssmf-adapter/pom.xml @@ -107,17 +107,14 @@ <dependency> <groupId>org.apache.cxf</groupId> <artifactId>cxf-spring-boot-starter-jaxws</artifactId> - <version>${cxf.version}</version> </dependency> <dependency> <groupId>org.apache.cxf</groupId> <artifactId>cxf-spring-boot-starter-jaxrs</artifactId> - <version>${cxf.version}</version> </dependency> <dependency> <groupId>org.apache.cxf</groupId> <artifactId>cxf-rt-rs-service-description-swagger</artifactId> - <version>${cxf.version}</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> diff --git a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/config/WebSecurityConfig.java b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/config/WebSecurityConfig.java deleted file mode 100644 index dfb2b61978..0000000000 --- a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/config/WebSecurityConfig.java +++ /dev/null @@ -1,37 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2020 Huawei Technologies Co., Ltd. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.adapters.nssmf.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.security.config.annotation.web.builders.HttpSecurity; -import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; -import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; - -@EnableWebSecurity -@Configuration -public class WebSecurityConfig extends WebSecurityConfigurerAdapter { - - @Override - protected void configure(HttpSecurity http) throws Exception { - http.csrf().disable(); - } - -} 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; } |