Interface NotificationPreferenceManager
-
@Role public interface NotificationPreferenceManager
Provide an interface for interacting with user notification preferences.- Since:
- 9.7RC1
- Version:
- $Id: 6752b4b0afd6c3fcc112627fe27e4afa303111af $
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description List<NotificationPreference>
getAllPreferences(org.xwiki.model.reference.DocumentReference user)
Get a list of registeredNotificationPreference
for the given user.List<NotificationPreference>
getAllPreferences(org.xwiki.model.reference.WikiReference wiki)
Get a list of registered and/or inheritedNotificationPreference
for the given wiki.List<NotificationPreference>
getPreferences(org.xwiki.model.reference.DocumentReference user, boolean isEnabled, NotificationFormat format)
Get a list of registeredNotificationPreference
for the given user.void
savePreferences(List<NotificationPreference> preferences)
Save the givenNotificationPreference
.void
setStartDateForUser(org.xwiki.model.reference.DocumentReference user, Date startDate)
Update the start date for every notification preference that the user has.
-
-
-
Method Detail
-
getAllPreferences
List<NotificationPreference> getAllPreferences(org.xwiki.model.reference.DocumentReference user) throws NotificationException
Get a list of registeredNotificationPreference
for the given user.- Parameters:
user
- the user to use- Returns:
- every
NotificationPreference
linked to this user - Throws:
NotificationException
- if an error occurs
-
getAllPreferences
List<NotificationPreference> getAllPreferences(org.xwiki.model.reference.WikiReference wiki) throws NotificationException
Get a list of registered and/or inheritedNotificationPreference
for the given wiki.- Parameters:
wiki
- the wiki to use- Returns:
- every
NotificationPreference
linked to this wiki - Throws:
NotificationException
- if an error occurs- Since:
- 9.11.4, 10.2
-
getPreferences
List<NotificationPreference> getPreferences(org.xwiki.model.reference.DocumentReference user, boolean isEnabled, NotificationFormat format) throws NotificationException
Get a list of registeredNotificationPreference
for the given user.- Parameters:
user
- the user to useisEnabled
- should the preference be enabled ?format
- the format of notification described in the preference- Returns:
- a list of
NotificationPreference
- Throws:
NotificationException
- if an error occurs
-
setStartDateForUser
void setStartDateForUser(org.xwiki.model.reference.DocumentReference user, Date startDate) throws NotificationException
Update the start date for every notification preference that the user has.- Parameters:
user
- the user to usestartDate
- the new start date- Throws:
NotificationException
- if an error occurs
-
savePreferences
void savePreferences(List<NotificationPreference> preferences) throws NotificationException
Save the givenNotificationPreference
. If such notification already exists, it will be updated.- Parameters:
preferences
- the list of notification preference to save- Throws:
NotificationException
- if error happens- Since:
- 9.7RC1
-
-