Merge changes If4c7fd58,Ib8275ddc
[transportpce.git] / pce / src / main / java / org / opendaylight / transportpce / pce / PcePathDescription.java
index 3e6f154d77b729f27191353948298a030d9ff1cf..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:
@@ -101,22 +103,26 @@ public class PcePathDescription {
                 atoZDirectionBldr.setAToZWavelengthNumber(Uint32.valueOf(rc.getResultWavelength()));
                 break;
             case StringConstants.SERVICE_TYPE_100GE_M:
+            case StringConstants.SERVICE_TYPE_100GE_S:
             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;
@@ -134,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:
@@ -142,15 +150,20 @@ public class PcePathDescription {
                 ztoADirectionBldr.setZToAWavelengthNumber(Uint32.valueOf(rc.getResultWavelength()));
                 break;
             case StringConstants.SERVICE_TYPE_100GE_M:
+            case StringConstants.SERVICE_TYPE_100GE_S:
             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"));
                 }