Upgrade portmapping YANG to enable flex-grid
[transportpce.git] / renderer / src / main / java / org / opendaylight / transportpce / renderer / openroadminterface / OpenRoadmOtnInterface221.java
index 14635fe08620663c3ed74c90aadfa3a3d4729540..058991e231f4f176d8c562df939f4db8fe4b31fc 100644 (file)
@@ -13,7 +13,7 @@ import java.util.stream.IntStream;
 import org.opendaylight.transportpce.common.mapping.PortMapping;
 import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaceException;
 import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaces;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev200128.network.nodes.Mapping;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev200827.network.nodes.Mapping;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev181019.interfaces.grp.InterfaceBuilder;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev181019.interfaces.grp.InterfaceKey;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.equipment.states.types.rev171215.AdminStates;
@@ -59,8 +59,8 @@ public class OpenRoadmOtnInterface221 {
         }
 
         // Ethernet interface specific data
-        EthernetBuilder ethIfBuilder = new EthernetBuilder();
-        ethIfBuilder.setSpeed(1000L);
+        EthernetBuilder ethIfBuilder = new EthernetBuilder()
+                .setSpeed(1000L);
         InterfaceBuilder ethInterfaceBldr = createGenericInterfaceBuilder(
                 portMap, EthernetCsmacd.class,
                 logicalConnPoint + "-ETHERNET1G");
@@ -146,7 +146,7 @@ public class OpenRoadmOtnInterface221 {
         if (supportingInterface == null) {
             throw new OpenRoadmInterfaceException(
                     "Interface Creation failed because of missing supported "
-                    + "ODU4 on network end or Eth iface on client");
+                    + "ODU4 on network end or Ethernet on client");
         }
 
         InterfaceBuilder oduInterfaceBldr = createGenericInterfaceBuilder(
@@ -167,7 +167,8 @@ public class OpenRoadmOtnInterface221 {
             IntStream.range(tribSlotIndex, tribSlotIndex + 8)
                     .forEach(nbr -> tribSlots.add(Uint16.valueOf(nbr)));
             ParentOduAllocationBuilder parentOduAllocationBuilder = new ParentOduAllocationBuilder()
-                    .setTribPortNumber(tribPortNumber).setTribSlots(tribSlots);
+                    .setTribPortNumber(tribPortNumber)
+                    .setTribSlots(tribSlots);
             oduIfBuilder.setOduFunction(ODUCTP.class)
                     .setMonitoringMode(OduAttributes.MonitoringMode.Monitored)
                     .setParentOduAllocation(parentOduAllocationBuilder.build());
@@ -224,7 +225,8 @@ public class OpenRoadmOtnInterface221 {
             tribSlots.add(Uint16.valueOf(tribSlot));
             ParentOduAllocationBuilder parentOduAllocationBuilder = new ParentOduAllocationBuilder()
                     // set trib port numbers
-                    .setTribPortNumber(tribPortNumber).setTribSlots(tribSlots);
+                    .setTribPortNumber(tribPortNumber)
+                    .setTribSlots(tribSlots);
             oduIfBuilder.setOduFunction(ODUCTP.class)
                     .setMonitoringMode(OduAttributes.MonitoringMode.Monitored)
                     .setParentOduAllocation(parentOduAllocationBuilder.build());
@@ -284,7 +286,8 @@ public class OpenRoadmOtnInterface221 {
                     .forEach(nbr -> tribSlots.add(Uint16.valueOf(nbr)));
             ParentOduAllocationBuilder parentOduAllocationBuilder = new ParentOduAllocationBuilder()
                     // set trib port numbers
-                    .setTribPortNumber(tribPortNumber).setTribSlots(tribSlots);
+                    .setTribPortNumber(tribPortNumber)
+                    .setTribSlots(tribSlots);
             oduIfBuilder.setOduFunction(ODUCTP.class)
                     .setMonitoringMode(OduAttributes.MonitoringMode.Monitored)
                     .setParentOduAllocation(parentOduAllocationBuilder.build());