fixing OpticalIntentUtility for support of intents from client port to client port

Change-Id: I7505abf249e8ece5643c7f7ddac07d6e7107b277
(cherry picked from commit f672231654a4a775662137e8d3a297192f856f5e)
This commit is contained in:
alessio 2019-02-12 16:43:36 +01:00 committed by Andrea Campanella
parent cb7e4ec470
commit f4e35e7d2d
2 changed files with 8 additions and 4 deletions

View File

@ -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)

View File

@ -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");
}