// We need to disconnect and remove the old switch
// TODO: we notify switch listeners that the switch has been
// removed and then we notify them that the new one has been
// 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