use of org.onosproject.event.Event in project onos by opennetworkinglab.
the class K8sHostManagerTest method validateEvents.
private void validateEvents(Enum... types) {
int i = 0;
assertEquals("Number of events did not match", types.length, testListener.events.size());
for (Event event : testListener.events) {
assertEquals("Incorrect event received", types[i], event.type());
i++;
}
testListener.events.clear();
}
use of org.onosproject.event.Event in project trellis-control by opennetworkinglab.
the class SegmentRoutingManager method processDeviceRemoved.
private void processDeviceRemoved(Device device) {
dsNextObjStore.entrySet().stream().filter(entry -> entry.getKey().deviceId().equals(device.id())).forEach(entry -> dsNextObjStore.remove(entry.getKey()));
vlanNextObjStore.entrySet().stream().filter(entry -> entry.getKey().deviceId().equals(device.id())).forEach(entry -> vlanNextObjStore.remove(entry.getKey()));
macVlanNextObjStore.entrySet().stream().filter(entry -> entry.getKey().deviceId().equals(device.id())).forEach(entry -> macVlanNextObjStore.remove(entry.getKey()));
portNextObjStore.entrySet().stream().filter(entry -> entry.getKey().deviceId().equals(device.id())).forEach(entry -> portNextObjStore.remove(entry.getKey()));
linkHandler.processDeviceRemoved(device);
DefaultGroupHandler gh = groupHandlerMap.remove(device.id());
if (gh != null) {
gh.shutdown();
}
// Note that a switch going down is associated with all of its links
// going down as well, but it is treated as a single switch down event
// while the link-downs are ignored. We cannot rely on the ordering of
// events - i.e we cannot expect all link-downs to come before the
// switch down - so we purge all seen-links for the switch before
// handling route-path changes for the switch-down
defaultRoutingHandler.populateRoutingRulesForLinkStatusChange(null, null, device.id(), true);
defaultRoutingHandler.purgeEcmpGraph(device.id());
// Removes routes having as target the device down
defaultRoutingHandler.purgeSeenBeforeRoutes(device.id());
// Cleanup all internal groupHandler stores for this device. Should be
// done after all rerouting or rehashing has been completed
groupHandlerMap.entrySet().forEach(entry -> entry.getValue().cleanUpForNeighborDown(device.id()));
phasedRecoveryService.reset(device.id());
// the purgeOnDisconnection device property.
if (deviceConfiguration.isConfigured(device.id())) {
flowObjectiveService.purgeAll(device.id(), appId);
}
}
Aggregations