Merge changes I6a0b6de5,I4bab4a65,I4e1c0dae
[transportpce.git] / pce / src / main / java / org / opendaylight / transportpce / pce / PcePathDescription.java
index d0ae6968174cff6cc9470393fecd90b896e43d1d..3049f7c527d20acee3314e65cef5c88a18615149 100644 (file)
@@ -93,6 +93,8 @@ public class PcePathDescription {
             .setAToZ(atozMap);
         switch (rc.getServiceType()) {
             case StringConstants.SERVICE_TYPE_400GE:
+            case StringConstants.SERVICE_TYPE_OTUC2:
+            case StringConstants.SERVICE_TYPE_OTUC3:
             case StringConstants.SERVICE_TYPE_OTUC4:
             case StringConstants.SERVICE_TYPE_100GE_T:
             case StringConstants.SERVICE_TYPE_OTU4:
@@ -105,19 +107,22 @@ public class PcePathDescription {
             case StringConstants.SERVICE_TYPE_10GE:
             case StringConstants.SERVICE_TYPE_1GE:
             case StringConstants.SERVICE_TYPE_ODU4:
+            case StringConstants.SERVICE_TYPE_ODUC2:
+            case StringConstants.SERVICE_TYPE_ODUC3:
             case StringConstants.SERVICE_TYPE_ODUC4:
-                if (rc.getResultTribPortTribSlot().get(0) != null && rc.getResultTribPortTribSlot().get(1) != null) {
+                if (rc.getResultTribPortTribSlot() != null && rc.getResultTribPortTribSlot().get(0) != null
+                    && rc.getResultTribPortTribSlot().get(1) != null) {
                     atoZDirectionBldr.setAToZWavelengthNumber(Uint32.valueOf(0))
                             .setMinTribSlot(rc.getResultTribPortTribSlot().get(0))
                             .setMaxTribSlot(rc.getResultTribPortTribSlot().get(1));
                 } else {
-                    LOG.error("Trib port and trib slot number should be present");
+                    LOG.warn("Trib port and trib slot number should be present");
                     atoZDirectionBldr.setMinTribSlot(new OpucnTribSlotDef("0.0"))
                         .setMaxTribSlot(new OpucnTribSlotDef("0.0"));
                 }
                 break;
             default:
-                LOG.warn("unknown service type : unable to set Min/Max frequencies");
+                LOG.warn("unknown service type : unable to set Min/Max frequencies or trib-port/trib-slot");
                 break;
         }
         return atoZDirectionBldr;
@@ -135,6 +140,8 @@ public class PcePathDescription {
                 .setZToA(ztoaMap);
         switch (rc.getServiceType()) {
             case StringConstants.SERVICE_TYPE_400GE:
+            case StringConstants.SERVICE_TYPE_OTUC2:
+            case StringConstants.SERVICE_TYPE_OTUC3:
             case StringConstants.SERVICE_TYPE_OTUC4:
             case StringConstants.SERVICE_TYPE_100GE_T:
             case StringConstants.SERVICE_TYPE_OTU4:
@@ -147,12 +154,16 @@ public class PcePathDescription {
             case StringConstants.SERVICE_TYPE_10GE:
             case StringConstants.SERVICE_TYPE_1GE:
             case StringConstants.SERVICE_TYPE_ODU4:
-                if (rc.getResultTribPortTribSlot().get(0) != null && rc.getResultTribPortTribSlot().get(1) != null) {
+            case StringConstants.SERVICE_TYPE_ODUC2:
+            case StringConstants.SERVICE_TYPE_ODUC3:
+            case StringConstants.SERVICE_TYPE_ODUC4:
+                if (rc.getResultTribPortTribSlot() != null && rc.getResultTribPortTribSlot().get(0) != null
+                    && rc.getResultTribPortTribSlot().get(1) != null) {
                     ztoADirectionBldr.setZToAWavelengthNumber(Uint32.valueOf(0))
                             .setMinTribSlot(rc.getResultTribPortTribSlot().get(0))
                             .setMaxTribSlot(rc.getResultTribPortTribSlot().get(1));
                 } else {
-                    LOG.error("Trib port and trib slot number should be present");
+                    LOG.warn("Trib port and trib slot number should be present");
                     ztoADirectionBldr.setMinTribSlot(new OpucnTribSlotDef("0.0"))
                         .setMaxTribSlot(new OpucnTribSlotDef("0.0"));
                 }