Class NotificationSourcesScriptService

  • All Implemented Interfaces:
    org.xwiki.script.service.ScriptService

    @Component
    @Named("notification.sources")
    @Singleton
    public class NotificationSourcesScriptService
    extends Object
    implements org.xwiki.script.service.ScriptService
    Script service for the notification sources.
    Since:
    9.7RC1
    Version:
    $Id: dec6e766e8d8406470506506761c0c7079fd7d83 $
    • Constructor Detail

      • NotificationSourcesScriptService

        public NotificationSourcesScriptService()
    • Method Detail

      • getEvents

        public List<org.xwiki.notifications.CompositeEvent> getEvents​(int expectedCount)
                                                               throws org.xwiki.notifications.NotificationException
        Parameters:
        expectedCount - number of expected events
        Returns:
        the matching events for the current user, could be less than expectedCount but not more
        Throws:
        org.xwiki.notifications.NotificationException - if error happens
        Since:
        10.1RC1
      • getEvents

        public List<org.xwiki.notifications.CompositeEvent> getEvents​(int expectedCount,
                                                                      Date untilDate,
                                                                      String[] blackList)
                                                               throws org.xwiki.notifications.NotificationException
        Parameters:
        expectedCount - number of expected events
        untilDate - do not return events happened after this date
        blackList - array of events id to exclude from the search
        Returns:
        the matching events for the current user, could be less than expectedCount but not more
        Throws:
        org.xwiki.notifications.NotificationException - if error happens
        Since:
        10.1RC1
      • getEvents

        public List<org.xwiki.notifications.CompositeEvent> getEvents​(int expectedCount,
                                                                      Date untilDate,
                                                                      List<String> blackList)
                                                               throws org.xwiki.notifications.NotificationException
        Parameters:
        expectedCount - number of expected events
        untilDate - do not return events happened after this date
        blackList - list of events id to exclude from the search
        Returns:
        the matching events for the current user, could be less than expectedCount but not more
        Throws:
        org.xwiki.notifications.NotificationException - if error happens
      • getEventsCount

        public long getEventsCount​(int maxCount)
                            throws org.xwiki.notifications.NotificationException
        Return the number of events to display as notifications concerning the current user.
        Parameters:
        maxCount - maximum number of events to count
        Returns:
        the list of events to display as notifications
        Throws:
        org.xwiki.notifications.NotificationException - if an error happens
      • getNotificationParameters

        public NotificationParameters getNotificationParameters​(Map<String,​String> parameters)
                                                         throws org.xwiki.notifications.NotificationException
        Create a NotificationParameters object to be used to retrieve the notifications of the given user.
        Parameters:
        parameters - a map of parameters to use, see the documentation from DefaultNotificationParametersFactory.ParametersKey to see the available parameters and accepted values.
        Returns:
        an instance of NotificationParameters that can be used to retrieve events.
        Throws:
        org.xwiki.notifications.NotificationException - in case of errors.
        Since:
        12.2