Class InboxUserNotificationResource

    • Constructor Detail

      • InboxUserNotificationResource

        public InboxUserNotificationResource()
    • Method Detail

      • getComponentId

        public String getComponentId()
        Description copied from interface: SilverpeasWebResource
        Gets the identifier of the component instance to which the requested resource belongs to.
        Returns:
        the identifier of the Silverpeas component instance.
      • get

        @GET
        @Path("{id}")
        @Produces("application/json")
        public InboxUserNotificationEntity get​(@PathParam("id")
                                               long id)
        Gets the JSON representation of notification. If it doesn't exist, a 404 HTTP code is returned. If a problem occurs when processing the request, a 503 HTTP code is returned.
        Returns:
        the response to the HTTP GET request with the JSON representation of the asked data.
      • delete

        @DELETE
        @Path("{id}")
        @Produces("application/json")
        public javax.ws.rs.core.Response delete​(@PathParam("id")
                                                long id)
        Deletes the aimed notification.
      • markAsRead

        @GET
        @Path("{id}/read")
        @Produces("application/json")
        public InboxUserNotificationEntity markAsRead​(@PathParam("id")
                                                      long id)
        Gets the JSON representation of notification. If it doesn't exist, a 404 HTTP code is returned. If a problem occurs when processing the request, a 503 HTTP code is returned.
        Returns:
        the response to the HTTP GET request with the JSON representation of the asked data.
      • getAllPaginated

        @GET
        @Produces("application/json")
        public javax.ws.rs.core.Response getAllPaginated​(@QueryParam("page")
                                                         String page)
        Gets the JSON representation of notification list. If it doesn't exist, a 404 HTTP code is returned. If a problem occurs when processing the request, a 503 HTTP code is returned.
        Returns:
        the response to the HTTP GET request with the JSON representation of the asked data.
      • markAsRead

        @PUT
        @Produces("application/json")
        public javax.ws.rs.core.Response markAsRead​(List<InboxUserNotificationEntity> entities)
        Deletes aime notifications.
      • delete

        @DELETE
        @Produces("application/json")
        public javax.ws.rs.core.Response delete​(List<InboxUserNotificationEntity> entities)
        Deletes aime notifications.
      • asWebEntities

        public List<InboxUserNotificationEntity> asWebEntities​(Collection<SILVERMAILMessage> notifications)
        Converts the list of notification into list of notification web entities.
        Parameters:
        notifications - the notifications to convert.
        Returns:
        the notification web entities.
      • asWebEntity

        public InboxUserNotificationEntity asWebEntity​(SILVERMAILMessage notification)
        Converts the notification into its corresponding web entity.
        If the specified notification isn't defined, then an HTTP 404 error is sent back instead of the entity representation of the notification.
        If the specified notification does not concern the current user, then an HTTP 403 error is sent back.
        Parameters:
        notification - the notification to convert.
        Returns:
        the corresponding notification entity.