From f4e35e7d2d2ddb219bd54a3e56869ef09bc0c10f Mon Sep 17 00:00:00 2001 From: alessio Date: Tue, 12 Feb 2019 16:43:36 +0100 Subject: [PATCH] fixing OpticalIntentUtility for support of intents from client port to client port Change-Id: I7505abf249e8ece5643c7f7ddac07d6e7107b277 (cherry picked from commit f672231654a4a775662137e8d3a297192f856f5e) --- .../net/optical/util/OpticalIntentUtility.java | 10 ++++++---- .../net/optical/rest/OpticalIntentsWebResource.java | 2 ++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/apps/optical-model/src/main/java/org/onosproject/net/optical/util/OpticalIntentUtility.java b/apps/optical-model/src/main/java/org/onosproject/net/optical/util/OpticalIntentUtility.java index 4a6af722af..8aea7c92fb 100644 --- a/apps/optical-model/src/main/java/org/onosproject/net/optical/util/OpticalIntentUtility.java +++ b/apps/optical-model/src/main/java/org/onosproject/net/optical/util/OpticalIntentUtility.java @@ -93,7 +93,8 @@ public final class OpticalIntentUtility { CltSignalType signalType = ((OduCltPort) srcPort).signalType(); if (Type.ROADM.equals(srcDevice.type()) || Type.ROADM_OTN.equals(srcDevice.type()) || - Type.OLS.equals(srcDevice.type())) { + Type.OLS.equals(srcDevice.type()) || + Type.TERMINAL_DEVICE.equals(srcDevice.type())) { intent = OpticalCircuitIntent.builder() .appId(appId) .key(key) @@ -102,7 +103,7 @@ public final class OpticalIntentUtility { .signalType(signalType) .bidirectional(bidirectional) .build(); - } else if (Type.OTN.equals(srcDevice.type()) || Type.TERMINAL_DEVICE.equals(srcDevice.type())) { + } else if (Type.OTN.equals(srcDevice.type())) { intent = OpticalOduIntent.builder() .appId(appId) .key(key) @@ -176,7 +177,8 @@ public final class OpticalIntentUtility { CltSignalType signalType = ((OduCltPort) srcPort).signalType(); if (Type.ROADM.equals(srcDevice.type()) || Type.ROADM_OTN.equals(srcDevice.type()) || - Type.OLS.equals(srcDevice.type())) { + Type.OLS.equals(srcDevice.type()) || + Type.TERMINAL_DEVICE.equals(srcDevice.type())) { intent = OpticalCircuitIntent.builder() .appId(appId) .key(key) @@ -185,7 +187,7 @@ public final class OpticalIntentUtility { .signalType(signalType) .bidirectional(bidirectional) .build(); - } else if (Type.OTN.equals(srcDevice.type()) || Type.TERMINAL_DEVICE.equals(srcDevice.type())) { + } else if (Type.OTN.equals(srcDevice.type())) { intent = OpticalOduIntent.builder() .appId(appId) .key(key) diff --git a/apps/optical-rest/src/main/java/org/onosproject/net/optical/rest/OpticalIntentsWebResource.java b/apps/optical-rest/src/main/java/org/onosproject/net/optical/rest/OpticalIntentsWebResource.java index 2cb1143ca1..4643d7bce4 100644 --- a/apps/optical-rest/src/main/java/org/onosproject/net/optical/rest/OpticalIntentsWebResource.java +++ b/apps/optical-rest/src/main/java/org/onosproject/net/optical/rest/OpticalIntentsWebResource.java @@ -306,6 +306,8 @@ public class OpticalIntentsWebResource extends AbstractWebResource { Link link = linkService.getLink(srcConnectPoint, dstConnectPoint); if (link == null) { + log.warn("Not existing link in the suggested path src {} dst {}", + srcConnectPoint, dstConnectPoint); throw new IllegalArgumentException("Not existing link in the suggested path"); }