fixing OpticalIntentUtility for support of intents from client port to client port
Change-Id: I7505abf249e8ece5643c7f7ddac07d6e7107b277
(cherry picked from commit f672231654a4a775662137e8d3a297192f856f5e)
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 4a6af72..8aea7c9 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 @@
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 @@
.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 @@
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 @@
.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 2cb1143..4643d7b 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 @@
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");
}