X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=tapi%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Ftransportpce%2Ftapi%2Ftopology%2FConvertORTopoToTapiFullTopo.java;h=0cf7cf835e10360e6f8be17ea713643991c9d8de;hb=db48b1e815c4f74a008f98f015fffe1bf0a052ca;hp=b5c869eb179d5a560d403ca35009062f5c577c53;hpb=370431306c4a08a799a483dd708d7c6ad127cce4;p=transportpce.git diff --git a/tapi/src/main/java/org/opendaylight/transportpce/tapi/topology/ConvertORTopoToTapiFullTopo.java b/tapi/src/main/java/org/opendaylight/transportpce/tapi/topology/ConvertORTopoToTapiFullTopo.java index b5c869eb1..0cf7cf835 100644 --- a/tapi/src/main/java/org/opendaylight/transportpce/tapi/topology/ConvertORTopoToTapiFullTopo.java +++ b/tapi/src/main/java/org/opendaylight/transportpce/tapi/topology/ConvertORTopoToTapiFullTopo.java @@ -174,11 +174,14 @@ public class ConvertORTopoToTapiFullTopo { Uuid nodeUuid = new Uuid(UUID.nameUUIDFromBytes((String.join("+", this.ietfNodeId, TapiStringConstants.DSR)).getBytes(Charset.forName("UTF-8"))).toString()); this.uuidMap.put(String.join("+", this.ietfNodeId, TapiStringConstants.DSR), nodeUuid); - Name nameDsr = new NameBuilder().setValueName("dsr/odu node name").setValue( + Name nameDsrNode = new NameBuilder().setValueName("dsr/odu node name").setValue( String.join("+", this.ietfNodeId, TapiStringConstants.DSR)).build(); + Name nameNodeType = new NameBuilder().setValueName("Node Type") + .setValue(this.ietfNodeType.getName()).build(); List dsrLayerProtocols = Arrays.asList(LayerProtocolName.DSR, LayerProtocolName.ODU); org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.topology - .Node dsrNode = createTapiNode(Map.of(nameDsr.key(), nameDsr), dsrLayerProtocols); + .Node dsrNode = createTapiNode(Map.of(nameDsrNode.key(), nameDsrNode, nameNodeType.key(), nameNodeType), + dsrLayerProtocols); LOG.info("DSR Node {} should have {} NEPs and {} SIPs", this.ietfNodeId, this.oorClientPortList.size() + 2 * this.oorNetworkPortList.size(), this.oorClientPortList.size() + this.oorNetworkPortList.size()); @@ -192,11 +195,12 @@ public class ConvertORTopoToTapiFullTopo { nodeUuid = new Uuid(UUID.nameUUIDFromBytes((String.join("+", this.ietfNodeId, TapiStringConstants.OTSI)) .getBytes(Charset.forName("UTF-8"))).toString()); this.uuidMap.put(String.join("+", this.ietfNodeId, TapiStringConstants.OTSI), nodeUuid); - Name nameOtsi = new NameBuilder().setValueName("otsi node name").setValue( + Name nameOtsiNode = new NameBuilder().setValueName("otsi node name").setValue( String.join("+", this.ietfNodeId, TapiStringConstants.OTSI)).build(); List otsiLayerProtocols = Arrays.asList(LayerProtocolName.PHOTONICMEDIA); org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.topology - .Node otsiNode = createTapiNode(Map.of(nameOtsi.key(), nameOtsi), otsiLayerProtocols); + .Node otsiNode = createTapiNode(Map.of(nameOtsiNode.key(), nameOtsiNode, nameNodeType.key(), nameNodeType), + otsiLayerProtocols); LOG.info("OTSi Node {} should have {} NEPs and {} SIPs", this.ietfNodeId, 3 * this.oorNetworkPortList.size(), this.oorNetworkPortList.size()); LOG.info("OTSi Node {} has {} NEPs and {} SIPs", this.ietfNodeId, @@ -317,6 +321,8 @@ public class ConvertORTopoToTapiFullTopo { public void convertRoadmNode(Node roadm, Network openroadmTopo) { this.ietfNodeId = roadm.getNodeId().getValue(); + this.ietfNodeType = roadm.augmentation( + org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev200529.Node1.class).getNodeType(); Map oneplist = new HashMap<>(); // 1. Get degree and srg nodes to map TPs into NEPs if (openroadmTopo.getNode() == null) { @@ -395,11 +401,14 @@ public class ConvertORTopoToTapiFullTopo { // Names Name nodeNames = new NameBuilder().setValueName("roadm node name") .setValue(String.join("+", roadm.getNodeId().getValue(), TapiStringConstants.PHTNC_MEDIA)).build(); + Name nameNodeType = new NameBuilder().setValueName("Node Type") + .setValue(this.ietfNodeType.getName()).build(); // Protocol Layer List layerProtocols = Arrays.asList(LayerProtocolName.PHOTONICMEDIA); // Build tapi node org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.topology - .Node roadmNode = createRoadmTapiNode(nodeUuid, nodeNames, layerProtocols, oneplist); + .Node roadmNode = createRoadmTapiNode(nodeUuid, + Map.of(nodeNames.key(), nodeNames, nameNodeType.key(), nameNodeType), layerProtocols, oneplist); // TODO add states corresponding to device config LOG.info("ROADM node {} should have {} NEPs and {} SIPs", roadm.getNodeId().getValue(), numNeps, numSips); LOG.info("ROADM node {} has {} NEPs and {} SIPs", roadm.getNodeId().getValue(), @@ -488,7 +497,7 @@ public class ConvertORTopoToTapiFullTopo { } private org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.topology.Node - createRoadmTapiNode(Uuid nodeUuid, Name nodeNames, List layerProtocols, + createRoadmTapiNode(Uuid nodeUuid, Map nameMap, List layerProtocols, Map oneplist) { // Empty random creation of mandatory fields for avoiding errors.... CostCharacteristic costCharacteristic = new CostCharacteristicBuilder() @@ -505,7 +514,7 @@ public class ConvertORTopoToTapiFullTopo { .build(); return new NodeBuilder() .setUuid(nodeUuid) - .setName(Map.of(nodeNames.key(), nodeNames)) + .setName(nameMap) .setLayerProtocolName(layerProtocols) .setAdministrativeState(AdministrativeState.UNLOCKED) .setOperationalState(OperationalState.ENABLED)