Bug correction in LogicalConnectionPoint naming 45/73545/7
authorGilles Thouenon <gilles.thouenon@orange.com>
Wed, 7 Feb 2018 14:33:15 +0000 (15:33 +0100)
committerguillaume.lambert <guillaume.lambert@orange.com>
Wed, 18 Jul 2018 12:18:08 +0000 (14:18 +0200)
insert if not found, the SRG number into the logical connection point
name during the portmapping creation.

Change-Id: I979dac8100a17c122cf73f2e77403a4df19a03db
Signed-off-by: Gilles Thouenon <gilles.thouenon@orange.com>
Co-authored-by: Christophe Betoule <christophe.betoule@orange.com>
renderer/src/main/java/org/opendaylight/transportpce/renderer/mapping/PortMapping.java

index 4cb3c10e0d1bf2c0b46fbf7c4cb9a2c78a8ebb3e..bfdea816dbc831e58a80e6011260aa2fee960eae 100644 (file)
@@ -293,18 +293,30 @@ public class PortMapping {
                                     String logicalConnectionPoint = null;
                                     if (port.getPortDirection().getIntValue() == 1) {
                                         // Port direction is transmit
-                                        logicalConnectionPoint = "SRG" + srgCounter + "-" + port
-                                            .getLogicalConnectionPoint() + "-TX";
+                                        if (!port.getLogicalConnectionPoint().contains("SRG")) {
+                                            logicalConnectionPoint = "SRG" + srgCounter + "-" + port
+                                                .getLogicalConnectionPoint() + "-TX";
+                                        } else {
+                                            logicalConnectionPoint = port.getLogicalConnectionPoint() + "-TX";
+                                        }
                                     }
                                     if (port.getPortDirection().getIntValue() == 2) {
                                         // Port direction is receive
-                                        logicalConnectionPoint = "SRG" + srgCounter + "-" + port
-                                            .getLogicalConnectionPoint() + "-RX";
+                                        if (!port.getLogicalConnectionPoint().contains("SRG")) {
+                                            logicalConnectionPoint = "SRG" + srgCounter + "-" + port
+                                                .getLogicalConnectionPoint() + "-RX";
+                                        } else {
+                                            logicalConnectionPoint = port.getLogicalConnectionPoint() + "-RX";
+                                        }
                                     }
                                     if (port.getPortDirection().getIntValue() == 3) {
                                         // port is bi-directional
-                                        logicalConnectionPoint = "SRG" + srgCounter + "-" + port
-                                            .getLogicalConnectionPoint() + "-TXRX";
+                                        if (!port.getLogicalConnectionPoint().contains("SRG")) {
+                                            logicalConnectionPoint = "SRG" + srgCounter + "-" + port
+                                                .getLogicalConnectionPoint() + "-TXRX";
+                                        } else {
+                                            logicalConnectionPoint = port.getLogicalConnectionPoint() + "-TXRX";
+                                        }
                                     }
 
                                     LOG.info("Logical Connection Point for {} {} is {}", circuitPackName, port