log.trace("Handle switchRemoved. Switch {}; removing links {}",
HexString.toHexString(sw), switchLinks.get(sw));
}
List<LDUpdate> updateList = new ArrayList<LDUpdate>();
updateList.add(new LDUpdate(sw, null,
UpdateOperation.SWITCH_REMOVED));
// add all tuples with an endpoint on this switch to erase list
eraseList.addAll(switchLinks.get(sw));
// Sending the updateList, will ensure the updates in this
// list will be added at the end of all the link updates.
// Thus, it is not necessary to explicitly add these updates
// to the queue.
deleteLinks(eraseList, "Switch Removed", updateList);
} else {
// Switch does not have any links.
updates.add(new LDUpdate(sw, null,
UpdateOperation.SWITCH_REMOVED));
}
} finally {
lock.writeLock().unlock();
}