Interface NotificationResource


@Path("notification") public interface NotificationResource
  • Method Details

    • getNotifications

      @GET @Produces("application/json") @RolesAllowed("read:admin") SentNotification[] getNotifications(@BeanParam RequestParams requestParams, @QueryParam("id") Long id, @QueryParam("type") String type, @QueryParam("from") Long fromTimestamp, @QueryParam("to") Long toTimestamp, @QueryParam("realmId") String realmId, @QueryParam("userId") String userId, @QueryParam("assetId") String assetId)
      Gets all sent notifications that have been sent to the specified targets; optionally limiting the scope of the request by AbstractNotificationMessage type and/or sent datetime. If type(s) or timestamp are not set then it is assumed no type or time constraint is required. Can also provide a list of notification IDs to get specific notifications.

      Only the superuser can call this operation.

    • removeNotifications

      @DELETE @RolesAllowed("write:admin") void removeNotifications(@BeanParam RequestParams requestParams, @QueryParam("id") Long id, @QueryParam("type") String type, @QueryParam("from") Long fromTimestamp, @QueryParam("to") Long toTimestamp, @QueryParam("realmId") String realmId, @QueryParam("userId") String userId, @QueryParam("assetId") String assetId)
      Removes all sent notifications that have been sent to the specified targets; optionally limiting the scope of the request by AbstractNotificationMessage type and/or sent datetime. If type(s) or timestamp are not set then it is assumed no type or time constraint is required. Can also provide a list of notification IDs to delete specific notifications.

      Only the superuser can call this operation.

    • removeNotification

      @DELETE @Path("{notificationId}") @RolesAllowed("write:admin") void removeNotification(@BeanParam RequestParams requestParams, @PathParam("notificationId") Long notificationId)
      Remove a specific sent notification by ID.

      Only the superuser can call this operation.

    • sendNotification

      @POST @Path("alert") @Consumes("application/json") void sendNotification(@BeanParam RequestParams requestParams, Notification notification)
      Send a notification to one or more targets; the authorisation of the requesting user will determine whether or not the targets can be contacted; if one or more targets are not accessible due to permissions then the entire request will fail with a 403 response.
    • notificationDelivered

      @PUT @Path("{notificationId}/delivered") void notificationDelivered(@BeanParam RequestParams requestParams, @QueryParam("targetId") String targetId, @PathParam("notificationId") Long notificationId)
      Allows a target to mark a notification as delivered.

      The requesting user must have permission to acknowledge the specified notification otherwise a 403 response is returned.

    • notificationAcknowledged

      @PUT @Path("{notificationId}/acknowledged") @Consumes("application/json") void notificationAcknowledged(@BeanParam RequestParams requestParams, @QueryParam("targetId") String targetId, @PathParam("notificationId") Long notificationId, com.fasterxml.jackson.databind.JsonNode acknowledgement)
      Allows a target to acknowledge a notification with an optional acknowledgement value.

      The requesting user must have permission to acknowledge the specified notification otherwise a 403 response is returned.