From e48ae3b1908b008cb15225bb18a49a17b46504a4 Mon Sep 17 00:00:00 2001 From: Javier Errea Date: Tue, 29 Jun 2021 16:00:49 +0200 Subject: [PATCH] Fix wrong Supported CEP protocol qualifier TAPI nodes supported CEP qual. set based on interface capability of the corresponding Termination Point JIRA: TRNSPRTPCE-557 Signed-off-by: errea Change-Id: I567cbcf537b876f47af8fe8dfcfed7911e79e3f0 --- .../topology/TapiNetworkModelServiceImpl.java | 84 +++++++++---------- 1 file changed, 41 insertions(+), 43 deletions(-) diff --git a/tapi/src/main/java/org/opendaylight/transportpce/tapi/topology/TapiNetworkModelServiceImpl.java b/tapi/src/main/java/org/opendaylight/transportpce/tapi/topology/TapiNetworkModelServiceImpl.java index a7454a010..9ac731d78 100644 --- a/tapi/src/main/java/org/opendaylight/transportpce/tapi/topology/TapiNetworkModelServiceImpl.java +++ b/tapi/src/main/java/org/opendaylight/transportpce/tapi/topology/TapiNetworkModelServiceImpl.java @@ -241,8 +241,7 @@ public class TapiNetworkModelServiceImpl implements TapiNetworkModelService { // node transformation Map nodeMap = new HashMap<>(transformXpdrToTapiNode( - nodeId, xpdrClMaps, xpdrNetMaps, mapping.getXponderType(), oorOduSwitchingPool, - mapping.getSupportedInterfaceCapability())); + nodeId, xpdrClMaps, xpdrNetMaps, mapping.getXponderType(), oorOduSwitchingPool)); // add nodes and sips to tapi context mergeNodeinTopology(nodeMap); @@ -255,9 +254,7 @@ public class TapiNetworkModelServiceImpl implements TapiNetworkModelService { private Map transformXpdrToTapiNode(String nodeId, List xpdrClMaps, List xpdrNetMaps, XpdrNodeTypes xponderType, - OduSwitchingPools oorOduSwitchingPool, - List> - supportedInterfaceCapability) { + OduSwitchingPools oorOduSwitchingPool) { Map nodeMap = new HashMap<>(); LOG.info("creation of a DSR/ODU node for {}", nodeId); Uuid nodeUuidDsr = new Uuid(UUID.nameUUIDFromBytes((String.join("+", nodeId, DSR)) @@ -268,8 +265,7 @@ public class TapiNetworkModelServiceImpl implements TapiNetworkModelService { LayerProtocolName.ODU); org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.topology .Node dsrNode = createTapiXpdrNode(Map.of(nameDsr.key(), nameDsr), dsrLayerProtocols, - nodeId, nodeUuidDsr, xpdrClMaps, xpdrNetMaps, xponderType, oorOduSwitchingPool, - supportedInterfaceCapability); + nodeId, nodeUuidDsr, xpdrClMaps, xpdrNetMaps, xponderType, oorOduSwitchingPool); nodeMap.put(dsrNode.key(), dsrNode); @@ -282,8 +278,7 @@ public class TapiNetworkModelServiceImpl implements TapiNetworkModelService { List otsiLayerProtocols = Arrays.asList(LayerProtocolName.PHOTONICMEDIA); org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.topology .Node otsiNode = createTapiXpdrNode(Map.of(nameOtsi.key(), nameOtsi), otsiLayerProtocols, - nodeId, nodeUuidOtsi, xpdrClMaps, xpdrNetMaps, xponderType, null, - supportedInterfaceCapability); + nodeId, nodeUuidOtsi, xpdrClMaps, xpdrNetMaps, xponderType, null); nodeMap.put(otsiNode.key(), otsiNode); @@ -452,8 +447,7 @@ public class TapiNetworkModelServiceImpl implements TapiNetworkModelService { private Node createTapiXpdrNode(Map nameMap, List layerProtocols, String nodeId, Uuid nodeUuid, List xpdrClMaps, List xpdrNetMaps, - XpdrNodeTypes xponderType, OduSwitchingPools oorOduSwitchingPool, - List> supportedInterfaceCapability) { + XpdrNodeTypes xponderType, OduSwitchingPools oorOduSwitchingPool) { Map onepl = new HashMap<>(); Map nodeRuleGroupList = new HashMap<>(); Map ruleList = new HashMap<>(); @@ -466,13 +460,13 @@ public class TapiNetworkModelServiceImpl implements TapiNetworkModelService { if (layerProtocols.contains(LayerProtocolName.DSR)) { // neps for dsr/odu layer Map dsroduNeps = - createXpdrDsrOduNeps(nodeId, xpdrClMaps, xpdrNetMaps, xponderType, supportedInterfaceCapability); + createXpdrDsrOduNeps(nodeId, xpdrClMaps, xpdrNetMaps, xponderType); onepl.putAll(dsroduNeps); nodeRuleGroupList = createNodeRuleGroupForDsrNode(nodeId, oorOduSwitchingPool, ruleList, onepl); } else if (layerProtocols.contains(LayerProtocolName.PHOTONICMEDIA)) { // neps for photonic layer Map phtmdNeps = - createXpdrPhtnMdNeps(nodeId, xpdrNetMaps, supportedInterfaceCapability); + createXpdrPhtnMdNeps(nodeId, xpdrNetMaps); onepl.putAll(phtmdNeps); nodeRuleGroupList = createNodeRuleGroupForOtsiNode(nodeId, xpdrNetMaps, ruleList); } else { @@ -513,7 +507,7 @@ public class TapiNetworkModelServiceImpl implements TapiNetworkModelService { } private Map createXpdrPhtnMdNeps(String nodeId, - List xpdrNetMaps, List> supportedInterfaceCapability) { + List xpdrNetMaps) { Map onepl = new HashMap<>(); // iNep creation on otsi node @@ -528,10 +522,11 @@ public class TapiNetworkModelServiceImpl implements TapiNetworkModelService { .build(); OwnedNodeEdgePoint onep = createNep(nepUuid1, xpdrNetMaps.get(i).getLogicalConnectionPoint(), - Map.of(onedName.key(), onedName), LayerProtocolName.PHOTONICMEDIA, LayerProtocolName.PHOTONICMEDIA, - true, String.join("+", nodeId, I_OTSI), supportedInterfaceCapability, - transformOperState(xpdrNetMaps.get(i).getPortOperState()), - transformAdminState(xpdrNetMaps.get(i).getPortAdminState())); + Map.of(onedName.key(), onedName), LayerProtocolName.PHOTONICMEDIA, LayerProtocolName.PHOTONICMEDIA, + true, String.join("+", nodeId, I_OTSI), + xpdrNetMaps.get(i).getSupportedInterfaceCapability(), + transformOperState(xpdrNetMaps.get(i).getPortOperState()), + transformAdminState(xpdrNetMaps.get(i).getPortAdminState())); onepl.put(onep.key(), onep); } // eNep creation on otsi node @@ -545,10 +540,11 @@ public class TapiNetworkModelServiceImpl implements TapiNetworkModelService { .build(); OwnedNodeEdgePoint onep = createNep(nepUuid2, xpdrNetMaps.get(i).getLogicalConnectionPoint(), - Map.of(onedName.key(), onedName), LayerProtocolName.PHOTONICMEDIA, LayerProtocolName.PHOTONICMEDIA, - false, String.join("+", nodeId, E_OTSI), supportedInterfaceCapability, - transformOperState(xpdrNetMaps.get(i).getPortOperState()), - transformAdminState(xpdrNetMaps.get(i).getPortAdminState())); + Map.of(onedName.key(), onedName), LayerProtocolName.PHOTONICMEDIA, LayerProtocolName.PHOTONICMEDIA, + false, String.join("+", nodeId, E_OTSI), + xpdrNetMaps.get(i).getSupportedInterfaceCapability(), + transformOperState(xpdrNetMaps.get(i).getPortOperState()), + transformAdminState(xpdrNetMaps.get(i).getPortAdminState())); onepl.put(onep.key(), onep); } // Photonic Media Nep creation on otsi node @@ -562,18 +558,19 @@ public class TapiNetworkModelServiceImpl implements TapiNetworkModelService { .build(); OwnedNodeEdgePoint onep = createNep(nepUuid3, xpdrNetMaps.get(i).getLogicalConnectionPoint(), - Map.of(onedName.key(), onedName), LayerProtocolName.PHOTONICMEDIA, LayerProtocolName.PHOTONICMEDIA, - false, String.join("+", nodeId, PHTNC_MEDIA), supportedInterfaceCapability, - transformOperState(xpdrNetMaps.get(i).getPortOperState()), - transformAdminState(xpdrNetMaps.get(i).getPortAdminState())); + Map.of(onedName.key(), onedName), LayerProtocolName.PHOTONICMEDIA, LayerProtocolName.PHOTONICMEDIA, + false, String.join("+", nodeId, PHTNC_MEDIA), + xpdrNetMaps.get(i).getSupportedInterfaceCapability(), + transformOperState(xpdrNetMaps.get(i).getPortOperState()), + transformAdminState(xpdrNetMaps.get(i).getPortAdminState())); onepl.put(onep.key(), onep); } return onepl; } private Map createXpdrDsrOduNeps(String nodeId, List xpdrClMaps, - List xpdrNetMaps, XpdrNodeTypes xponderType, - List> supportedInterfaceCapability) { + List xpdrNetMaps, + XpdrNodeTypes xponderType) { Map onepl = new HashMap<>(); // client nep creation on DSR node for (int i = 0; i < xpdrClMaps.size(); i++) { @@ -591,10 +588,10 @@ public class TapiNetworkModelServiceImpl implements TapiNetworkModelService { } OwnedNodeEdgePoint onep = createNep(nepUuid, xpdrClMaps.get(i).getLogicalConnectionPoint(), - Map.of(name.key(), name), LayerProtocolName.DSR, LayerProtocolName.DSR, true, - String.join("+", nodeId, DSR), supportedInterfaceCapability, - transformOperState(xpdrClMaps.get(i).getPortOperState()), - transformAdminState(xpdrClMaps.get(i).getPortAdminState())); + Map.of(name.key(), name), LayerProtocolName.DSR, LayerProtocolName.DSR, true, + String.join("+", nodeId, DSR), xpdrClMaps.get(i).getSupportedInterfaceCapability(), + transformOperState(xpdrClMaps.get(i).getPortOperState()), + transformAdminState(xpdrClMaps.get(i).getPortAdminState())); onepl.put(onep.key(), onep); } // network nep creation on I_ODU node @@ -609,16 +606,17 @@ public class TapiNetworkModelServiceImpl implements TapiNetworkModelService { .build(); OwnedNodeEdgePoint onep = createNep(nepUuid, xpdrNetMaps.get(i).getLogicalConnectionPoint(), - Map.of(onedName.key(), onedName), - LayerProtocolName.ODU, LayerProtocolName.DSR, false, - String.join("+", nodeId, I_ODU), supportedInterfaceCapability, - transformOperState(xpdrNetMaps.get(i).getPortOperState()), - transformAdminState(xpdrNetMaps.get(i).getPortAdminState())); + Map.of(onedName.key(), onedName), + LayerProtocolName.ODU, LayerProtocolName.DSR, false, + String.join("+", nodeId, I_ODU), xpdrNetMaps.get(i).getSupportedInterfaceCapability(), + transformOperState(xpdrNetMaps.get(i).getPortOperState()), + transformAdminState(xpdrNetMaps.get(i).getPortAdminState())); onepl.put(onep.key(), onep); } // network nep creation on E_ODU node for (int i = 0; i < xpdrNetMaps.size(); i++) { - LOG.info("eODU NEP = {}", String.join("+", nodeId, E_ODU, xpdrNetMaps.get(i).getLogicalConnectionPoint())); + LOG.info("eODU NEP = {}", String.join("+", nodeId, E_ODU, + xpdrNetMaps.get(i).getLogicalConnectionPoint())); Uuid nepUuid = new Uuid(UUID.nameUUIDFromBytes( (String.join("+", nodeId, E_ODU, xpdrNetMaps.get(i).getLogicalConnectionPoint())) .getBytes(Charset.forName("UTF-8"))).toString()); @@ -628,11 +626,11 @@ public class TapiNetworkModelServiceImpl implements TapiNetworkModelService { .build(); OwnedNodeEdgePoint onep = createNep(nepUuid, xpdrNetMaps.get(i).getLogicalConnectionPoint(), - Map.of(onedName.key(), onedName), - LayerProtocolName.ODU, LayerProtocolName.DSR, true, - String.join("+", nodeId, E_ODU), supportedInterfaceCapability, - transformOperState(xpdrNetMaps.get(i).getPortOperState()), - transformAdminState(xpdrNetMaps.get(i).getPortAdminState())); + Map.of(onedName.key(), onedName), + LayerProtocolName.ODU, LayerProtocolName.DSR, true, + String.join("+", nodeId, E_ODU), xpdrNetMaps.get(i).getSupportedInterfaceCapability(), + transformOperState(xpdrNetMaps.get(i).getPortOperState()), + transformAdminState(xpdrNetMaps.get(i).getPortAdminState())); onepl.put(onep.key(), onep); } return onepl; -- 2.36.6