Merge "Fix func. tests utils base URL generation issue"
[transportpce.git] / pce / src / main / java / org / opendaylight / transportpce / pce / graph / PceGraph.java
index 9f876f471d34a2a92b1cf48b05a97d56c99375d8..a7a45e765709f05028509b5be8c5f3bdf7965cb3 100644 (file)
@@ -97,7 +97,7 @@ public class PceGraph {
                     pceResult.getResponseCode(), ResponseCodes.RESPONSE_OK);
 
             if (!pceResult.getResponseCode().equals(ResponseCodes.RESPONSE_OK)) {
-                LOG.info("In calcPath: post algo validations DROPPED the path {}", path);
+                LOG.warn("In calcPath: post algo validations DROPPED the path {}", path);
                 continue;
             }
 
@@ -108,19 +108,28 @@ public class PceGraph {
             }
 
             shortestPathAtoZ = new ArrayList<>(pathAtoZ);
-            if ((StringConstants.SERVICE_TYPE_100GE.equals(serviceType))
-                    || (StringConstants.SERVICE_TYPE_OTU4.equals(serviceType))) {
-                LOG.info("In calcPath Path FOUND path for wl [{}], min Freq assignment {}, max Freq assignment {},"
+            switch (serviceType) {
+
+                case StringConstants.SERVICE_TYPE_100GE_T:
+                case StringConstants.SERVICE_TYPE_OTUC2:
+                case StringConstants.SERVICE_TYPE_OTUC3:
+                case StringConstants.SERVICE_TYPE_OTUC4:
+                case StringConstants.SERVICE_TYPE_400GE:
+                case StringConstants.SERVICE_TYPE_OTU4:
+                    LOG.info(
+                        "In calcPath Path FOUND path for wl [{}], min Freq assignment {}, max Freq assignment {},"
                         + " hops {}, distance per metrics {}, path AtoZ {}",
                         pceResult.getResultWavelength(), pceResult.getMinFreq(), pceResult.getMaxFreq(),
                         pathAtoZ.size(), path.getWeight(), pathAtoZ);
-                break;
-            } else {
-                // Service is at OTN layer and is relying on a supporting wavelength service
-                LOG.info("In calcPath Path FOUND path for hops {}, distance per metrics {}, path AtoZ {}",
+                    break;
+
+                default:
+                    LOG.info(
+                        "In calcPath Path FOUND path for hops {}, distance per metrics {}, path AtoZ {}",
                         pathAtoZ.size(), path.getWeight(), pathAtoZ);
-                break;
+                    break;
             }
+            break;
 
         }
 
@@ -228,8 +237,8 @@ public class PceGraph {
             case PropagationDelay :
                 weight = link.getLatency();
                 LOG.debug("In PceGraph PropagationDelay is used as a metrics. {}", link);
-                if ((("1GE".equals(serviceType)) || ("10GE".equals(serviceType)) || ("ODU4".equals(serviceType)))
-                        && (weight == 0)) {
+                if ((weight == 0)
+                        && ("1GE".equals(serviceType) || "10GE".equals(serviceType) || "ODU4".equals(serviceType))) {
                     LOG.warn("PropagationDelay set as metric, but latency is null: is latency set for OTN link {}?",
                         link);
                 }