Package org.xwiki.notifications.filters
Interface NotificationFilterPreferenceManager
-
@Role public interface NotificationFilterPreferenceManager
Provide an interface for interacting with user notification filters preferences.- Since:
- 10.9
- Version:
- $Id: 7ae0af8c35e86960f23cbaa93be172a0012c1189 $
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
deleteFilterPreference(DocumentReference user, String filterPreferenceId)
Delete a filter preference.default void
deleteFilterPreference(WikiReference wikiReference, String filterPreferenceId)
Delete a filter preference.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.void
saveFilterPreferences(DocumentReference user, Set<NotificationFilterPreference> notificationFilterPreferences)
Save the given set ofNotificationFilterPreference
against their respectiveNotificationFilterPreferenceProvider
.void
setFilterPreferenceEnabled(DocumentReference user, String filterPreferenceId, boolean enabled)
Enable or disable a filter preference.default void
setFilterPreferenceEnabled(WikiReference wikiReference, String filterPreferenceId, boolean enabled)
Enable or disable a filter preference.void
setStartDateForUser(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
@Unstable 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 ofNotificationFilterPreference
against their respectiveNotificationFilterPreferenceProvider
.- Parameters:
user
- the user to usenotificationFilterPreferences
- a set ofNotificationFilterPreference
to 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
-
deleteFilterPreference
@Unstable 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
@Unstable 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
-
-