Phosphorus migration
[transportpce.git] / common / src / main / java / org / opendaylight / transportpce / common / mapping / PortMappingVersion121.java
index 71dd97130de8508d468998488260e10cc4b43f00..0ac3a428c8b4f104a138b395aaf1d7e7e35da212 100644 (file)
@@ -376,7 +376,7 @@ public class PortMappingVersion121 {
                             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);
@@ -384,7 +384,7 @@ public class PortMappingVersion121 {
                                 || port2Object.get().getPortQual().getIntValue()
                                     != Port.PortQual.RoadmExternal.getIntValue()) {
                                 LOG.error("{} : port {} on {} - error getting partner",
-                                        nodeId, port.getPartnerPort().getPortName().toString(),
+                                        nodeId, port.getPartnerPort().getPortName(),
                                         port.getPartnerPort().getCircuitPackName());
                                 continue;
                             }
@@ -695,7 +695,7 @@ public class PortMappingVersion121 {
             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 {}",
@@ -824,7 +824,7 @@ public class PortMappingVersion121 {
                         .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(),
@@ -870,7 +870,7 @@ public class PortMappingVersion121 {
                     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,
@@ -879,7 +879,7 @@ public class PortMappingVersion121 {
                     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,
@@ -887,7 +887,7 @@ public class PortMappingVersion121 {
                         Timeouts.DEVICE_READ_TIMEOUT_UNIT);
                     if (!port1Object.isPresent() || !port2Object.isPresent()) {
                         LOG.error("No port {} on circuit pack {} for node {}",
-                            connectionPortMap.get(cpMapEntry.getKey()).get(0).getPortName().toString(),
+                            connectionPortMap.get(cpMapEntry.getKey()).get(0).getPortName(),
                             connectionPortMap.get(cpMapEntry.getKey()).get(0).getCircuitPackName(), nodeId);
                         return false;
                     }