@RequestMapping(value = "/adminrules/id/{id}", method = RequestMethod.DELETE) public @ResponseStatus(HttpStatus.OK) void delete(@PathVariable("id") Long id) { adminService.delete(id); }
public void remove(Collection<ShortAdminRule> selected) { rules.removeAll(selected); for (ShortAdminRule rule : selected) { adminService().delete(rule.getId()); } }
@Override public Response delete(Long id) throws NotFoundRestEx, InternalErrorRestEx { try { if (!adminRuleAdminService.delete(id)) { LOGGER.warn("Rule not found: " + id); throw new NotFoundRestEx("Rule not found: " + id); } return Response.status(Status.OK).entity("OK\n").build(); } catch (GeoFenceRestEx ex) { // already handled throw ex; } catch (NotFoundServiceEx ex) { LOGGER.warn("Group not found: " + id); throw new NotFoundRestEx("Group not found: " + id); } catch (Exception ex) { LOGGER.error(ex.getMessage(), ex); throw new InternalErrorRestEx(ex.getMessage()); } }