diff options
author | Ashlee Young <ashlee@wildernessvoice.com> | 2015-11-07 09:43:53 -0800 |
---|---|---|
committer | Ashlee Young <ashlee@wildernessvoice.com> | 2015-11-07 09:43:53 -0800 |
commit | 8f92448e4f2f5d9c98036097bdabd1c40166908a (patch) | |
tree | 37a8594f7da7f3a1b6757fdd40d8a6901280e450 /framework/src/onos/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/SegmentRoutingManager.java | |
parent | 571c7bfc8f51e511d3151311f0d87aa999a89624 (diff) |
Updated ONOS sources to commit ID 3f28c6803193d493b636dd3c43e08a3e6b35acca
Change-Id: I08d1eb7ee31b38491b046933c502894d133b2a2d
Signed-off-by: Ashlee Young <ashlee@wildernessvoice.com>
Diffstat (limited to 'framework/src/onos/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/SegmentRoutingManager.java')
-rw-r--r-- | framework/src/onos/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/SegmentRoutingManager.java | 51 |
1 files changed, 35 insertions, 16 deletions
diff --git a/framework/src/onos/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/SegmentRoutingManager.java b/framework/src/onos/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/SegmentRoutingManager.java index b82752d6..787f9347 100644 --- a/framework/src/onos/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/SegmentRoutingManager.java +++ b/framework/src/onos/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/SegmentRoutingManager.java @@ -38,6 +38,8 @@ import org.onosproject.net.config.NetworkConfigEvent; import org.onosproject.net.config.NetworkConfigRegistry; import org.onosproject.net.config.NetworkConfigListener; import org.onosproject.net.config.basics.SubjectFactories; +import org.onosproject.segmentrouting.config.DeviceConfigNotFoundException; +import org.onosproject.segmentrouting.config.DeviceConfiguration; import org.onosproject.segmentrouting.config.SegmentRoutingConfig; import org.onosproject.segmentrouting.grouphandler.DefaultGroupHandler; import org.onosproject.segmentrouting.grouphandler.NeighborSet; @@ -553,7 +555,10 @@ public class SegmentRoutingManager implements SegmentRoutingService { private void processLinkAdded(Link link) { log.debug("A new link {} was added", link.toString()); - + if (!deviceConfiguration.isConfigured(link.src().deviceId())) { + log.warn("Source device of this link is not configured."); + return; + } //Irrespective whether the local is a MASTER or not for this device, //create group handler instance and push default TTP flow rules. //Because in a multi-instance setup, instances can initiate @@ -596,7 +601,7 @@ public class SegmentRoutingManager implements SegmentRoutingService { private void processDeviceAdded(Device device) { log.debug("A new device with ID {} was added", device.id()); - if (deviceConfiguration == null) { + if (deviceConfiguration == null || !deviceConfiguration.isConfigured(device.id())) { log.warn("Device configuration uploading. Device {} will be " + "processed after config completes.", device.id()); return; @@ -608,14 +613,20 @@ public class SegmentRoutingManager implements SegmentRoutingService { // to the switch). To handle this, a default-group-handler instance is necessary // per switch. if (groupHandlerMap.get(device.id()) == null) { - DefaultGroupHandler groupHandler = DefaultGroupHandler. - createGroupHandler(device.id(), - appId, - deviceConfiguration, - linkService, - flowObjectiveService, - nsNextObjStore, - subnetNextObjStore); + DefaultGroupHandler groupHandler; + try { + groupHandler = DefaultGroupHandler. + createGroupHandler(device.id(), + appId, + deviceConfiguration, + linkService, + flowObjectiveService, + nsNextObjStore, + subnetNextObjStore); + } catch (DeviceConfigNotFoundException e) { + log.warn(e.getMessage() + " Aborting processDeviceAdded."); + return; + } groupHandlerMap.put(device.id(), groupHandler); // Also, in some cases, drivers may need extra // information to process rules (eg. Router IP/MAC); and so, we send @@ -667,12 +678,20 @@ public class SegmentRoutingManager implements SegmentRoutingService { // to the switch). To handle this, a default-group-handler instance is necessary // per switch. if (groupHandlerMap.get(device.id()) == null) { - DefaultGroupHandler groupHandler = DefaultGroupHandler - .createGroupHandler(device.id(), appId, - deviceConfiguration, linkService, - flowObjectiveService, - nsNextObjStore, - subnetNextObjStore); + DefaultGroupHandler groupHandler; + try { + groupHandler = DefaultGroupHandler. + createGroupHandler(device.id(), + appId, + deviceConfiguration, + linkService, + flowObjectiveService, + nsNextObjStore, + subnetNextObjStore); + } catch (DeviceConfigNotFoundException e) { + log.warn(e.getMessage() + " Aborting configureNetwork."); + return; + } groupHandlerMap.put(device.id(), groupHandler); // Also, in some cases, drivers may need extra |