From a37aaa36a18516f296908638f9f4399e7d487d92 Mon Sep 17 00:00:00 2001 From: "Tait,Trevor(rt0435)" Date: Mon, 14 Jan 2019 15:09:56 -0500 Subject: Upgrade sdnc-context-builder to audit-common.1.4.0 Issue-ID: LOG-926 Change-Id: Ib4adcdc118c55b18b0fe14a75606d35de3509b28 Signed-off-by: Tait,Trevor(rt0435) --- .../pomba/contextbuilder/sdnc/util/RestUtil.java | 45 +++++++++++----------- 1 file changed, 22 insertions(+), 23 deletions(-) (limited to 'src/main/java/org/onap') diff --git a/src/main/java/org/onap/pomba/contextbuilder/sdnc/util/RestUtil.java b/src/main/java/org/onap/pomba/contextbuilder/sdnc/util/RestUtil.java index 3a6407a..635f254 100644 --- a/src/main/java/org/onap/pomba/contextbuilder/sdnc/util/RestUtil.java +++ b/src/main/java/org/onap/pomba/contextbuilder/sdnc/util/RestUtil.java @@ -47,8 +47,8 @@ import org.onap.pomba.common.datatypes.Attribute; import org.onap.pomba.common.datatypes.Attribute.Name; import org.onap.pomba.common.datatypes.ModelContext; import org.onap.pomba.common.datatypes.Service; -import org.onap.pomba.common.datatypes.VF; import org.onap.pomba.common.datatypes.VFModule; +import org.onap.pomba.common.datatypes.VNF; import org.onap.pomba.common.datatypes.VNFC; import org.onap.pomba.contextbuilder.sdnc.exception.AuditError; import org.onap.pomba.contextbuilder.sdnc.exception.AuditException; @@ -224,20 +224,20 @@ public class RestUtil { public static ModelContext transformVnfList(List aaiVnfLst, Map> sdncVnfMap) { ModelContext context = new ModelContext(); Service service = new Service(); - List vfList = new ArrayList<>(); + List vnfList = new ArrayList<>(); // Initialize common model members to null - service.setInvariantUuid("null"); + service.setModelInvariantUUID("null"); service.setUuid("null"); service.setName("null"); for(VnfInstance aaiVnfInstance : aaiVnfLst) { - VF vf = new VF(); + VNF vnf = new VNF(); // Initialize common model members to null - vf.setName("null"); - vf.setType("null"); - vf.setInvariantUuid("null"); - vf.setUuid("null"); + vnf.setName("null"); + vnf.setType("null"); + vnf.setModelInvariantUUID("null"); + vnf.setUuid("null"); List sdncVnfList = sdncVnfMap.get(aaiVnfInstance.getVnfId()); try { // Set the common model VF name and type from the SDNC topology info @@ -245,13 +245,13 @@ public class RestUtil { if (sdncVnfList != null && !sdncVnfList.isEmpty()) { for(Vnf sdncVnf : sdncVnfList) { vnfTopologyId = sdncVnf.getServiceData().getVnfTopologyInformation().getVnfTopologyIdentifier(); - if (vf.getName().contentEquals("null")) { - vf.setName(vnfTopologyId.getGenericVnfName()); + if (vnf.getName().contentEquals("null")) { + vnf.setName(vnfTopologyId.getGenericVnfName()); } - if (vf.getType().contentEquals("null")) { - vf.setType(vnfTopologyId.getGenericVnfType()); + if (vnf.getType().contentEquals("null")) { + vnf.setType(vnfTopologyId.getGenericVnfType()); } - if (vf.getAttributes().isEmpty()) { + if (vnf.getAttributes().isEmpty()) { if ((null != vnfTopologyId.getInMaint()) && !(vnfTopologyId.getInMaint().isEmpty())) { Attribute lockedBoolean = new Attribute(); lockedBoolean.setName(Name.lockedBoolean); @@ -261,20 +261,20 @@ public class RestUtil { if (vnfTopologyId.getInMaint().equalsIgnoreCase("no")) { lockedBoolean.setValue("false"); } - vf.addAttribute(lockedBoolean); + vnf.addAttribute(lockedBoolean); } if ((null != vnfTopologyId.getProvStatus()) && !(vnfTopologyId.getProvStatus().isEmpty())) { Attribute provStatus = new Attribute(); // attribute.setName(Name.provStatus); provStatus.setValue(vnfTopologyId.getProvStatus()); - vf.addAttribute(provStatus); + vnf.addAttribute(provStatus); } if (null != vnfTopologyId.getPserver()) { if ((null != vnfTopologyId.getPserver().getHostname()) && !(vnfTopologyId.getPserver().getHostname().isEmpty())) { Attribute hostname = new Attribute(); hostname.setName(Name.hostName); hostname.setValue(vnfTopologyId.getPserver().getHostname()); - vf.addAttribute(hostname); + vnf.addAttribute(hostname); } } @@ -283,7 +283,7 @@ public class RestUtil { Attribute imageName = new Attribute(); imageName.setName(Name.imageId); imageName.setValue(vnfTopologyId.getImage().getImageName()); - vf.addAttribute(imageName); + vnf.addAttribute(imageName); } } @@ -295,16 +295,16 @@ public class RestUtil { } // Get the common model list of VFModule from the SDNC VNF List List vfmoduleLst = getVfModuleList(aaiVnfInstance, sdncVnfList); - vf.setVfModules(vfmoduleLst); + vnf.setVfModules(vfmoduleLst); // Get the common model list of VNFC from the SDNC Vnf List vnfcList = getVnfcList(sdncVnfList); - vf.setVnfcs(vnfcList); - vfList.add(vf); + vnf.setVnfcs(vnfcList); + vnfList.add(vnf); } context.setService(service); - context.setVfs(vfList); + context.setVnfs(vnfList); return context; } @@ -593,9 +593,8 @@ public class RestUtil { for (VmName sdncVmName : sdncVmNameLst) { VNFC vnfc = new VNFC(); // Initialize common model members to null - vnfc.setInvariantUuid("null"); + vnfc.setModelInvariantUUID("null"); vnfc.setUuid("null"); - vnfc.setType(sdncVnfVm.getVmType() == null ? "null" : sdncVnfVm.getVmType()); vnfc.setName(sdncVmName.getVmName() == null ? "null" : sdncVmName.getVmName()); vnfcList.add(vnfc); } -- cgit 1.2.3-korg