if (routes == null || routes.size() == 0)
return new ServerStatus(IStatus.OK, HttpServletResponse.SC_NOT_FOUND, "Host not found", null);
JSONArray deletedRoutesJSON = new JSONArray();
for (Iterator<Route> iterator2 = routes.iterator(); iterator2.hasNext();) {
Route route = iterator2.next();
DeleteRouteCommand deleteRouteCommand = new DeleteRouteCommand(target, route);
IStatus deleteRouteStatus = deleteRouteCommand.doIt();
if (!deleteRouteStatus.isOK())
return deleteRouteStatus;
deletedRoutesJSON.put(route.toJSON());
}
JSONObject result = new JSONObject();
result.put("Routes", deletedRoutesJSON);
return new ServerStatus(Status.OK_STATUS, HttpServletResponse.SC_OK, result);