From 75a86282d2ec71f53ca4e078762f0fae25dac8cd Mon Sep 17 00:00:00 2001 From: hetengjiao Date: Fri, 13 Nov 2020 15:18:59 +0800 Subject: fixed cs profile trans to ss profile Issue-ID: SO-2963 Signed-off-by: hetengjiao Change-Id: Ia5a40ac9126641479047a0a76c7d2fefc1d6f07d --- .../org/onap/so/adapters/nssmf/manager/NssmfManagerBuilder.java | 6 ++++++ .../org/onap/so/adapters/nssmf/manager/impl/BaseNssmfManager.java | 2 +- .../onap/so/adapters/nssmf/manager/impl/ExternalNssmfManager.java | 6 +++--- .../onap/so/adapters/nssmf/manager/impl/InternalNssmfManager.java | 2 +- .../test/java/org/onap/so/adapters/nssmf/NssmfAdapterRestTest.java | 4 ++-- 5 files changed, 13 insertions(+), 7 deletions(-) (limited to 'adapters') diff --git a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/NssmfManagerBuilder.java b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/NssmfManagerBuilder.java index 0b332af607..e397201e4b 100644 --- a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/NssmfManagerBuilder.java +++ b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/NssmfManagerBuilder.java @@ -77,6 +77,12 @@ public class NssmfManagerBuilder { return; } + if (ExecutorType.EXTERNAL.equals(executorType) && NetworkType.TRANSPORT.equals(networkType)) { + this.nssmfManger = new ExternalAnNssmfManager().setEsrInfo(esrInfo).setExecutorType(executorType) + .setInitStatus("activated"); + return; + } + if (ExecutorType.EXTERNAL.equals(executorType) && NetworkType.ACCESS.equals(networkType)) { this.nssmfManger = new ExternalAnNssmfManager().setEsrInfo(esrInfo).setExecutorType(executorType) .setInitStatus("activated"); 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 acaa3945bd..2de6e01693 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 @@ -193,7 +193,7 @@ public abstract class BaseNssmfManager implements NssmfManager { return doQuerySubnetCapability(nbiRequest.getSubnetCapabilityQuery()); } - protected abstract RestResponse doQuerySubnetCapability(QuerySubnetCapability req) throws ApplicationException; + protected abstract RestResponse doQuerySubnetCapability(QuerySubnetCapability req) throws ApplicationException; /** * send request to nssmf 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 9dcd2d4cfb..3c5be7eb39 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 @@ -180,11 +180,11 @@ public abstract class ExternalNssmfManager extends BaseNssmfManager { } @Override - protected RestResponse doQuerySubnetCapability(QuerySubnetCapability req) throws ApplicationException { + protected RestResponse doQuerySubnetCapability(QuerySubnetCapability req) throws ApplicationException { ObjectMapper oMapper = new ObjectMapper(); InputStream inputStream = TypeReference.class.getResourceAsStream("/subnetCapability.json"); - Map subnetCapability = new HashMap<>(); + Map subnetCapability = new HashMap<>(); try { subnetCapability = oMapper.readValue(inputStream, Map.class); } catch (Exception e) { @@ -201,7 +201,7 @@ public abstract class ExternalNssmfManager extends BaseNssmfManager { try { response = oMapper.writeValueAsString(responseMap); } catch (JsonProcessingException e) { - logger.debug("Exception while converting subnet capability object to String {}", e); + logger.debug("Exception while converting subnet capability object to String {}", e.getMessage()); } RestResponse rsp = new RestResponse(); 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 296c30c1d8..e89160c4ae 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 @@ -122,7 +122,7 @@ public abstract class InternalNssmfManager extends BaseNssmfManager { protected abstract String doWrapModifyReqBody(NssmfAdapterNBIRequest nbiRequest) throws ApplicationException; @Override - protected RestResponse doQuerySubnetCapability(QuerySubnetCapability req) throws ApplicationException { + protected RestResponse doQuerySubnetCapability(QuerySubnetCapability req) throws ApplicationException { // handler return sendRequest(marshal(req)); } diff --git a/adapters/mso-nssmf-adapter/src/test/java/org/onap/so/adapters/nssmf/NssmfAdapterRestTest.java b/adapters/mso-nssmf-adapter/src/test/java/org/onap/so/adapters/nssmf/NssmfAdapterRestTest.java index f150f47f4f..2d79544383 100644 --- a/adapters/mso-nssmf-adapter/src/test/java/org/onap/so/adapters/nssmf/NssmfAdapterRestTest.java +++ b/adapters/mso-nssmf-adapter/src/test/java/org/onap/so/adapters/nssmf/NssmfAdapterRestTest.java @@ -77,9 +77,9 @@ public class NssmfAdapterRestTest { private final static String ALLOCATE = "{\n" + " \"esrInfo\" : {\n" + " \"vendor\" : \"huawei\",\n" + " \"networkType\" : \"cn\"\n" + " },\n" + " \"allocateCnNssi\" : {\n" + " \"nssiId\" : \"NSST-C-001-HDBNJ-NSSMF-01-A-ZX\",\n" + " \"nssiName\" : \"eMBB-001\",\n" - + " \"sliceProfile\" : {\n" + " \"snssaiList\" : [ \"001-100001\" ],\n" + + " \"sliceProfile\" : {\n" + " \"sNSSAIList\" : [ \"001-100001\" ],\n" + " \"sliceProfileId\" : \"ab9af40f13f721b5f13539d87484098\",\n" - + " \"plmnIdList\" : [ \"460-00\", \"460-01\" ],\n" + " \"perfReq\" : {\n" + + " \"pLMNIdList\" : [ \"460-00\", \"460-01\" ],\n" + " \"perfReq\" : {\n" + " \"perfReqEmbbList\" : [ {\n" + " \"activityFactor\" : 50\n" + " } ]\n" + " },\n" + " \"maxNumberofUEs\" : 200,\n" + " \"coverageAreaTAList\" : [ \"1\", \"2\", \"3\" ],\n" + " \"latency\" : 6,\n" -- cgit 1.2.3-korg