// added. One could argue that a switchChanged notification
// might be more appropriate in this case....
oldSw.cancelAllStatisticsReplies();
addUpdateToQueue(new SwitchUpdate(dpid,
SwitchUpdateType.REMOVED));
oldSw.disconnectOutputStream();
// Add the new switch and clear FlowMods
// TODO: if this is the same switch re-connecting rather than
// a DPID collision it would make sense to not wipe the flow
// table.
sw.clearAllFlowMods();