diff options
author | Ashlee Young <ashlee@wildernessvoice.com> | 2015-11-22 10:02:05 -0800 |
---|---|---|
committer | Ashlee Young <ashlee@wildernessvoice.com> | 2015-11-22 10:02:05 -0800 |
commit | 77ce3be7567bd01c66d8ee88a93b485666723501 (patch) | |
tree | 283e7f39a501750bbd705fbb91645b20198900f1 /framework/src/onos/apps/optical | |
parent | 00e6500d0813dcbccaaa741ef38cc1eae6d11e07 (diff) |
Removed patch path since changes have been merged upstream to a different path. Updated README with directions.
Change-Id: Ie419abd2d3d3ef7315de9f607dcd757a78190995
Signed-off-by: Ashlee Young <ashlee@wildernessvoice.com>
Diffstat (limited to 'framework/src/onos/apps/optical')
-rw-r--r-- | framework/src/onos/apps/optical/src/main/java/org/onosproject/optical/OpticalPathProvisioner.java | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/framework/src/onos/apps/optical/src/main/java/org/onosproject/optical/OpticalPathProvisioner.java b/framework/src/onos/apps/optical/src/main/java/org/onosproject/optical/OpticalPathProvisioner.java index e0545023..3890bb4a 100644 --- a/framework/src/onos/apps/optical/src/main/java/org/onosproject/optical/OpticalPathProvisioner.java +++ b/framework/src/onos/apps/optical/src/main/java/org/onosproject/optical/OpticalPathProvisioner.java @@ -343,6 +343,7 @@ public class OpticalPathProvisioner { return getIntents(crossConnectPoints); } + log.warn("Unable to find multi-layer path."); return Collections.emptyList(); } @@ -392,20 +393,41 @@ public class OpticalPathProvisioner { } /** - * Verifies if given link is cross-connect between packet and optical layer. + * Verifies if given device type is in packet layer, i.e., ROADM, OTN or ROADM_OTN device. + * + * @param type device type + * @return true if in packet layer, false otherwise + */ + private boolean isPacketLayer(Device.Type type) { + return type == Device.Type.SWITCH || type == Device.Type.ROUTER; + } + + /** + * Verifies if given device type is in packet layer, i.e., switch or router device. + * + * @param type device type + * @return true if in packet layer, false otherwise + */ + private boolean isTransportLayer(Device.Type type) { + return type == Device.Type.ROADM || type == Device.Type.OTN || type == Device.Type.ROADM_OTN; + } + + /** + * Verifies if given link forms a cross-connection between packet and optical layer. * * @param link the link - * @return true if the link is a cross-connect link + * @return true if the link is a cross-connect link, false otherwise */ - public static boolean isCrossConnectLink(Link link) { + private boolean isCrossConnectLink(Link link) { if (link.type() != Link.Type.OPTICAL) { return false; } - checkNotNull(link.annotations()); - checkNotNull(link.annotations().value("optical.type")); + Device.Type src = deviceService.getDevice(link.src().deviceId()).type(); + Device.Type dst = deviceService.getDevice(link.dst().deviceId()).type(); - return link.annotations().value("optical.type").equals("cross-connect"); + return src != dst && + ((isPacketLayer(src) && isTransportLayer(dst)) || (isPacketLayer(dst) && isTransportLayer(src))); } } |