Interface NotificationPreferenceProvider
-
@Role public interface NotificationPreferenceProvider
Provides notifications preferences from multiple sources.- Since:
- 9.7RC1
- Version:
- $Id: 03637cfa12055189c8bbf302735434f2be7bd967 $
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description List<NotificationPreference>
getPreferencesForUser(org.xwiki.model.reference.DocumentReference user)
Get every registeredNotificationPreference
for the given user.List<NotificationPreference>
getPreferencesForWiki(org.xwiki.model.reference.WikiReference wiki)
Get every registered and/or inheritedNotificationPreference
for the given wiki.int
getProviderPriority()
Get the priority that the preferences given by this provider should have.void
savePreferences(List<NotificationPreference> preferences)
Save a given list of preferences.
-
-
-
Method Detail
-
getProviderPriority
int getProviderPriority()
Get the priority that the preferences given by this provider should have. This is useful when different notification preferences are in conflict. The higher is the number, the higher is the priority.- Returns:
- the priority of the provider
-
getPreferencesForUser
List<NotificationPreference> getPreferencesForUser(org.xwiki.model.reference.DocumentReference user) throws NotificationException
Get every registeredNotificationPreference
for the given user.- Parameters:
user
- the user for which to retrieve the notification preferences- Returns:
- a list of notification preferences
- Throws:
NotificationException
- if an error happened
-
getPreferencesForWiki
List<NotificationPreference> getPreferencesForWiki(org.xwiki.model.reference.WikiReference wiki) throws NotificationException
Get every registered and/or inheritedNotificationPreference
for the given wiki.- Parameters:
wiki
- the wiki for which to retrieve the notification preferences- Returns:
- a list of notification preferences
- Throws:
NotificationException
- if an error happened- Since:
- 10.2, 9.11.4
-
savePreferences
void savePreferences(List<NotificationPreference> preferences) throws NotificationException
Save a given list of preferences.- Parameters:
preferences
- theNotificationPreference
to save- Throws:
NotificationException
- if an error occurred
-
-