Class Notifications


  • @Path("2/notifications")
    public class Notifications
    extends Object
    REST interface for the social networking library (notifications).
    • Constructor Summary

      Constructors 
      Constructor Description
      Notifications()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      javax.ws.rs.core.Response catalogue​(org.gcube.social_networking.socialnetworking.model.beans.catalogue.CatalogueEvent event)
      Send a Catalogue notification to a given user
      javax.ws.rs.core.Response getRangeNotifications​(int from, int quantity)
      Retrieve notifications of the token's owner
      javax.ws.rs.core.Response isUserDisabled​(String username)
      Return whether the notifications for this user are enabled or not
      javax.ws.rs.core.Response notifyJobStatus​(org.gcube.social_networking.socialnetworking.model.beans.JobNotificationBean job)
      Send a JOB notification to a given recipient
      javax.ws.rs.core.Response setUserNotifications​(UserSetNotificationBean setting)
      Set user notification enabled or disabled
      javax.ws.rs.core.Response workspace​(org.gcube.social_networking.socialnetworking.model.beans.workspace.WorkspaceEvent event)
      Send a Workspace notification to a given user
    • Constructor Detail

      • Notifications

        public Notifications()
    • Method Detail

      • getRangeNotifications

        @GET
        @Path("get-range-notifications/")
        @Produces("application/json")
        public javax.ws.rs.core.Response getRangeNotifications​(@DefaultValue("1") @QueryParam("from") @Min(value=1L,message="from must be greater or equal to 1")
                                                               int from,
                                                               @DefaultValue("10") @QueryParam("quantity") @Min(value=0L,message="quantity must be greater or equal to 0")
                                                               int quantity)
                                                        throws javax.validation.ValidationException
        Retrieve notifications of the token's owner
        Parameters:
        from - must be greater or equal to 1, range[0, infinity]
        quantity - quantity must be greater or equal to 0
        Returns:
        notifications up to quantity
        Throws:
        javax.validation.ValidationException
      • isUserDisabled

        @GET
        @Path("is-user-disabled/")
        @Produces("application/json")
        public javax.ws.rs.core.Response isUserDisabled​(@QueryParam("username") @NotNull(message="username cannot be null")
                                                        String username)
                                                 throws javax.validation.ValidationException
        Return whether the notifications for this user are enabled or not
        Parameters:
        username - the username you want to check
        Returns:
        true if the notification for the user are disabled (Catalogue and Workspace ones)
        Throws:
        javax.validation.ValidationException
      • setUserNotifications

        @POST
        @Path("set-user-notifications/")
        @Consumes("application/json")
        @Produces("application/json")
        public javax.ws.rs.core.Response setUserNotifications​(@NotNull(message="input is missing")
                                                              UserSetNotificationBean setting)
                                                       throws javax.validation.ValidationException
        Set user notification enabled or disabled
        Parameters:
        disable - true if you want to disable the notifications for this user, false if you want to enable them
        Returns:
        the result of the operation
        Throws:
        javax.validation.ValidationException
      • notifyJobStatus

        @POST
        @Path("notify-job-status/")
        @Consumes("application/json")
        @Produces("application/json")
        public javax.ws.rs.core.Response notifyJobStatus​(@NotNull(message="input is missing")
                                                         org.gcube.social_networking.socialnetworking.model.beans.JobNotificationBean job)
                                                  throws javax.validation.ValidationException
        Send a JOB notification to a given recipient
        Parameters:
        job - The job bean
        Returns:
        Throws:
        javax.validation.ValidationException
      • catalogue

        @POST
        @Path("catalogue/")
        @Consumes("application/json")
        @Produces("application/json")
        public javax.ws.rs.core.Response catalogue​(@NotNull(message="input is missing")
                                                   org.gcube.social_networking.socialnetworking.model.beans.catalogue.CatalogueEvent event)
                                            throws javax.validation.ValidationException,
                                                   org.gcube.vomanagement.usermanagement.exception.UserManagementSystemException,
                                                   org.gcube.vomanagement.usermanagement.exception.UserRetrievalFault
        Send a Catalogue notification to a given user
        Parameters:
        event -
        Returns:
        Throws:
        javax.validation.ValidationException
        org.gcube.vomanagement.usermanagement.exception.UserManagementSystemException
        org.gcube.vomanagement.usermanagement.exception.UserRetrievalFault
      • workspace

        @POST
        @Path("workspace/")
        @Consumes("application/json")
        @Produces("application/json")
        public javax.ws.rs.core.Response workspace​(@NotNull(message="input is missing")
                                                   org.gcube.social_networking.socialnetworking.model.beans.workspace.WorkspaceEvent event)
                                            throws javax.validation.ValidationException
        Send a Workspace notification to a given user
        Parameters:
        event -
        Returns:
        Throws:
        javax.validation.ValidationException