}
updatedPort.setConfig(0);
OFPortMod portMod = new OFPortMod();
if (updateStatus.equals("down")) {
portMod.setConfig(OFPhysicalPort.OFPortConfig.OFPPC_PORT_DOWN
.getValue());
} else if (updateStatus.equals("up")) {
portMod.setConfig(0);
}
portMod.setMask(1);
portMod.setPortNumber(updatedPort.getPortNumber());
portMod.setHardwareAddress(updatedPort.getHardwareAddress());
portMod.setType(OFType.PORT_MOD);
sw.getOutputStream().write(portMod);
sw.getOutputStream().flush();
obj = new JSONObject();
obj.put("result", "success");