diff options
author | hekeguang <hekeguang@chinamobile.com> | 2021-03-24 09:27:25 +0800 |
---|---|---|
committer | hekeguang <hekeguang@chinamobile.com> | 2021-03-24 09:28:09 +0800 |
commit | ca6e5208bf4f30a3958a5a1fdd4dce0fefb00680 (patch) | |
tree | 410cef7cd6c3dd02377d1748e6e54906926d9f26 | |
parent | e0ccd896e0fc0c50b9790c4a4f027783730367bc (diff) |
Add connection info to business details.4.0.0
Issue-ID: USECASEUI-557
Change-Id: I82610cc42da10e7ef16804d876950aa8794116ad
Signed-off-by: hekeguang <hekeguang@chinamobile.com>
23 files changed, 546 insertions, 108 deletions
diff --git a/server/src/main/java/org/onap/usecaseui/server/bean/nsmf/resource/AnSliceTaskInfoToUI.java b/server/src/main/java/org/onap/usecaseui/server/bean/nsmf/resource/AnSliceTaskInfoToUI.java new file mode 100644 index 00000000..db38d1dc --- /dev/null +++ b/server/src/main/java/org/onap/usecaseui/server/bean/nsmf/resource/AnSliceTaskInfoToUI.java @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2021 CMCC, Inc. and others. 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. + */ + +package org.onap.usecaseui.server.bean.nsmf.resource; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@JsonIgnoreProperties(ignoreUnknown = true) +public class AnSliceTaskInfoToUI { + + @JsonProperty("ip_adrress") + private String ipAdrress; + + @JsonProperty("interface_id") + private String interfaceId; + + @JsonProperty("nextHop_info") + private String nextHopInfo; +} diff --git a/server/src/main/java/org/onap/usecaseui/server/bean/nsmf/resource/CnSliceTaskInfoToUI.java b/server/src/main/java/org/onap/usecaseui/server/bean/nsmf/resource/CnSliceTaskInfoToUI.java new file mode 100644 index 00000000..e4f09582 --- /dev/null +++ b/server/src/main/java/org/onap/usecaseui/server/bean/nsmf/resource/CnSliceTaskInfoToUI.java @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2021 CMCC, Inc. and others. 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. + */ +package org.onap.usecaseui.server.bean.nsmf.resource; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@JsonIgnoreProperties(ignoreUnknown = true) +public class CnSliceTaskInfoToUI { + + @JsonProperty("ip_adrress") + private String ipAdrress; + + @JsonProperty("interface_id") + private String interfaceId; + + @JsonProperty("nextHop_info") + private String nextHopInfo; +} diff --git a/server/src/main/java/org/onap/usecaseui/server/bean/nsmf/resource/ConnectionLinkInfo.java b/server/src/main/java/org/onap/usecaseui/server/bean/nsmf/resource/ConnectionLinkInfo.java new file mode 100644 index 00000000..c90b0c91 --- /dev/null +++ b/server/src/main/java/org/onap/usecaseui/server/bean/nsmf/resource/ConnectionLinkInfo.java @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2021 CMCC, Inc. and others. 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. + */ +package org.onap.usecaseui.server.bean.nsmf.resource; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@JsonIgnoreProperties(ignoreUnknown = true) +public class ConnectionLinkInfo { + @JsonProperty("an_slice_task_info") + private AnSliceTaskInfoToUI anSliceTaskInfoToUI; + @JsonProperty("cn_slice_task_info") + private CnSliceTaskInfoToUI cnSliceTaskInfoToUI; + @JsonProperty("tn_bh_slice_task_info") + private TnBHSliceTaskInfoToUI tnBHSliceTaskInfoToUI; + +} diff --git a/server/src/main/java/org/onap/usecaseui/server/bean/nsmf/resource/SlicingBusinessDetails.java b/server/src/main/java/org/onap/usecaseui/server/bean/nsmf/resource/SlicingBusinessDetails.java index d10c067a..72a3750b 100644 --- a/server/src/main/java/org/onap/usecaseui/server/bean/nsmf/resource/SlicingBusinessDetails.java +++ b/server/src/main/java/org/onap/usecaseui/server/bean/nsmf/resource/SlicingBusinessDetails.java @@ -20,7 +20,6 @@ import lombok.Getter; import lombok.Setter; import org.onap.usecaseui.server.bean.nsmf.task.BusinessDemandInfo; import org.onap.usecaseui.server.bean.nsmf.task.NstInfo; -import org.onap.usecaseui.server.service.slicingdomain.aai.bean.connectionvo.ConnectionLinkInfo; @Getter @Setter diff --git a/server/src/main/java/org/onap/usecaseui/server/bean/nsmf/resource/TnBHSliceTaskInfoToUI.java b/server/src/main/java/org/onap/usecaseui/server/bean/nsmf/resource/TnBHSliceTaskInfoToUI.java new file mode 100644 index 00000000..f895a00e --- /dev/null +++ b/server/src/main/java/org/onap/usecaseui/server/bean/nsmf/resource/TnBHSliceTaskInfoToUI.java @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2021 CMCC, Inc. and others. 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. + */ +package org.onap.usecaseui.server.bean.nsmf.resource; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@JsonIgnoreProperties(ignoreUnknown = true) +public class TnBHSliceTaskInfoToUI { + + @JsonProperty("lantency") + private String lantency; + + @JsonProperty("max_bandWidth") + private String maxBandWidth; +} diff --git a/server/src/main/java/org/onap/usecaseui/server/bean/nsmf/task/EndPointInfo.java b/server/src/main/java/org/onap/usecaseui/server/bean/nsmf/task/EndPointInfo.java new file mode 100644 index 00000000..dd4a6756 --- /dev/null +++ b/server/src/main/java/org/onap/usecaseui/server/bean/nsmf/task/EndPointInfo.java @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2021 CMCC, Inc. and others. 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. + */ +package org.onap.usecaseui.server.bean.nsmf.task; + +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +public class EndPointInfo { + + String ANEndPointId; + + String CNEndPointId; +} diff --git a/server/src/main/java/org/onap/usecaseui/server/service/nsmf/impl/ResourceMgtServiceImpl.java b/server/src/main/java/org/onap/usecaseui/server/service/nsmf/impl/ResourceMgtServiceImpl.java index 3d49a0f8..e71639ed 100644 --- a/server/src/main/java/org/onap/usecaseui/server/service/nsmf/impl/ResourceMgtServiceImpl.java +++ b/server/src/main/java/org/onap/usecaseui/server/service/nsmf/impl/ResourceMgtServiceImpl.java @@ -27,7 +27,11 @@ import org.apache.commons.beanutils.BeanUtils; import org.onap.usecaseui.server.bean.ServiceInstanceOperations; import org.onap.usecaseui.server.bean.nsmf.common.ResultHeader; import org.onap.usecaseui.server.bean.nsmf.common.ServiceResult; +import org.onap.usecaseui.server.bean.nsmf.resource.AnSliceTaskInfoToUI; +import org.onap.usecaseui.server.bean.nsmf.resource.CnSliceTaskInfoToUI; import org.onap.usecaseui.server.bean.nsmf.resource.HostedNsiList; +import org.onap.usecaseui.server.bean.nsmf.resource.TnBHSliceTaskInfoToUI; +import org.onap.usecaseui.server.service.slicingdomain.aai.bean.connection.NetworkInfo; import org.onap.usecaseui.server.bean.nsmf.resource.NsiDetailList; import org.onap.usecaseui.server.bean.nsmf.resource.NsiRelatedNssiInfo; import org.onap.usecaseui.server.bean.nsmf.resource.NsiServiceInstanceList; @@ -47,11 +51,12 @@ import org.onap.usecaseui.server.service.slicingdomain.aai.AAISliceService; import org.onap.usecaseui.server.service.slicingdomain.aai.bean.AAIServiceAndInstance; import org.onap.usecaseui.server.service.slicingdomain.aai.bean.AAIServiceInstance; import org.onap.usecaseui.server.service.slicingdomain.aai.bean.AAIServiceRsp; -import org.onap.usecaseui.server.service.slicingdomain.aai.bean.connection.ConnectionLink; import org.onap.usecaseui.server.service.slicingdomain.aai.bean.connection.EndPointInfoList; import org.onap.usecaseui.server.service.slicingdomain.aai.bean.connection.Relationship; import org.onap.usecaseui.server.service.slicingdomain.aai.bean.connection.RelationshipData; -import org.onap.usecaseui.server.service.slicingdomain.aai.bean.connectionvo.ConnectionLinkInfo; +import org.onap.usecaseui.server.bean.nsmf.resource.ConnectionLinkInfo; +import org.onap.usecaseui.server.service.slicingdomain.aai.bean.connection.SliceProfileInfo; +import org.onap.usecaseui.server.service.slicingdomain.aai.bean.connection.SliceProfileList; import org.onap.usecaseui.server.service.slicingdomain.so.SOSliceService; import org.onap.usecaseui.server.service.slicingdomain.so.bean.ActivateService; import org.onap.usecaseui.server.service.slicingdomain.so.bean.AnSliceTaskInfo; @@ -257,9 +262,9 @@ public class ResourceMgtServiceImpl implements ResourceMgtService { ResultHeader resultHeader = new ResultHeader(); AAIServiceAndInstance aaiServiceAndInstance = new AAIServiceAndInstance(); SlicingBusinessDetails slicingBusinessDetails = new SlicingBusinessDetails(); - CnSliceTaskInfo cnSliceTaskInfo = new CnSliceTaskInfo(); - TnBHSliceTaskInfo tnBHSliceTaskInfo = new TnBHSliceTaskInfo(); - AnSliceTaskInfo anSliceTaskInfo = new AnSliceTaskInfo(); + CnSliceTaskInfoToUI cnSliceTaskInfo = new CnSliceTaskInfoToUI(); + TnBHSliceTaskInfoToUI tnBHSliceTaskInfo = new TnBHSliceTaskInfoToUI(); + AnSliceTaskInfoToUI anSliceTaskInfo = new AnSliceTaskInfoToUI(); ConnectionLinkInfo connectionLinkInfo = new ConnectionLinkInfo(); String resultMsg; @@ -283,12 +288,12 @@ public class ResourceMgtServiceImpl implements ResourceMgtService { resultMsg = "5G slicing business details query failed!"; resultHeader.setResult_code(NsmfCodeConstant.ERROR_CODE_UNKNOWN); } - Response<ConnectionLink> connectionLinkResponse = this.aaiSliceService - .getServiceInstance(businessId).execute(); - if (connectionLinkResponse.isSuccessful()) { - ConnectionLink connectionLink = connectionLinkResponse.body(); - logger.info("ConnectionLink", connectionLink); - List<Relationship> relationship = connectionLink.getRelationshipList().getRelationship(); + Response<NetworkInfo> networkInfoResponse = this.aaiSliceService + .getServiceNetworkInstance(businessId).execute(); + if (networkInfoResponse.isSuccessful()) { + NetworkInfo networkInfo = networkInfoResponse.body(); + logger.info("networkInfo: {}", networkInfo); + List<Relationship> relationship = networkInfo.getRelationshipList().getRelationship(); List<Relationship> embbCnExternal = relationship.stream().filter(e -> e.getRelatedToProperties() .get(0).getPropertyValue().equals("EmbbCn_External")).collect(Collectors.toList()); List<Relationship> TnONAPInternalBH = relationship.stream().filter(e -> e.getRelatedToProperties() @@ -300,10 +305,10 @@ public class ResourceMgtServiceImpl implements ResourceMgtService { List<RelationshipData> relationshipDataCn = embbCnExternal.get(0).getRelationshipDataList(); List<RelationshipData> cn = relationshipDataCn.stream().filter(e -> e.getRelationshipKey() .equals("service-instance.service-instance-id")).collect(Collectors.toList()); - Response<ConnectionLink> executeCn = this.aaiSliceService.getServiceInstance(cn.get(0) + Response<NetworkInfo> executeCn = this.aaiSliceService.getServiceNetworkInstance(cn.get(0) .getRelationshipValue()).execute(); if (executeCn.isSuccessful()) { - ConnectionLink body = executeCn.body(); + NetworkInfo body = executeCn.body(); List<Relationship> relationshipCn = body.getRelationshipList().getRelationship(); List<Relationship> networkRouteCn = relationshipCn.stream().filter(e -> e.getRelatedTo() .equals("network-route")).collect(Collectors.toList()); @@ -313,15 +318,17 @@ public class ResourceMgtServiceImpl implements ResourceMgtService { .getEndpointByLinkName(networkRouteCnId).execute(); if (endPointInfoListCn.isSuccessful()) { EndPointInfoList endPointInfoList = endPointInfoListCn.body(); - BeanUtils.copyProperties(cnSliceTaskInfo, endPointInfoList); + cnSliceTaskInfo.setInterfaceId(endPointInfoList.getLogicId()); + cnSliceTaskInfo.setIpAdrress(endPointInfoList.getIpAddress()); + cnSliceTaskInfo.setNextHopInfo(endPointInfoList.getNextHop()); } else { - logger.error(String.format("Can not get SOOperation[code={}, message={}]", response.code(), + logger.error(String.format("Can not get getEndpointByLinkName[code={}, message={}]", response.code(), response.message())); resultMsg = "5G slicing service operation progress query failed!"; resultHeader.setResult_code(NsmfCodeConstant.ERROR_CODE_UNKNOWN); } } else { - logger.error(String.format("Can not get SOOperation[code={}, message={}]", response.code(), + logger.error(String.format("Can not get getServiceNetworkInstance[code={}, message={}]", response.code(), response.message())); resultMsg = "5G slicing service operation progress query failed!"; resultHeader.setResult_code(NsmfCodeConstant.ERROR_CODE_UNKNOWN); @@ -332,29 +339,15 @@ public class ResourceMgtServiceImpl implements ResourceMgtService { List<RelationshipData> relationshipDataTn = TnONAPInternalBH.get(0).getRelationshipDataList(); List<RelationshipData> tn = relationshipDataTn.stream().filter(e -> e.getRelationshipKey() .equals("service-instance.service-instance-id")).collect(Collectors.toList()); - Response<ConnectionLink> executeTn = this.aaiSliceService - .getServiceInstance(tn.get(0).getRelationshipValue()).execute(); + Response<SliceProfileList> executeTn = this.aaiSliceService + .getSliceProfiles(tn.get(0).getRelationshipValue()).execute(); if (executeTn.isSuccessful()) { - ConnectionLink body = executeTn.body(); - List<Relationship> relationshipTn = body.getRelationshipList().getRelationship(); - List<Relationship> networkRouteTn = relationshipTn.stream().filter(e -> e.getRelatedTo() - .equals("network-route")).collect(Collectors.toList()); - List<RelationshipData> relationshipDataListTn = networkRouteTn.get(0).getRelationshipDataList(); - String networkRouteTnId = relationshipDataListTn.get(0).getRelationshipValue(); - Response<EndPointInfoList> endPointInfoListTn = this.aaiSliceService - .getEndpointByLinkName(networkRouteTnId).execute(); - if (endPointInfoListTn.isSuccessful()) { - EndPointInfoList endPointInfoList = endPointInfoListTn.body(); - BeanUtils.copyProperties(tnBHSliceTaskInfo, endPointInfoList); - - } else { - logger.error(String.format("Can not get SOOperation[code={}, message={}]", response.code(), - response.message())); - resultMsg = "5G slicing service operation progress query failed!"; - resultHeader.setResult_code(NsmfCodeConstant.ERROR_CODE_UNKNOWN); - } + SliceProfileList body = executeTn.body(); + SliceProfileInfo sliceProfileInfo = body.getSliceProfileInfoList().get(0); + tnBHSliceTaskInfo.setLantency(sliceProfileInfo.getLatency()); + tnBHSliceTaskInfo.setMaxBandWidth(sliceProfileInfo.getMaxBandwidth()); } else { - logger.error(String.format("Can not get SOOperation[code={}, message={}]", response.code(), + logger.error(String.format("Can not getSliceProfiles [code={}, message={}]", response.code(), response.message())); resultMsg = "5G slicing service operation progress query failed!"; resultHeader.setResult_code(NsmfCodeConstant.ERROR_CODE_UNKNOWN); @@ -365,10 +358,10 @@ public class ResourceMgtServiceImpl implements ResourceMgtService { List<RelationshipData> relationshipDataAn = EmbbAnNF.get(0).getRelationshipDataList(); List<RelationshipData> an = relationshipDataAn.stream().filter(e -> e.getRelationshipKey() .equals("service-instance.service-instance-id")).collect(Collectors.toList()); - Response<ConnectionLink> executeAn = this.aaiSliceService - .getServiceInstance(an.get(0).getRelationshipValue()).execute(); + Response<NetworkInfo> executeAn = this.aaiSliceService + .getServiceNetworkInstance(an.get(0).getRelationshipValue()).execute(); if (executeAn.isSuccessful()) { - ConnectionLink body = executeAn.body(); + NetworkInfo body = executeAn.body(); List<Relationship> relationshipAn = body.getRelationshipList().getRelationship(); List<Relationship> networkRouteAn = relationshipAn.stream().filter(e -> e.getRelatedTo() .equals("network-route")).collect(Collectors.toList()); @@ -378,15 +371,17 @@ public class ResourceMgtServiceImpl implements ResourceMgtService { .getEndpointByLinkName(networkRouteAnId).execute(); if (endPointInfoListAn.isSuccessful()) { EndPointInfoList endPointInfoList = endPointInfoListAn.body(); - BeanUtils.copyProperties(anSliceTaskInfo, endPointInfoList); + anSliceTaskInfo.setInterfaceId(endPointInfoList.getLogicId()); + anSliceTaskInfo.setIpAdrress(endPointInfoList.getIpAddress()); + anSliceTaskInfo.setNextHopInfo(endPointInfoList.getNextHop()); } else { - logger.error(String.format("Can not get SOOperation[code={}, message={}]", response.code(), + logger.error(String.format("Can not get getEndpointByLinkName[code={}, message={}]", response.code(), response.message())); resultMsg = "5G slicing service operation progress query failed!"; resultHeader.setResult_code(NsmfCodeConstant.ERROR_CODE_UNKNOWN); } } else { - logger.error(String.format("Can not get SOOperation[code={}, message={}]", response.code(), + logger.error(String.format("Can not get getEndpointByLinkName[code={}, message={}]", response.code(), response.message())); resultMsg = "5G slicing service operation progress query failed!"; resultHeader.setResult_code(NsmfCodeConstant.ERROR_CODE_UNKNOWN); @@ -403,9 +398,9 @@ public class ResourceMgtServiceImpl implements ResourceMgtService { resultHeader.setResult_code(NsmfCodeConstant.ERROR_CODE_UNKNOWN); logger.error("Exception in querySlicingBusinessDetails response",e); } - connectionLinkInfo.setCnSliceTaskInfo(cnSliceTaskInfo); - connectionLinkInfo.setTnBHSliceTaskInfo(tnBHSliceTaskInfo); - connectionLinkInfo.setAnSliceTaskInfo(anSliceTaskInfo); + connectionLinkInfo.setCnSliceTaskInfoToUI(cnSliceTaskInfo); + connectionLinkInfo.setTnBHSliceTaskInfoToUI(tnBHSliceTaskInfo); + connectionLinkInfo.setAnSliceTaskInfoToUI(anSliceTaskInfo); slicingBusinessDetails.setConnectionLinkInfo(connectionLinkInfo); logger.info(resultMsg); diff --git a/server/src/main/java/org/onap/usecaseui/server/service/nsmf/impl/TaskMgtServiceConvert.java b/server/src/main/java/org/onap/usecaseui/server/service/nsmf/impl/TaskMgtServiceConvert.java index 3383fefa..36df6d3a 100644 --- a/server/src/main/java/org/onap/usecaseui/server/service/nsmf/impl/TaskMgtServiceConvert.java +++ b/server/src/main/java/org/onap/usecaseui/server/service/nsmf/impl/TaskMgtServiceConvert.java @@ -17,10 +17,14 @@ package org.onap.usecaseui.server.service.nsmf.impl; import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; +import java.util.stream.Collectors; import lombok.Setter; import org.apache.commons.beanutils.BeanUtils; import org.onap.usecaseui.server.bean.nsmf.common.PagedResult; +import org.onap.usecaseui.server.bean.nsmf.common.ResultHeader; +import org.onap.usecaseui.server.bean.nsmf.common.ServiceResult; import org.onap.usecaseui.server.bean.nsmf.task.BusinessDemandInfo; +import org.onap.usecaseui.server.bean.nsmf.task.EndPointInfo; import org.onap.usecaseui.server.bean.nsmf.task.NsiAndSubNssiInfo; import org.onap.usecaseui.server.bean.nsmf.task.NstInfo; import org.onap.usecaseui.server.bean.nsmf.task.SlicingTaskAuditInfo; @@ -28,7 +32,18 @@ import org.onap.usecaseui.server.bean.nsmf.task.SlicingTaskCreationInfo; import org.onap.usecaseui.server.bean.nsmf.task.SlicingTaskCreationProgress; import org.onap.usecaseui.server.bean.nsmf.task.SlicingTaskInfo; import org.onap.usecaseui.server.bean.nsmf.task.SlicingTaskList; +import org.onap.usecaseui.server.constant.nsmf.NsmfCodeConstant; import org.onap.usecaseui.server.service.slicingdomain.aai.AAISliceService; +import org.onap.usecaseui.server.service.slicingdomain.aai.bean.connection.ConnectionLink; +import org.onap.usecaseui.server.service.slicingdomain.aai.bean.connection.ConnectionLinkList; +import org.onap.usecaseui.server.service.slicingdomain.aai.bean.connection.EndPointInfoList; +import org.onap.usecaseui.server.service.slicingdomain.aai.bean.connection.NetworkPolicy; +import org.onap.usecaseui.server.service.slicingdomain.aai.bean.connection.Relationship; +import org.onap.usecaseui.server.service.slicingdomain.aai.bean.connection.RelationshipData; +import org.onap.usecaseui.server.service.slicingdomain.aai.bean.connectionvo.ConnectionListVo; +import org.onap.usecaseui.server.service.slicingdomain.aai.bean.connectionvo.ConnectionVo; +import org.onap.usecaseui.server.service.slicingdomain.aai.bean.connectionvo.EndPointInfoListVo; +import org.onap.usecaseui.server.service.slicingdomain.aai.bean.connectionvo.PropertiesVo; import org.onap.usecaseui.server.service.slicingdomain.so.bean.AnSliceTaskInfo; import org.onap.usecaseui.server.service.slicingdomain.so.bean.CnSliceTaskInfo; import org.onap.usecaseui.server.service.slicingdomain.so.bean.SOTask; @@ -49,6 +64,8 @@ import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.List; +import retrofit2.Response; + @Service("TaskMgtConvertService") @org.springframework.context.annotation.Configuration @EnableAspectJAutoProxy @@ -85,7 +102,8 @@ public class TaskMgtServiceConvert { String params = soTask.getParams(); Gson gson = new Gson(); Type type = new TypeToken<SliceTaskParams>() {}.getType(); - SliceTaskParams sliceTaskParams = gson.fromJson(params, type); slicingTaskInfo.setServiceSnssai(sliceTaskParams.getServiceProfile().getSNSSAI()); + SliceTaskParams sliceTaskParams = gson.fromJson(params, type); + slicingTaskInfo.setServiceSnssai(sliceTaskParams.getServiceProfile().getSNSSAI()); slicingTaskInfo.setServiceType(sliceTaskParams.getServiceProfile().getSST()); slicingTaskInfo.setName(sliceTaskParams.getServiceName()); slicingTaskInfo.setCreateTime(soTask.getCreatedTime()); @@ -164,7 +182,7 @@ public class TaskMgtServiceConvert { void convertNsiAndSubNssiInfo(NsiAndSubNssiInfo nsiAndSubNssiInfo, SliceTaskParams sliceTaskParams) { nsiAndSubNssiInfo.setSuggestNsiId(sliceTaskParams.getSuggestNsiId()); - nsiAndSubNssiInfo.setSuggestNsiName(sliceTaskParams.getSuggestNSIName()); + nsiAndSubNssiInfo.setSuggestNsiName(sliceTaskParams.getSuggestNsiName()); nsiAndSubNssiInfo.setAnScriptName(sliceTaskParams.getAnSliceTaskInfo().getScriptName()); nsiAndSubNssiInfo.setAnEnableNSSISelection(sliceTaskParams.getAnSliceTaskInfo().getEnableNSSISelection()); if(!ObjectUtils.isEmpty(sliceTaskParams.getAnSliceTaskInfo().getSliceProfile())){ @@ -177,10 +195,10 @@ public class TaskMgtServiceConvert { nsiAndSubNssiInfo.setAnCoverageAreaTaList(areaTaList); nsiAndSubNssiInfo.setAnLatency(sliceTaskParams.getAnSliceTaskInfo().getSliceProfile().getLatency()); - nsiAndSubNssiInfo.setSliceProfile_AN_sNSSAI(sliceTaskParams.getAnSliceTaskInfo().getSliceProfile().getSNSSAIList()); - nsiAndSubNssiInfo.setSliceProfile_AN_maxNumberofUEs(sliceTaskParams.getAnSliceTaskInfo().getSliceProfile().getMaxNumberOfUEs()); + nsiAndSubNssiInfo.setSliceProfile_AN_sNSSAI(sliceTaskParams.getAnSliceTaskInfo().getSliceProfile().getSNSSAI()); + nsiAndSubNssiInfo.setSliceProfile_AN_maxNumberofUEs(sliceTaskParams.getAnSliceTaskInfo().getSliceProfile().getMaxNumberofUEs()); - nsiAndSubNssiInfo.setSliceProfile_AN_maxNumberofPDUSession(sliceTaskParams.getAnSliceTaskInfo().getSliceProfile().getMaxNumberOfPDUSession()); + nsiAndSubNssiInfo.setSliceProfile_AN_maxNumberofPDUSession(sliceTaskParams.getAnSliceTaskInfo().getSliceProfile().getMaxNumberofPDUSession()); nsiAndSubNssiInfo.setSliceProfile_AN_expDataRateDL(sliceTaskParams.getAnSliceTaskInfo().getSliceProfile().getExpDataRateDL()); nsiAndSubNssiInfo.setSliceProfile_AN_expDataRateUL(sliceTaskParams.getAnSliceTaskInfo().getSliceProfile().getExpDataRateUL()); nsiAndSubNssiInfo.setSliceProfile_AN_areaTrafficCapDL(sliceTaskParams.getAnSliceTaskInfo().getSliceProfile().getAreaTrafficCapDL()); @@ -188,12 +206,12 @@ public class TaskMgtServiceConvert { nsiAndSubNssiInfo.setSliceProfile_AN_overallUserDensity(sliceTaskParams.getAnSliceTaskInfo().getSliceProfile().getOverallUserDensity()); nsiAndSubNssiInfo.setSliceProfile_AN_activityFactor(sliceTaskParams.getAnSliceTaskInfo().getSliceProfile().getActivityFactor()); - nsiAndSubNssiInfo.setSliceProfile_AN_uEMobilityLevel(sliceTaskParams.getAnSliceTaskInfo().getSliceProfile().getUeMobilityLevel()); + nsiAndSubNssiInfo.setSliceProfile_AN_uEMobilityLevel(sliceTaskParams.getAnSliceTaskInfo().getSliceProfile().getUEMobilityLevel()); nsiAndSubNssiInfo.setSliceProfile_AN_resourceSharingLevel(sliceTaskParams.getAnSliceTaskInfo().getSliceProfile().getResourceSharingLevel()); nsiAndSubNssiInfo.setSliceProfile_AN_sST(sliceTaskParams.getAnSliceTaskInfo().getSliceProfile().getSST()); nsiAndSubNssiInfo.setSliceProfile_AN_cSAvailabilityTarget(sliceTaskParams.getAnSliceTaskInfo().getSliceProfile().getCsAvailabilityTarget()); - nsiAndSubNssiInfo.setSliceProfile_AN_cSReliabilityMeanTime(sliceTaskParams.getAnSliceTaskInfo().getSliceProfile().getCsReliabilityMeanTime()); + nsiAndSubNssiInfo.setSliceProfile_AN_cSReliabilityMeanTime(sliceTaskParams.getAnSliceTaskInfo().getSliceProfile().getCSReliabilityMeanTime()); nsiAndSubNssiInfo.setSliceProfile_AN_expDataRate(sliceTaskParams.getAnSliceTaskInfo().getSliceProfile().getExpDataRate()); nsiAndSubNssiInfo.setSliceProfile_AN_msgSizeByte(sliceTaskParams.getAnSliceTaskInfo().getSliceProfile().getMsgSizeByte()); nsiAndSubNssiInfo.setSliceProfile_AN_transferIntervalTarget(sliceTaskParams.getAnSliceTaskInfo().getSliceProfile().getTransferIntervalTarget()); @@ -203,7 +221,7 @@ public class TaskMgtServiceConvert { nsiAndSubNssiInfo.setSliceProfile_AN_nextHopInfo(sliceTaskParams.getAnSliceTaskInfo().getSliceProfile().getNextHopInfo()); } nsiAndSubNssiInfo.setTnBhSuggestNssiId(sliceTaskParams.getTnBHSliceTaskInfo().getSuggestNssiId()); - nsiAndSubNssiInfo.setTnBhSuggestNssiName(sliceTaskParams.getTnBHSliceTaskInfo().getSuggestNSSIName()); + nsiAndSubNssiInfo.setTnBhSuggestNssiName(sliceTaskParams.getTnBHSliceTaskInfo().getSuggestNssiName()); nsiAndSubNssiInfo.setTnBhScriptName(sliceTaskParams.getTnBHSliceTaskInfo().getScriptName()); nsiAndSubNssiInfo.setTnEnableNSSISelection(sliceTaskParams.getTnBHSliceTaskInfo().getEnableNSSISelection()); if(!ObjectUtils.isEmpty(sliceTaskParams.getTnBHSliceTaskInfo().getSliceProfile())){ @@ -212,7 +230,7 @@ public class TaskMgtServiceConvert { nsiAndSubNssiInfo.setSliceProfile_TN_BH_jitte(sliceTaskParams.getTnBHSliceTaskInfo().getSliceProfile().getJitter()); nsiAndSubNssiInfo.setSliceProfile_TN_BH_pLMNIdList(sliceTaskParams.getTnBHSliceTaskInfo().getSliceProfile().getPLMNIdList()); - nsiAndSubNssiInfo.setSliceProfile_TN_BH_sNSSAI(sliceTaskParams.getTnBHSliceTaskInfo().getSliceProfile().getSNSSAIList()); + nsiAndSubNssiInfo.setSliceProfile_TN_BH_sNSSAI(sliceTaskParams.getTnBHSliceTaskInfo().getSliceProfile().getSNSSAI()); nsiAndSubNssiInfo.setSliceProfile_TN_BH_sST(sliceTaskParams.getTnBHSliceTaskInfo().getSliceProfile().getSST()); nsiAndSubNssiInfo.setSliceProfile_TN_BH_connectionLinkId(sliceTaskParams.getTnBHSliceTaskInfo().getSliceProfile().getConnectionLinkId()); nsiAndSubNssiInfo.setSliceProfile_TN_BH_resourceSharingLevel(sliceTaskParams.getTnBHSliceTaskInfo().getSliceProfile().getResourceSharingLevel()); @@ -220,25 +238,25 @@ public class TaskMgtServiceConvert { nsiAndSubNssiInfo.setCnScriptName(sliceTaskParams.getCnSliceTaskInfo().getScriptName()); nsiAndSubNssiInfo.setCnEnableNSSISelection(sliceTaskParams.getCnSliceTaskInfo().getEnableNSSISelection()); nsiAndSubNssiInfo.setCnSuggestNssiId(sliceTaskParams.getCnSliceTaskInfo().getSuggestNssiId()); - nsiAndSubNssiInfo.setCnSuggestNssiName(sliceTaskParams.getCnSliceTaskInfo().getSuggestNSSIName()); + nsiAndSubNssiInfo.setCnSuggestNssiName(sliceTaskParams.getCnSliceTaskInfo().getSuggestNssiName()); if(!ObjectUtils.isEmpty(sliceTaskParams.getCnSliceTaskInfo().getSliceProfile())){ - nsiAndSubNssiInfo.setCnServiceSnssai(sliceTaskParams.getCnSliceTaskInfo().getSliceProfile().getSNSSAIList()); + nsiAndSubNssiInfo.setCnServiceSnssai(sliceTaskParams.getCnSliceTaskInfo().getSliceProfile().getSNSSAI()); nsiAndSubNssiInfo.setCnResourceSharingLevel(sliceTaskParams.getCnSliceTaskInfo().getSliceProfile().getResourceSharingLevel()); - nsiAndSubNssiInfo.setCnUeMobilityLevel(sliceTaskParams.getCnSliceTaskInfo().getSliceProfile().getUeMobilityLevel()); + nsiAndSubNssiInfo.setCnUeMobilityLevel(sliceTaskParams.getCnSliceTaskInfo().getSliceProfile().getUEMobilityLevel()); nsiAndSubNssiInfo.setCnLatency(sliceTaskParams.getCnSliceTaskInfo().getSliceProfile().getLatency()); - nsiAndSubNssiInfo.setCnMaxNumberOfUes(sliceTaskParams.getCnSliceTaskInfo().getSliceProfile().getMaxNumberOfUEs()); + nsiAndSubNssiInfo.setCnMaxNumberOfUes(sliceTaskParams.getCnSliceTaskInfo().getSliceProfile().getMaxNumberofUEs()); nsiAndSubNssiInfo.setCnActivityFactor(sliceTaskParams.getCnSliceTaskInfo().getSliceProfile().getActivityFactor()); nsiAndSubNssiInfo.setCnExpDataRateDl(sliceTaskParams.getCnSliceTaskInfo().getSliceProfile().getExpDataRateDL()); nsiAndSubNssiInfo.setCnExpDataRateUl(sliceTaskParams.getCnSliceTaskInfo().getSliceProfile().getExpDataRateUL()); nsiAndSubNssiInfo.setCnAreaTrafficCapDl(sliceTaskParams.getCnSliceTaskInfo().getSliceProfile().getAreaTrafficCapDL()); nsiAndSubNssiInfo.setCnAreaTrafficCapUl(sliceTaskParams.getCnSliceTaskInfo().getSliceProfile().getAreaTrafficCapUL()); - nsiAndSubNssiInfo.setSliceProfile_CN_maxNumberofPDUSession(sliceTaskParams.getCnSliceTaskInfo().getSliceProfile().getMaxNumberOfPDUSession()); + nsiAndSubNssiInfo.setSliceProfile_CN_maxNumberofPDUSession(sliceTaskParams.getCnSliceTaskInfo().getSliceProfile().getMaxNumberofPDUSession()); nsiAndSubNssiInfo.setSliceProfile_CN_overallUserDensity(sliceTaskParams.getCnSliceTaskInfo().getSliceProfile().getOverallUserDensity()); nsiAndSubNssiInfo.setSliceProfile_CN_coverageAreaTAList(sliceTaskParams.getCnSliceTaskInfo().getSliceProfile().getCoverageAreaTAList()); nsiAndSubNssiInfo.setSliceProfile_CN_sST(sliceTaskParams.getCnSliceTaskInfo().getSliceProfile().getSST()); nsiAndSubNssiInfo.setSliceProfile_CN_cSAvailabilityTarget(sliceTaskParams.getCnSliceTaskInfo().getSliceProfile().getCsAvailabilityTarget()); - nsiAndSubNssiInfo.setSliceProfile_CN_cSReliabilityMeanTime(sliceTaskParams.getCnSliceTaskInfo().getSliceProfile().getCsReliabilityMeanTime()); + nsiAndSubNssiInfo.setSliceProfile_CN_cSReliabilityMeanTime(sliceTaskParams.getCnSliceTaskInfo().getSliceProfile().getCSReliabilityMeanTime()); nsiAndSubNssiInfo.setSliceProfile_CN_expDataRate(sliceTaskParams.getCnSliceTaskInfo().getSliceProfile().getExpDataRate()); nsiAndSubNssiInfo.setSliceProfile_CN_msgSizeByte(sliceTaskParams.getCnSliceTaskInfo().getSliceProfile().getMsgSizeByte()); nsiAndSubNssiInfo.setSliceProfile_CN_transferIntervalTarget(sliceTaskParams.getCnSliceTaskInfo().getSliceProfile().getTransferIntervalTarget()); @@ -247,8 +265,6 @@ public class TaskMgtServiceConvert { nsiAndSubNssiInfo.setSliceProfile_CN_logicInterfaceId(sliceTaskParams.getCnSliceTaskInfo().getSliceProfile().getLogicInterfaceId()); nsiAndSubNssiInfo.setSliceProfile_CN_nextHopInfo(sliceTaskParams.getCnSliceTaskInfo().getSliceProfile().getNextHopInfo()); } - - } void convertTaskAuditToSoTask(SOTask targetSoTaskInfo, SlicingTaskAuditInfo sourceSlicingTaskAuditInfo) { @@ -256,13 +272,30 @@ public class TaskMgtServiceConvert { logger.error("convertTaskAuditToSoTask: sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo() is null"); return; } - SliceTaskParams sliceTaskParams = new SliceTaskParams(); + + String params = targetSoTaskInfo.getParams(); + Gson gson = new Gson(); + Type type = new TypeToken<SliceTaskParams>() {}.getType(); + SliceTaskParams sliceTaskParams = gson.fromJson(params, type); + if (sliceTaskParams == null) { + logger.error("convertTaskAuditToSoTask: sliceTaskParams is null"); + return; + } + sliceTaskParams.setSuggestNsiId(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getSuggestNsiId()); - sliceTaskParams.setSuggestNSIName(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getSuggestNsiName()); - AnSliceTaskInfo anSliceTaskInfo = new AnSliceTaskInfo(); + sliceTaskParams.setSuggestNsiName(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getSuggestNsiName()); + + AnSliceTaskInfo anSliceTaskInfo = sliceTaskParams.getAnSliceTaskInfo(); + CnSliceTaskInfo cnSliceTaskInfo = sliceTaskParams.getCnSliceTaskInfo(); + if (sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getSliceProfile_TN_BH_connectionLinkId() != null){ + EndPointInfo endPointInfo = queryEndPointId(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getSliceProfile_TN_BH_connectionLinkId()); + anSliceTaskInfo.setEndPointId(endPointInfo.getANEndPointId()); + cnSliceTaskInfo.setEndPointId(endPointInfo.getCNEndPointId()); + } + anSliceTaskInfo.setSuggestNssiId(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getAnSuggestNssiId()); anSliceTaskInfo.setSuggestNSSIName(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getAnSuggestNssiName()); - SliceProfile sliceProfile = new SliceProfile(); + SliceProfile sliceProfile = anSliceTaskInfo.getSliceProfile(); sliceProfile.setLatency(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getAnLatency()); sliceProfile.setAn5qi(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getAn5qi()); String aNCoverageAreaTAList = getAreaTaListString @@ -270,20 +303,20 @@ public class TaskMgtServiceConvert { sliceProfile.setCoverageAreaTAList(aNCoverageAreaTAList); anSliceTaskInfo.setScriptName(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getAnScriptName()); anSliceTaskInfo.setEnableNSSISelection(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getAnEnableNSSISelection()); - sliceProfile.setSNSSAIList(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getSliceProfile_AN_sNSSAI()); - sliceProfile.setMaxNumberOfUEs(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getSliceProfile_AN_maxNumberofUEs()); - sliceProfile.setMaxNumberOfPDUSession(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getSliceProfile_AN_maxNumberofPDUSession()); + sliceProfile.setSNSSAI(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getSliceProfile_AN_sNSSAI()); + sliceProfile.setMaxNumberofUEs(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getSliceProfile_AN_maxNumberofUEs()); + sliceProfile.setMaxNumberofPDUSession(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getSliceProfile_AN_maxNumberofPDUSession()); sliceProfile.setExpDataRateDL(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getSliceProfile_AN_expDataRateDL()); sliceProfile.setExpDataRateUL(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getSliceProfile_AN_expDataRateUL()); sliceProfile.setAreaTrafficCapDL(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getSliceProfile_AN_areaTrafficCapDL()); sliceProfile.setExpDataRateUL(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getSliceProfile_AN_areaTrafficCapUL()); sliceProfile.setOverallUserDensity(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getSliceProfile_AN_overallUserDensity()); sliceProfile.setActivityFactor(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getSliceProfile_AN_activityFactor()); - sliceProfile.setUeMobilityLevel(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getSliceProfile_AN_uEMobilityLevel()); + sliceProfile.setUEMobilityLevel(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getSliceProfile_AN_uEMobilityLevel()); sliceProfile.setResourceSharingLevel(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getSliceProfile_AN_resourceSharingLevel()); sliceProfile.setSST(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getSliceProfile_AN_sST()); sliceProfile.setCsAvailabilityTarget(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getSliceProfile_AN_cSAvailabilityTarget()); - sliceProfile.setCsReliabilityMeanTime(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getSliceProfile_AN_cSReliabilityMeanTime()); + sliceProfile.setCSReliabilityMeanTime(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getSliceProfile_AN_cSReliabilityMeanTime()); sliceProfile.setExpDataRate(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getSliceProfile_AN_expDataRate()); sliceProfile.setMsgSizeByte(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getSliceProfile_AN_msgSizeByte()); sliceProfile.setTransferIntervalTarget(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getSliceProfile_AN_transferIntervalTarget()); @@ -294,32 +327,31 @@ public class TaskMgtServiceConvert { anSliceTaskInfo.setSliceProfile(sliceProfile); sliceTaskParams.setAnSliceTaskInfo(anSliceTaskInfo); - TnBHSliceTaskInfo tnBHSliceTaskInfo = new TnBHSliceTaskInfo(); - SliceProfile tnSliceProfile = new SliceProfile(); + TnBHSliceTaskInfo tnBHSliceTaskInfo = sliceTaskParams.getTnBHSliceTaskInfo(); + SliceProfile tnSliceProfile = tnBHSliceTaskInfo.getSliceProfile(); tnBHSliceTaskInfo.setSuggestNssiId(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getTnBhSuggestNssiId()); - tnBHSliceTaskInfo.setSuggestNSSIName(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getTnBhSuggestNssiName()); + tnBHSliceTaskInfo.setSuggestNssiName(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getTnBhSuggestNssiName()); tnSliceProfile.setMaxBandwidth(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getTnBhBandwidth()); tnSliceProfile.setLatency(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getTnBhLatency()); tnBHSliceTaskInfo.setScriptName(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getTnBhScriptName()); tnBHSliceTaskInfo.setEnableNSSISelection(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getTnEnableNSSISelection()); tnSliceProfile.setJitter(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getSliceProfile_TN_BH_jitte()); tnSliceProfile.setPLMNIdList(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getSliceProfile_TN_BH_pLMNIdList()); - tnSliceProfile.setSNSSAIList(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getSliceProfile_TN_BH_sNSSAI()); + tnSliceProfile.setSNSSAI(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getSliceProfile_TN_BH_sNSSAI()); tnSliceProfile.setSST(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getSliceProfile_TN_BH_sST()); tnSliceProfile.setConnectionLinkId(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getSliceProfile_TN_BH_connectionLinkId()); tnSliceProfile.setResourceSharingLevel(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getSliceProfile_TN_BH_resourceSharingLevel()); tnBHSliceTaskInfo.setSliceProfile(tnSliceProfile); sliceTaskParams.setTnBHSliceTaskInfo(tnBHSliceTaskInfo); - CnSliceTaskInfo cnSliceTaskInfo = new CnSliceTaskInfo(); - SliceProfile cnSliceProfile = new SliceProfile(); + SliceProfile cnSliceProfile = cnSliceTaskInfo.getSliceProfile(); cnSliceTaskInfo.setSuggestNssiId(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getCnSuggestNssiId()); - cnSliceTaskInfo.setSuggestNSSIName(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getCnSuggestNssiName()); - cnSliceProfile.setSNSSAIList(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getCnServiceSnssai()); + cnSliceTaskInfo.setSuggestNssiName(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getCnSuggestNssiName()); + cnSliceProfile.setSNSSAI(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getCnServiceSnssai()); cnSliceProfile.setResourceSharingLevel(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getCnResourceSharingLevel()); - cnSliceProfile.setUeMobilityLevel(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getCnUeMobilityLevel()); + cnSliceProfile.setUEMobilityLevel(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getCnUeMobilityLevel()); cnSliceProfile.setLatency(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getCnLatency()); - cnSliceProfile.setMaxNumberOfUEs(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getCnMaxNumberOfUes()); + cnSliceProfile.setMaxNumberofUEs(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getCnMaxNumberOfUes()); cnSliceProfile.setActivityFactor(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getCnActivityFactor()); cnSliceProfile.setExpDataRateDL( sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getCnExpDataRateDl()); cnSliceProfile.setExpDataRateUL(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getCnExpDataRateUl()); @@ -327,12 +359,12 @@ public class TaskMgtServiceConvert { cnSliceProfile.setAreaTrafficCapUL(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getCnAreaTrafficCapUl()); cnSliceTaskInfo.setScriptName(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getCnScriptName()); cnSliceTaskInfo.setEnableNSSISelection(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getCnEnableNSSISelection()); - cnSliceProfile.setMaxNumberOfPDUSession(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getSliceProfile_CN_maxNumberofPDUSession()); + cnSliceProfile.setMaxNumberofPDUSession(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getSliceProfile_CN_maxNumberofPDUSession()); cnSliceProfile.setOverallUserDensity(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getSliceProfile_CN_overallUserDensity()); cnSliceProfile.setCoverageAreaTAList(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getSliceProfile_CN_coverageAreaTAList()); cnSliceProfile.setSST(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getSliceProfile_CN_sST()); cnSliceProfile.setCsAvailabilityTarget(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getSliceProfile_CN_cSAvailabilityTarget()); - cnSliceProfile.setCsReliabilityMeanTime(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getSliceProfile_CN_cSReliabilityMeanTime()); + cnSliceProfile.setCSReliabilityMeanTime(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getSliceProfile_CN_cSReliabilityMeanTime()); cnSliceProfile.setExpDataRate(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getSliceProfile_CN_expDataRate()); cnSliceProfile.setMsgSizeByte(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getSliceProfile_CN_msgSizeByte()); cnSliceProfile.setTransferIntervalTarget(sourceSlicingTaskAuditInfo.getNsiAndSubNssiInfo().getSliceProfile_CN_transferIntervalTarget()); @@ -343,7 +375,37 @@ public class TaskMgtServiceConvert { cnSliceTaskInfo.setSliceProfile(cnSliceProfile); sliceTaskParams.setCnSliceTaskInfo(cnSliceTaskInfo); - targetSoTaskInfo.setSliceTaskParams(sliceTaskParams); + Gson gson1 = new Gson(); + String objectStr = gson1.toJson(sliceTaskParams); + targetSoTaskInfo.setParams(objectStr); + } + + public EndPointInfo queryEndPointId(String connectionLinkId) { + ConnectionLinkList connectionLinkList = new ConnectionLinkList(); + EndPointInfo endPointInfo = new EndPointInfo(); + try { + Response<ConnectionLinkList> response = this.aaiSliceService.getConnectionLinks().execute(); + if(response.isSuccessful()){ + connectionLinkList = response.body(); + logger.info(connectionLinkList.toString()); + List<ConnectionLink> connectionLinks = connectionLinkList.getLogicalLink(); + List<ConnectionLink> tsciConnectionLink = connectionLinks.stream().filter(e -> e.getLinkId().equals(connectionLinkId) && e.getRelationshipList()!=null).collect( + Collectors.toList()); + + ConnectionLink connectionLink = tsciConnectionLink.get(0); + endPointInfo.setANEndPointId(connectionLink.getLinkName()); + endPointInfo.setCNEndPointId(connectionLink.getLinkName2()); + }else { + logger.error(String + .format("queryEndPointId: Can not get ConnectionLinks[code={}, message={}]", + response.code(), response.message())); + } + } catch (Exception e) { + logger.error(e.getMessage()); + } + logger.info("queryEndPointId: ConnectionLinks progress has been finished."); + + return endPointInfo; } String getAreaTaListString(List<String> anCoverageAreaTaList, char separator) { diff --git a/server/src/main/java/org/onap/usecaseui/server/service/slicingdomain/aai/AAISliceService.java b/server/src/main/java/org/onap/usecaseui/server/service/slicingdomain/aai/AAISliceService.java index f8cae8d6..c7533c5b 100644 --- a/server/src/main/java/org/onap/usecaseui/server/service/slicingdomain/aai/AAISliceService.java +++ b/server/src/main/java/org/onap/usecaseui/server/service/slicingdomain/aai/AAISliceService.java @@ -15,6 +15,8 @@ */ package org.onap.usecaseui.server.service.slicingdomain.aai; +import org.onap.usecaseui.server.service.slicingdomain.aai.bean.AAIServiceInstance; +import org.onap.usecaseui.server.service.slicingdomain.aai.bean.connection.NetworkInfo; import org.onap.usecaseui.server.service.slicingdomain.aai.bean.AAIServiceNST; import com.alibaba.fastjson.JSONObject; @@ -24,6 +26,7 @@ import org.onap.usecaseui.server.service.slicingdomain.aai.bean.connection.Conne import org.onap.usecaseui.server.service.slicingdomain.aai.bean.connection.EndPointInfoList; import org.onap.usecaseui.server.service.slicingdomain.aai.bean.connection.NetworkPolicy; +import org.onap.usecaseui.server.service.slicingdomain.aai.bean.connection.SliceProfileList; import retrofit2.Call; import retrofit2.http.GET; import retrofit2.http.Headers; @@ -226,6 +229,15 @@ public interface AAISliceService { Call<ConnectionLink> getServiceInstance(@Path("service-instance-id") String serviceInstancesId); @Headers({ + "X-TransactionId: 9999", + "X-FromAppId: MSO", + "Authorization: Basic QUFJOkFBSQ==", + "Accept: application/json" + }) + @GET("/api/aai-business/v21/customers/customer/5GCustomer/service-subscriptions/service-subscription/5G/service-instances/service-instance/{service-instance-id}") + Call<NetworkInfo> getServiceNetworkInstance(@Path("service-instance-id") String serviceInstancesId); + + @Headers({ "X-TransactionId: 9999", "X-FromAppId: MSO", "Authorization: Basic QUFJOkFBSQ==", @@ -233,4 +245,14 @@ public interface AAISliceService { }) @GET("/api/aai-network/v21/network-policies/network-policy/{network-policy-id}") Call<NetworkPolicy> getNetworkPolicy(@Path("network-policy-id")String relationshipValue); + + @Headers({ + "X-TransactionId: 9999", + "X-FromAppId: MSO", + "Authorization: Basic QUFJOkFBSQ==", + "Accept: application/json" + }) + @GET("/api/aai-business/v21/customers/customer/5GCustomer/service-subscriptions/service-subscription/5G/service-instances/service-instance/{service-instance-id}/slice-profiles") + Call<SliceProfileList> getSliceProfiles(@Path("service-instance-id") String serviceInstancesId); + } diff --git a/server/src/main/java/org/onap/usecaseui/server/service/slicingdomain/aai/bean/AAIServiceInstance.java b/server/src/main/java/org/onap/usecaseui/server/service/slicingdomain/aai/bean/AAIServiceInstance.java index ae5084a8..888354e7 100644 --- a/server/src/main/java/org/onap/usecaseui/server/service/slicingdomain/aai/bean/AAIServiceInstance.java +++ b/server/src/main/java/org/onap/usecaseui/server/service/slicingdomain/aai/bean/AAIServiceInstance.java @@ -17,8 +17,12 @@ import java.util.List; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Getter; +import lombok.Setter; @JsonIgnoreProperties(ignoreUnknown = true) +@Getter +@Setter public class AAIServiceInstance implements Serializable { private static final long serialVersionUID = -2847142014162429886L; @@ -38,6 +42,12 @@ public class AAIServiceInstance implements Serializable { @JsonProperty("environment-context") private String environmentContext; + @JsonProperty("workload-context") + private String workloadContext; + + @JsonProperty("created-at") + private String createdAt; + @JsonProperty("description") private String description; diff --git a/server/src/main/java/org/onap/usecaseui/server/service/slicingdomain/aai/bean/connection/EndPointInfoList.java b/server/src/main/java/org/onap/usecaseui/server/service/slicingdomain/aai/bean/connection/EndPointInfoList.java index f837c19d..0b3f75bd 100644 --- a/server/src/main/java/org/onap/usecaseui/server/service/slicingdomain/aai/bean/connection/EndPointInfoList.java +++ b/server/src/main/java/org/onap/usecaseui/server/service/slicingdomain/aai/bean/connection/EndPointInfoList.java @@ -26,17 +26,10 @@ import lombok.Setter; @JsonIgnoreProperties(ignoreUnknown = true) public class EndPointInfoList { - @JsonProperty("ip-address") private String ipAddress; @JsonProperty("logic-id") private String logicId; @JsonProperty("next-hop") private String nextHop; - @JsonProperty("lantency") - private String lantency ; - @JsonProperty("max_bandWidth") - private String maxBandWidth ; - @JsonProperty("link_type") - private String linkType ; } diff --git a/server/src/main/java/org/onap/usecaseui/server/service/slicingdomain/aai/bean/connection/NetworkInfo.java b/server/src/main/java/org/onap/usecaseui/server/service/slicingdomain/aai/bean/connection/NetworkInfo.java new file mode 100644 index 00000000..4b4a10e6 --- /dev/null +++ b/server/src/main/java/org/onap/usecaseui/server/service/slicingdomain/aai/bean/connection/NetworkInfo.java @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2021 CMCC, Inc. and others. 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. + */ +package org.onap.usecaseui.server.service.slicingdomain.aai.bean.connection; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Getter; +import lombok.Setter; +import org.onap.usecaseui.server.service.slicingdomain.aai.bean.connection.RelationshipList; + +@JsonIgnoreProperties(ignoreUnknown = true) +@Getter +@Setter +public class NetworkInfo { + + @JsonProperty("service-instance-id") + private String serviceInstanceId; + @JsonProperty("service-instance-name") + private String serviceInstanceName; + @JsonProperty("service-type") + private String serviceType; + @JsonProperty("service-role") + private String serviceRole; + @JsonProperty("environment-context") + private String environmentContext; + @JsonProperty("model-invariant-id") + private String modelInvariantId; + @JsonProperty("model-version-id") + private String modelVersionId; + @JsonProperty("resource-version") + private String resourceVersion; + @JsonProperty("orchestration-status") + private String orchestrationStatus; + @JsonProperty("relationship-list") + private RelationshipList relationshipList; +} diff --git a/server/src/main/java/org/onap/usecaseui/server/service/slicingdomain/aai/bean/connection/SliceProfileInfo.java b/server/src/main/java/org/onap/usecaseui/server/service/slicingdomain/aai/bean/connection/SliceProfileInfo.java new file mode 100644 index 00000000..92590d23 --- /dev/null +++ b/server/src/main/java/org/onap/usecaseui/server/service/slicingdomain/aai/bean/connection/SliceProfileInfo.java @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 CMCC, Inc. and others. 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. + */ +package org.onap.usecaseui.server.service.slicingdomain.aai.bean.connection; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@JsonIgnoreProperties(ignoreUnknown = true) +public class SliceProfileInfo { + + @JsonProperty("profile-id") + private String profileId; + + @JsonProperty("latency") + private String latency; + + @JsonProperty("jitter") + private String jitter; + + @JsonProperty("max-bandwidth") + private String maxBandwidth; +} diff --git a/server/src/main/java/org/onap/usecaseui/server/service/slicingdomain/aai/bean/connection/SliceProfileList.java b/server/src/main/java/org/onap/usecaseui/server/service/slicingdomain/aai/bean/connection/SliceProfileList.java new file mode 100644 index 00000000..956b7860 --- /dev/null +++ b/server/src/main/java/org/onap/usecaseui/server/service/slicingdomain/aai/bean/connection/SliceProfileList.java @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2021 CMCC, Inc. and others. 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. + */ +package org.onap.usecaseui.server.service.slicingdomain.aai.bean.connection; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@JsonIgnoreProperties(ignoreUnknown = true) +public class SliceProfileList { + + @JsonProperty("slice-profile") + private List<SliceProfileInfo> sliceProfileInfoList; +} diff --git a/server/src/main/java/org/onap/usecaseui/server/service/slicingdomain/so/bean/AnSliceTaskInfo.java b/server/src/main/java/org/onap/usecaseui/server/service/slicingdomain/so/bean/AnSliceTaskInfo.java index d1544ece..bf690b54 100644 --- a/server/src/main/java/org/onap/usecaseui/server/service/slicingdomain/so/bean/AnSliceTaskInfo.java +++ b/server/src/main/java/org/onap/usecaseui/server/service/slicingdomain/so/bean/AnSliceTaskInfo.java @@ -37,6 +37,11 @@ public class AnSliceTaskInfo { private String interfaceId ; @JsonProperty("nextHop_info") private String nextHopInfo ; - + private String sliceInstanceId; + private String vendor; + private String networkType; + private String subnetType; + private String endPointId; + private NstInfo nsstinfo; } diff --git a/server/src/main/java/org/onap/usecaseui/server/service/slicingdomain/so/bean/CnSliceTaskInfo.java b/server/src/main/java/org/onap/usecaseui/server/service/slicingdomain/so/bean/CnSliceTaskInfo.java index 844b582f..884ef2d0 100644 --- a/server/src/main/java/org/onap/usecaseui/server/service/slicingdomain/so/bean/CnSliceTaskInfo.java +++ b/server/src/main/java/org/onap/usecaseui/server/service/slicingdomain/so/bean/CnSliceTaskInfo.java @@ -24,7 +24,7 @@ import lombok.Data; @JsonIgnoreProperties(ignoreUnknown = true) public class CnSliceTaskInfo { private String suggestNssiId; - private String suggestNSSIName; + private String suggestNssiName; private String progress; private String status; private String statusDescription; @@ -37,4 +37,10 @@ public class CnSliceTaskInfo { private String interfaceId ; @JsonProperty("nextHop_info") private String nextHopInfo ; + private String sliceInstanceId; + private String vendor; + private String networkType; + private String subnetType; + private String endPointId; + private NstInfo nsstinfo; } diff --git a/server/src/main/java/org/onap/usecaseui/server/service/slicingdomain/so/bean/NstInfo.java b/server/src/main/java/org/onap/usecaseui/server/service/slicingdomain/so/bean/NstInfo.java new file mode 100644 index 00000000..5b557e17 --- /dev/null +++ b/server/src/main/java/org/onap/usecaseui/server/service/slicingdomain/so/bean/NstInfo.java @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2020 CMCC, Inc. and others. 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. + */ +package org.onap.usecaseui.server.service.slicingdomain.so.bean; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import lombok.Data; + +@Data +@JsonIgnoreProperties(ignoreUnknown = true) +public class NstInfo { + + private String invariantUUID; + private String name; + private String uuid; +} diff --git a/server/src/main/java/org/onap/usecaseui/server/service/slicingdomain/so/bean/SliceProfile.java b/server/src/main/java/org/onap/usecaseui/server/service/slicingdomain/so/bean/SliceProfile.java index 2bdec47b..658d8cac 100644 --- a/server/src/main/java/org/onap/usecaseui/server/service/slicingdomain/so/bean/SliceProfile.java +++ b/server/src/main/java/org/onap/usecaseui/server/service/slicingdomain/so/bean/SliceProfile.java @@ -25,12 +25,12 @@ import lombok.Data; public class SliceProfile { private String sliceProfileId; - private String sNSSAIList; + private String sNSSAI; private String pLMNIdList; - private String maxNumberOfUEs; + private String maxNumberofUEs; private String coverageAreaTAList; private String latency; - private String ueMobilityLevel; + private String uEMobilityLevel; private String resourceSharingLevel; private String connectionLinkId; private String maxBandwidth; @@ -44,9 +44,9 @@ public class SliceProfile { private String jitter; private String csAvailabilityTarget; private String expDataRate; - private String maxNumberOfPDUSession; + private String maxNumberofPDUSession; private String overallUserDensity; - private String csReliabilityMeanTime; + private String cSReliabilityMeanTime; private String msgSizeByte; private String transferIntervalTarget; private String ipAddress; diff --git a/server/src/main/java/org/onap/usecaseui/server/service/slicingdomain/so/bean/SliceTaskParams.java b/server/src/main/java/org/onap/usecaseui/server/service/slicingdomain/so/bean/SliceTaskParams.java index 48a74701..3c15deca 100644 --- a/server/src/main/java/org/onap/usecaseui/server/service/slicingdomain/so/bean/SliceTaskParams.java +++ b/server/src/main/java/org/onap/usecaseui/server/service/slicingdomain/so/bean/SliceTaskParams.java @@ -29,7 +29,7 @@ public class SliceTaskParams { private String nstName; private ServiceProfile serviceProfile; private String suggestNsiId; - private String suggestNSIName; + private String suggestNsiName; @JsonProperty("tnBHSliceTaskInfo") private TnBHSliceTaskInfo tnBHSliceTaskInfo; @JsonProperty("tnMHSliceTaskInfo") @@ -37,4 +37,5 @@ public class SliceTaskParams { private TnFHSliceTaskInfo tnFHSliceTaskInfo; private CnSliceTaskInfo cnSliceTaskInfo; private AnSliceTaskInfo anSliceTaskInfo; + private NstInfo nstinfo; } diff --git a/server/src/main/java/org/onap/usecaseui/server/service/slicingdomain/so/bean/TnBHSliceTaskInfo.java b/server/src/main/java/org/onap/usecaseui/server/service/slicingdomain/so/bean/TnBHSliceTaskInfo.java index 6e527aa2..0175db15 100644 --- a/server/src/main/java/org/onap/usecaseui/server/service/slicingdomain/so/bean/TnBHSliceTaskInfo.java +++ b/server/src/main/java/org/onap/usecaseui/server/service/slicingdomain/so/bean/TnBHSliceTaskInfo.java @@ -24,13 +24,18 @@ import lombok.Data; @JsonIgnoreProperties(ignoreUnknown = true) public class TnBHSliceTaskInfo { private String suggestNssiId; - private String suggestNSSIName; + private String suggestNssiName; private String progress; private String status; private String statusDescription; @JsonProperty("sliceProfile") private SliceProfile sliceProfile; - private String scriptName ; + private String sliceInstanceId; + private String scriptName; + private String vendor; + private String networkType; + private String subnetType; + private String endPointId; private Boolean enableNSSISelection ; @JsonProperty("lantency") private String lantency ; @@ -38,5 +43,5 @@ public class TnBHSliceTaskInfo { private String maxBandWidth ; @JsonProperty("link_type") private String linkType ; - + private NstInfo nsstinfo; } diff --git a/server/src/main/java/org/onap/usecaseui/server/service/slicingdomain/so/bean/TnFHSliceTaskInfo.java b/server/src/main/java/org/onap/usecaseui/server/service/slicingdomain/so/bean/TnFHSliceTaskInfo.java index a31bb6f4..38b5c739 100644 --- a/server/src/main/java/org/onap/usecaseui/server/service/slicingdomain/so/bean/TnFHSliceTaskInfo.java +++ b/server/src/main/java/org/onap/usecaseui/server/service/slicingdomain/so/bean/TnFHSliceTaskInfo.java @@ -17,11 +17,25 @@ package org.onap.usecaseui.server.service.slicingdomain.so.bean; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Data; @Data @JsonIgnoreProperties(ignoreUnknown = true) public class TnFHSliceTaskInfo { - private SliceProfile sliceProfile ; + private String suggestNssiId; + private String suggestNssiName; + private String progress; + private String status; + private String statusDescription; + @JsonProperty("sliceProfile") + private SliceProfile sliceProfile; + private String sliceInstanceId; + private String scriptName; + private String vendor; + private String networkType; + private String subnetType; + private String endPointId; + private NstInfo nsstinfo; } diff --git a/server/src/main/java/org/onap/usecaseui/server/service/slicingdomain/so/bean/TnMHSliceTaskInfo.java b/server/src/main/java/org/onap/usecaseui/server/service/slicingdomain/so/bean/TnMHSliceTaskInfo.java index 7c0c3fb4..71e37077 100644 --- a/server/src/main/java/org/onap/usecaseui/server/service/slicingdomain/so/bean/TnMHSliceTaskInfo.java +++ b/server/src/main/java/org/onap/usecaseui/server/service/slicingdomain/so/bean/TnMHSliceTaskInfo.java @@ -23,7 +23,18 @@ import lombok.Data; @Data @JsonIgnoreProperties(ignoreUnknown = true) public class TnMHSliceTaskInfo { + private String suggestNssiId; + private String suggestNssiName; + private String progress; + private String status; + private String statusDescription; @JsonProperty("sliceProfile") - private SliceProfile sliceProfile ; - + private SliceProfile sliceProfile; + private String sliceInstanceId; + private String scriptName; + private String vendor; + private String networkType; + private String subnetType; + private String endPointId; + private NstInfo nsstinfo; } diff --git a/server/src/test/java/org/onap/usecaseui/server/service/nsmf/impl/TaskMgtServiceConvertTest.java b/server/src/test/java/org/onap/usecaseui/server/service/nsmf/impl/TaskMgtServiceConvertTest.java index b0216c8c..55b38bf7 100644 --- a/server/src/test/java/org/onap/usecaseui/server/service/nsmf/impl/TaskMgtServiceConvertTest.java +++ b/server/src/test/java/org/onap/usecaseui/server/service/nsmf/impl/TaskMgtServiceConvertTest.java @@ -99,7 +99,7 @@ public class TaskMgtServiceConvertTest { sliceTaskParams.setTnBHSliceTaskInfo(tnBHSliceTaskInfo); sliceTaskParams.setCnSliceTaskInfo(cnSliceTaskInfo); sliceTaskParams.setServiceProfile(serviceProfile); - sliceTaskParams.setSuggestNSIName("123"); + sliceTaskParams.setSuggestNsiName("123"); sourceSoTaskInfo.setSliceTaskParams(sliceTaskParams); taskMgtServiceConvert.convertTaskAuditInfo(targetSlicingTaskAuditInfo, sourceSoTaskInfo); |