Interface WebNotificationStorage


public interface WebNotificationStorage
  • Field Details

    • NOTIFICATION_WEB_SAVED_EVENT

      static final String NOTIFICATION_WEB_SAVED_EVENT
      See Also:
    • NOTIFICATION_WEB_DELETED_EVENT

      static final String NOTIFICATION_WEB_DELETED_EVENT
      See Also:
    • NOTIFICATION_WEB_READ_EVENT

      static final String NOTIFICATION_WEB_READ_EVENT
      See Also:
    • NOTIFICATION_WEB_READ_ALL_EVENT

      static final String NOTIFICATION_WEB_READ_ALL_EVENT
      See Also:
    • NOTIFICATION_WEB_BADGE_UPDATED_EVENT

      static final String NOTIFICATION_WEB_BADGE_UPDATED_EVENT
      Raised whenever a user's badge counter may have changed, whatever the operation that caused it: a notification saved, updated, removed, all of them marked read, or the counter reset when the user opens the notification drawer.

      Unlike the events above, which carry a notification id, this one carries the username as source — which is what a consumer displaying that counter somewhere else needs.

      Freshness is eventual, not immediate. The event is raised from the storage, inside its own transaction and before the caching decorator invalidates the counter, so a listener re-reading getNumberOnBadge straight away may still get the pre-change value. Consumers are expected to be asynchronous and to bound their own staleness — the Application Center badge, for instance, re-reads through its REST endpoint and falls back on its cache TTL. Do not rely on this event as a happens-after barrier for the cached counter.

      See Also:
  • Method Details

    • save

      void save(NotificationInfo notification)
      Creates the new notification message to the specified user. The userId gets from the notification#getTo().
      Parameters:
      notification - the notification
      Since:
      PLF 4.2
      eXo level API
      Platform
    • update

      void update(NotificationInfo notification, boolean moveTop)
      Update an existing notification message.
      Parameters:
      notification - the notification
      moveTop - After updating, MUST move the notification to top of list
      Since:
      PLF 4.2
      eXo level API
      Platform
    • updateNotificationParameters

      default void updateNotificationParameters(String notificationId, Map<String,String> ownerParameters)
      Update an existing notification notification parameters
      Parameters:
      notificationId - the Notification Id
      ownerParameters - parameters to save
    • markRead

      void markRead(String notificationId)
      Marks the notification to be read by the userId
      Parameters:
      notificationId - the Notification Id
      Since:
      PLF 4.2
      eXo level API
      Platform
    • markAllRead

      void markAllRead(String userId)
      Marks all notifications what belong to the user to be read.
      Parameters:
      userId - the userId
      Since:
      PLF 4.2
      eXo level API
      Platform
    • markAllRead

      void markAllRead(List<String> plugins, String username)
    • hidePopover

      void hidePopover(String notificationId)
      Updates the notification's popover status to be FALSE value However it's still showing on View All page.
      Parameters:
      notificationId - the Notification Id
      Since:
      PLF 4.2
      eXo level API
      Platform
    • get

      List<NotificationInfo> get(WebNotificationFilter filter, int offset, int limit)
      Gets the notification list by the given filter. The filter consist of these criteria: + UserId + isPopover TRUE/FALSE + Read TRUE/FALSE
      Parameters:
      filter - the filter condition
      offset -
      limit -
      Returns:
      The notification list matched the given filter
      Since:
      PLF 4.2
      eXo level API
      Platform
    • get

      NotificationInfo get(String notificationId)
      Gets the notification by the Id
      Parameters:
      notificationId -
      Returns:
      the Notification matched the given Id
      Since:
      PLF 4.2
      eXo level API
      Platform
    • remove

      boolean remove(String notificationId)
      Removes the notification by given Id
      Parameters:
      notificationId - the Id of the notification
      Since:
      PLF 4.2
      eXo level API
      Platform
    • remove

      boolean remove(String userId, long seconds)
      Remove the NotificationInfo live after X days
      Parameters:
      userId -
      seconds -
      Returns:
      Returns TRUE if removing successfully Otherwise FALSE
      Since:
      PLF 4.2
      eXo level API
      Platform
    • getUnreadNotification

      NotificationInfo getUnreadNotification(String pluginId, String activityId, String owner)
      Gets the notification by the given conditions
      Parameters:
      pluginId -
      activityId -
      owner -
      Returns:
      Since:
      PLF 4.2
      eXo level API
      Platform
    • getNumberOnBadge

      int getNumberOnBadge(String userId)
      Gets the number on the badge by the specified user
      Parameters:
      userId - the userId
      Returns:
      Since:
      PLF 4.2
      eXo level API
      Platform
    • countUnreadByPlugin

      Map<String,Integer> countUnreadByPlugin(String userId)
    • resetNumberOnBadge

      void resetNumberOnBadge(String userId)
      Reset the number on badge of the specified user
      Parameters:
      userId - the userId
      Since:
      PLF 4.2
      eXo level API
      Platform
    • resetNumberOnBadge

      void resetNumberOnBadge(List<String> plugins, String username)
    • remove

      boolean remove(long seconds)
      Remove the NotificationInfo live after X days
      Parameters:
      seconds -
      Returns:
      Returns TRUE if removing successfully Otherwise FALSE
      Since:
      PLF 4.2
      eXo level API
      Platform