public void onReceive(Object msg) throws Exception {
// TODO Improvs: replace if-else with HashMap
if (msg instanceof OFEventHandshaked) {
SwitchRef swR = ((OFEventHandshaked) msg).getSwitchRef();
switches.put(swR, getSender());
handshaked(swR);
} else if (msg instanceof OFEventIncoming) {
} else if (msg instanceof OFEventPacketIn) {
SwitchRef swR = ((OFEventPacketIn) msg).getSwitchRef();
OFMessagePacketInRef pIn = ((OFEventPacketIn) msg).getPacketIn();
packetIn(swR, pIn);
} else if (msg instanceof org.flowforwarding.warp.jcontroller.session.OFEventSwitchConfig) {
SwitchRef swR = ((org.flowforwarding.warp.jcontroller.session.OFEventSwitchConfig) msg).getSwitchRef();
OFMessageSwitchConfigRef configH = ((org.flowforwarding.warp.jcontroller.session.OFEventSwitchConfig) msg).getConfigRef();
switchConfig(swR, configH);
} else if (msg instanceof EventGetSwitches) {
System.out.println("[OF-INFO]: Get Switches");