Package org.xwiki.notifications.sources
Interface NotificationManager
-
@Role public interface NotificationManager
Get notifications for users.- Since:
- 9.2RC1
- Version:
- $Id: 7be8801f47d00bc74fde332719b401d05db8cfda $
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description List<org.xwiki.notifications.CompositeEvent>
getEvents(String userId, int expectedCount)
Return events to display as notifications concerning the specified user.List<org.xwiki.notifications.CompositeEvent>
getEvents(String userId, int expectedCount, Date untilDate, Date fromDate, List<String> blackList)
Return events to display as notifications concerning the specified user.List<org.xwiki.notifications.CompositeEvent>
getEvents(String userId, int expectedCount, Date untilDate, List<String> blackList)
Return events to display as notifications concerning the specified user.default List<org.xwiki.notifications.CompositeEvent>
getEvents(String userId, org.xwiki.notifications.NotificationFormat format, int expectedCount, Date untilDate, boolean untilDateIncluded, Date fromDate, List<String> blackList)
Return events to display as notifications concerning the specified user.List<org.xwiki.notifications.CompositeEvent>
getEvents(String userId, org.xwiki.notifications.NotificationFormat format, int expectedCount, Date untilDate, Date fromDate, List<String> blackList)
Return events to display as notifications concerning the specified user.long
getEventsCount(String userId, int maxCount)
Return the number of events to display as notifications concerning the specified user.List<NotificationPreference>
getPreferences()
List<NotificationPreference>
getPreferences(String userId)
void
setStartDate(String userId, Date startDate)
Set the start date for every notification preference of the given user.
-
-
-
Method Detail
-
getEvents
List<org.xwiki.notifications.CompositeEvent> getEvents(String userId, int expectedCount) throws org.xwiki.notifications.NotificationException
Return events to display as notifications concerning the specified user.- Parameters:
userId
- id of the userexpectedCount
- the maximum events to return- Returns:
- the matching events for the user, could be less than expectedCount but not more
- Throws:
org.xwiki.notifications.NotificationException
- if error happens- Since:
- 10.1RC1
-
getEvents
List<org.xwiki.notifications.CompositeEvent> getEvents(String userId, int expectedCount, Date untilDate, List<String> blackList) throws org.xwiki.notifications.NotificationException
Return events to display as notifications concerning the specified user.- Parameters:
userId
- id of the userexpectedCount
- the maximum events to returnuntilDate
- do not return events happened after this dateblackList
- list of ids of blacklisted events to not return (to not get already known events again)- Returns:
- the matching events for the user, could be less than expectedCount but not more
- Throws:
org.xwiki.notifications.NotificationException
- if error happens- Since:
- 10.1RC1
-
getEvents
List<org.xwiki.notifications.CompositeEvent> getEvents(String userId, int expectedCount, Date untilDate, Date fromDate, List<String> blackList) throws org.xwiki.notifications.NotificationException
Return events to display as notifications concerning the specified user.- Parameters:
userId
- id of the userexpectedCount
- the maximum events to returnuntilDate
- do not return events happened after this datefromDate
- do not return events happened before this dateblackList
- list of ids of blacklisted events to not return (to not get already known events again)- Returns:
- the matching events for the user, could be less than expectedCount but not more
- Throws:
org.xwiki.notifications.NotificationException
- if error happens- Since:
- 10.1RC1
-
getEvents
List<org.xwiki.notifications.CompositeEvent> getEvents(String userId, org.xwiki.notifications.NotificationFormat format, int expectedCount, Date untilDate, Date fromDate, List<String> blackList) throws org.xwiki.notifications.NotificationException
Return events to display as notifications concerning the specified user.- Parameters:
userId
- id of the userformat
- format of the notificationsexpectedCount
- the maximum events to returnuntilDate
- do not return events happened after this datefromDate
- do not return events happened before this dateblackList
- list of ids of blacklisted events to not return (to not get already known events again)- Returns:
- the matching events for the user, could be less than expectedCount but not more
- Throws:
org.xwiki.notifications.NotificationException
- if error happens- Since:
- 10.1RC1
-
getEvents
default List<org.xwiki.notifications.CompositeEvent> getEvents(String userId, org.xwiki.notifications.NotificationFormat format, int expectedCount, Date untilDate, boolean untilDateIncluded, Date fromDate, List<String> blackList) throws org.xwiki.notifications.NotificationException
Return events to display as notifications concerning the specified user.- Parameters:
userId
- id of the userformat
- format of the notificationsexpectedCount
- the maximum events to returnuntilDate
- do not return events happened after this dateuntilDateIncluded
- true if the passeduntilDate
should be includedfromDate
- do not return events happened before this dateblackList
- list of ids of blacklisted events to not return (to not get already known events again)- Returns:
- the matching events for the user, could be less than expectedCount but not more
- Throws:
org.xwiki.notifications.NotificationException
- if error happens- Since:
- 12.6.1, 12.7RC1
-
getEventsCount
long getEventsCount(String userId, int maxCount) throws org.xwiki.notifications.NotificationException
Return the number of events to display as notifications concerning the specified user.- Parameters:
userId
- id of the usermaxCount
- maximum number of events to count- Returns:
- the list of events to display as notifications
- Throws:
org.xwiki.notifications.NotificationException
- if an error happens- Since:
- 10.1RC1
-
setStartDate
void setStartDate(String userId, Date startDate) throws org.xwiki.notifications.NotificationException
Set the start date for every notification preference of the given user.- Parameters:
userId
- the id of the userstartDate
- the date before which we ignore notifications- Throws:
org.xwiki.notifications.NotificationException
- if an error happens
-
getPreferences
List<NotificationPreference> getPreferences() throws org.xwiki.notifications.NotificationException
- Returns:
- the list of notifications preferences for the current user
- Throws:
org.xwiki.notifications.NotificationException
- if an error happens
-
getPreferences
List<NotificationPreference> getPreferences(String userId) throws org.xwiki.notifications.NotificationException
- Parameters:
userId
- id of the user- Returns:
- the list of notifications preferences for a given user
- Throws:
org.xwiki.notifications.NotificationException
- if an error happens
-
-