Package org.xwiki.notifications.filters
Interface NotificationFilterPreferenceManager
-
@Role public interface NotificationFilterPreferenceManagerProvide an interface for interacting with user notification filters preferences.- Since:
- 10.9
- Version:
- $Id: 048dc872a31819c1498dc38ac4d616a3f6d0c581 $
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voiddeleteFilterPreference(DocumentReference user, String filterPreferenceId)Delete a filter preference.default voiddeleteFilterPreference(WikiReference wikiReference, String filterPreferenceId)Delete a filter preference.default voiddeleteFilterPreferences(DocumentReference user, Set<String> filterPreferenceIds)Delete a set of filter preferences.Stream<NotificationFilterPreference>getFilterPreferences(Collection<NotificationFilterPreference> filterPreferences, NotificationFilter filter)Get from the given filter preferences the ones that match the given filter.Stream<NotificationFilterPreference>getFilterPreferences(Collection<NotificationFilterPreference> filterPreferences, NotificationFilter filter, NotificationFilterType filterType)Get from the given filter preferences the ones that match the given filter and the given filter type.Stream<NotificationFilterPreference>getFilterPreferences(Collection<NotificationFilterPreference> filterPreferences, NotificationFilter filter, NotificationFilterType filterType, NotificationFormat format)Get from the given filter preferences the ones that match the given filter, filter type and format.Collection<NotificationFilterPreference>getFilterPreferences(DocumentReference user)Get the notification filter preferences of the given user.default Collection<NotificationFilterPreference>getFilterPreferences(WikiReference wikiReference)Get the notification filter preferences of the given wiki.voidsaveFilterPreferences(DocumentReference user, Set<NotificationFilterPreference> notificationFilterPreferences)Save the given set ofNotificationFilterPreferenceagainst their respectiveNotificationFilterPreferenceProvider.voidsetFilterPreferenceEnabled(DocumentReference user, String filterPreferenceId, boolean enabled)Enable or disable a filter preference.default voidsetFilterPreferenceEnabled(WikiReference wikiReference, String filterPreferenceId, boolean enabled)Enable or disable a filter preference.voidsetStartDateForUser(DocumentReference user, Date startDate)Update the start date for every filter preference that the user has.
-
-
-
Method Detail
-
getFilterPreferences
Collection<NotificationFilterPreference> getFilterPreferences(DocumentReference user) throws NotificationException
Get the notification filter preferences of the given user.- Parameters:
user- a reference of the user- Returns:
- the list of the notification filter preferences of the given user.
- Throws:
NotificationException- if an error occurs
-
getFilterPreferences
default Collection<NotificationFilterPreference> getFilterPreferences(WikiReference wikiReference) throws NotificationException
Get the notification filter preferences of the given wiki.- Parameters:
wikiReference- a reference of the wiki- Returns:
- the list of the notification filter preferences of the given user.
- Throws:
NotificationException- if an error occurs- Since:
- 13.3RC1
-
getFilterPreferences
Stream<NotificationFilterPreference> getFilterPreferences(Collection<NotificationFilterPreference> filterPreferences, NotificationFilter filter)
Get from the given filter preferences the ones that match the given filter.- Parameters:
filterPreferences- a list of filter preferencesfilter- a notification filter- Returns:
- a stream returning the filter preferences that match the given filter
-
getFilterPreferences
Stream<NotificationFilterPreference> getFilterPreferences(Collection<NotificationFilterPreference> filterPreferences, NotificationFilter filter, NotificationFilterType filterType)
Get from the given filter preferences the ones that match the given filter and the given filter type.- Parameters:
filterPreferences- a list of filter preferencesfilter- a notification filterfilterType- a filter type- Returns:
- a stream returning the filter preferences that match the given filter and filter type
-
getFilterPreferences
Stream<NotificationFilterPreference> getFilterPreferences(Collection<NotificationFilterPreference> filterPreferences, NotificationFilter filter, NotificationFilterType filterType, NotificationFormat format)
Get from the given filter preferences the ones that match the given filter, filter type and format.- Parameters:
filterPreferences- a list of filter preferencesfilter- a notification filterfilterType- a filter typeformat- a notification format- Returns:
- a stream returning the filter preferences that match the given filter, filter type and format
-
saveFilterPreferences
void saveFilterPreferences(DocumentReference user, Set<NotificationFilterPreference> notificationFilterPreferences)
Save the given set ofNotificationFilterPreferenceagainst their respectiveNotificationFilterPreferenceProvider.- Parameters:
user- the user to usenotificationFilterPreferences- a set ofNotificationFilterPreferenceto save- Since:
- 10.11RC1, 10.8.3, 9.11.9
-
deleteFilterPreference
void deleteFilterPreference(DocumentReference user, String filterPreferenceId) throws NotificationException
Delete a filter preference.- Parameters:
user- the user to usefilterPreferenceId- id of the filter preference- Throws:
NotificationException- if an error happens- Since:
- 10.11RC1, 10.8.3, 9.11.9
-
deleteFilterPreferences
@Unstable default void deleteFilterPreferences(DocumentReference user, Set<String> filterPreferenceIds) throws NotificationException
Delete a set of filter preferences.- Parameters:
user- the user to usefilterPreferenceIds- ids of the filter preferences- Throws:
NotificationException- if an error happens- Since:
- 15.10.2, 16.0.0RC1
-
deleteFilterPreference
default void deleteFilterPreference(WikiReference wikiReference, String filterPreferenceId) throws NotificationException
Delete a filter preference.- Parameters:
wikiReference- the wiki reference to usefilterPreferenceId- id of the filter preference- Throws:
NotificationException- if an error happens- Since:
- 13.3RC1
-
setFilterPreferenceEnabled
void setFilterPreferenceEnabled(DocumentReference user, String filterPreferenceId, boolean enabled) throws NotificationException
Enable or disable a filter preference.- Parameters:
user- the user to usefilterPreferenceId- id of the filter preferenceenabled- either or not the filter preference should be enabled- Throws:
NotificationException- if an error happens- Since:
- 10.11RC1, 10.8.3, 9.11.9
-
setFilterPreferenceEnabled
default void setFilterPreferenceEnabled(WikiReference wikiReference, String filterPreferenceId, boolean enabled) throws NotificationException
Enable or disable a filter preference.- Parameters:
wikiReference- the wiki to usefilterPreferenceId- id of the filter preferenceenabled- either or not the filter preference should be enabled- Throws:
NotificationException- if an error happens- Since:
- 13.3RC1
-
setStartDateForUser
void setStartDateForUser(DocumentReference user, Date startDate) throws NotificationException
Update the start date for every filter preference that the user has.- Parameters:
user- the user to usestartDate- the new start date- Throws:
NotificationException- if an error occurs
-
-