class DeleteNotificationByIdAPIController {

    @RequestMapping(value = "/{notificationId}", method = RequestMethod.DELETE, produces = MediaType.APPLICATION_JSON_VALUE)
    @ResponseBody
    public String deleteNotificationById(
            @PathVariable("notificationId") Long id

    ) throws AcmObjectNotFoundException, AcmUserActionFailedException
    {
        if (log.isInfoEnabled())
        {
            log.info("Finding notification with ID: " + id);
        }
        if (id != null)
        {
            try
            {
                JSONObject objectToReturnJSON = new JSONObject();
                getNotificationDao().deleteNotificationById(id);
                log.info("Deleting notification by id '" + id + "'");
                log.debug("Notification ID : " + id);

                objectToReturnJSON.put("deletedNotificationId", id);

                String objectToReturn;
                objectToReturn = objectToReturnJSON.toString();

                return objectToReturn;
            }
            catch (PersistenceException e)
            {
                throw new AcmUserActionFailedException("Delete", "notification", id, e.getMessage(), e);
            }
        }
        throw new AcmObjectNotFoundException("Could not find notification", id, "", null);
    }

}