@Override public void roleChanged(DeviceId deviceId, MastershipRole newRole) { switch (newRole) { case MASTER: controller.setRole(dpid(deviceId.uri()), RoleState.MASTER); break; case STANDBY: controller.setRole(dpid(deviceId.uri()), RoleState.EQUAL); break; case NONE: controller.setRole(dpid(deviceId.uri()), RoleState.SLAVE); break; default: LOG.error("Unknown Mastership state : {}", newRole); } LOG.debug("Accepting mastership role change to {} for device {}", newRole, deviceId); }