Phosphorus migration
[transportpce.git] / common / src / main / java / org / opendaylight / transportpce / common / mapping / PortMappingVersion710.java
index 92af655eb24ca5e72a69c811684cb5e8fcebb92e..f7991a00deab0c718fd061b76d79537ec45be9c8 100644 (file)
@@ -353,7 +353,7 @@ public class PortMappingVersion710 {
                 for (XpdrPort xpdrPort : xponder.nonnullXpdrPort().values().stream()
                         .sorted((xp1, xp2) -> xp1.getIndex().compareTo(xp2.getIndex())).collect(Collectors.toList())) {
                     String circuitPackName = xpdrPort.getCircuitPackName();
-                    String portName = xpdrPort.getPortName().toString();
+                    String portName = xpdrPort.getPortName();
                     // If there xponder-subtree has missing circuit-packs or ports,
                     // This gives a null-pointer expection,
                     if (device.nonnullCircuitPacks().values().stream()
@@ -576,7 +576,7 @@ public class PortMappingVersion710 {
                             InstanceIdentifier<Ports> port2ID = InstanceIdentifier.create(OrgOpenroadmDevice.class)
                                 .child(CircuitPacks.class,
                                     new CircuitPacksKey(port.getPartnerPort().getCircuitPackName()))
-                                .child(Ports.class, new PortsKey(port.getPartnerPort().getPortName().toString()));
+                                .child(Ports.class, new PortsKey(port.getPartnerPort().getPortName()));
                             Optional<Ports> port2Object = this.deviceTransactionManager
                                 .getDataFromDevice(nodeId, LogicalDatastoreType.OPERATIONAL, port2ID,
                                     Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT);
@@ -584,7 +584,7 @@ public class PortMappingVersion710 {
                                 || port2Object.get().getPortQual().getIntValue()
                                     != PortQual.RoadmExternal.getIntValue()) {
                                 LOG.error("{} : port {} on {} - error getting partner",
-                                        nodeId, port.getPartnerPort().getPortName().toString(),
+                                        nodeId, port.getPartnerPort().getPortName(),
                                         port.getPartnerPort().getCircuitPackName());
                                 continue;
                             }
@@ -1106,7 +1106,7 @@ public class PortMappingVersion710 {
             return null;
         }
         Optional<Ports> poOpt = cpOpt.get().nonnullPorts().values().stream()
-            .filter(p -> p.getPortName().equals(port.getPartnerPort().getPortName().toString()))
+            .filter(p -> p.getPortName().equals(port.getPartnerPort().getPortName()))
             .findFirst();
         if (!poOpt.isPresent()) {
             LOG.error("{} : Error fetching port {} on {}",
@@ -1269,7 +1269,7 @@ public class PortMappingVersion710 {
                         .child(CircuitPacks.class,
                             new CircuitPacksKey(connectionPortMap.get(cpMapEntry.getKey()).get(0).getCircuitPackName()))
                         .child(Ports.class,
-                            new PortsKey(connectionPortMap.get(cpMapEntry.getKey()).get(0).getPortName().toString()));
+                            new PortsKey(connectionPortMap.get(cpMapEntry.getKey()).get(0).getPortName()));
                     LOG.debug("{} : Fetching connection-port {} at circuit pack {}",
                             nodeId,
                             connectionPortMap.get(cpMapEntry.getKey()).get(0).getPortName(),
@@ -1315,7 +1315,7 @@ public class PortMappingVersion710 {
                     InstanceIdentifier<Ports> port1ID = InstanceIdentifier.create(OrgOpenroadmDevice.class)
                         .child(CircuitPacks.class, new CircuitPacksKey(cp1Name))
                         .child(Ports.class,
-                            new PortsKey(connectionPortMap.get(cpMapEntry.getKey()).get(0).getPortName().toString()));
+                            new PortsKey(connectionPortMap.get(cpMapEntry.getKey()).get(0).getPortName()));
                     LOG.debug("{} : Fetching connection-port {} at circuit pack {}",
                             nodeId, connectionPortMap.get(cpMapEntry.getKey()).get(0).getPortName(), cp1Name);
                     Optional<Ports> port1Object = this.deviceTransactionManager.getDataFromDevice(nodeId,
@@ -1324,7 +1324,7 @@ public class PortMappingVersion710 {
                     InstanceIdentifier<Ports> port2ID = InstanceIdentifier.create(OrgOpenroadmDevice.class)
                         .child(CircuitPacks.class, new CircuitPacksKey(cp2Name))
                         .child(Ports.class,
-                            new PortsKey(connectionPortMap.get(cpMapEntry.getKey()).get(1).getPortName().toString()));
+                            new PortsKey(connectionPortMap.get(cpMapEntry.getKey()).get(1).getPortName()));
                     LOG.debug("{} : Fetching connection-port {} at circuit pack {}",
                             nodeId, connectionPortMap.get(cpMapEntry.getKey()).get(1).getPortName(), cp2Name);
                     Optional<Ports> port2Object = this.deviceTransactionManager.getDataFromDevice(nodeId,