Interface NotificationFilterManager


  • @Role
    public interface NotificationFilterManager
    Provide an interface for interacting with user notification filters.
    Since:
    9.7RC1
    Version:
    $Id: 3c85ec4ba75fdadeedc6c661644e5bf3276d9cd2 $
    • Method Detail

      • getAllFilters

        Collection<NotificationFilter> getAllFilters​(DocumentReference user,
                                                     boolean onlyEnabled)
                                              throws NotificationException
        Get all notifications filters that are enabled to the given user.
        Parameters:
        user - reference to the user
        onlyEnabled - either or not only filters enabled for the user should be collected
        Returns:
        the collection of notification filters enabled to the user.
        Throws:
        NotificationException - if an error happens
        Since:
        10.4RC1
      • getAllFilters

        default Collection<NotificationFilter> getAllFilters​(DocumentReference user,
                                                             boolean onlyEnabled,
                                                             NotificationFilter.FilteringPhase filteringPhase)
                                                      throws NotificationException
        Get all notifications filters that are enabled to the given user and matching the requested filtering moment.
        Parameters:
        user - reference to the user
        onlyEnabled - either or not only filters enabled for the user should be collected
        filteringPhase - when the filter should be used (null means any phase)
        Returns:
        the collection of notification filters enabled to the user.
        Throws:
        NotificationException - if an error happens
        Since:
        12.9RC1, 12.6.3
      • getFiltersRelatedToNotificationPreference

        Stream<NotificationFilter> getFiltersRelatedToNotificationPreference​(Collection<NotificationFilter> filters,
                                                                             NotificationPreference preference)
        Get from the filters the one that match the given notification preference.
        Parameters:
        filters - a collection of notification filters
        preference - a notification preference
        Returns:
        a stream returning the filters that match the given notification preference.
        Since:
        10.4RC1
      • getToggleableFilters

        Stream<NotificationFilter> getToggleableFilters​(Collection<NotificationFilter> filters)
        Get from the given filter the one that are toggleable.
        Parameters:
        filters - a list of notification filters
        Returns:
        a stream returning the toggeable filters that was on the given collection
        Since:
        10.4RC1
      • getToggeableFilterActivations

        Map<String,​Boolean> getToggeableFilterActivations​(DocumentReference user)
                                                         throws NotificationException
        For all toggeable notification filters, get if the filter is enabled regarding the user profile.
        Parameters:
        user - the user to use
        Returns:
        a map of notification filters with their activation state
        Throws:
        NotificationException - if an error happens
        Since:
        10.4RC1
      • getEnabledFilters

        Stream<NotificationFilter> getEnabledFilters​(Collection<NotificationFilter> filters,
                                                     Map<String,​Boolean> filterActivation)
        Goes through every given NotificationFilter. One of the filters implements ToggleableNotificationFilter, checks if the given user has disabled this filter. If so, remove the filter from the set.
        Parameters:
        filters - the filters that should be examined
        filterActivation - the map of filters associated to their active status
        Returns:
        a set of filters that are not marked as disabled by the user
        Since:
        10.4RC1