Class Notification

  • All Implemented Interfaces:
    Serializable

    public class Notification
    extends Object
    implements Serializable
    Represent a serializable version of a notification, retro-compatible with the old notification services.
    Since:
    10.4RC1
    Version:
    $Id: ee182abc1ed32dbdae0f6947d4b3160500099e6b $
    See Also:
    Serialized Form
    • Constructor Detail

      • Notification

        public Notification​(org.xwiki.notifications.CompositeEvent compositeEvent,
                            Boolean read,
                            String html,
                            String exception,
                            org.xwiki.model.reference.EntityReferenceSerializer<String> entityReferenceSerializer)
        Construct a Notification.
        Parameters:
        compositeEvent - composite event that this notification is handling
        read - either or not the current usr has already read this notification
        html - html version of the notification
        exception - stacktrace of an exception if an error has occurred while rendering this notification
        entityReferenceSerializer - serializer to use for document references
    • Method Detail

      • getIds

        public Collection<String> getIds()
        Returns:
        the list of the ids of the events that compose the inner composite event
      • getType

        public String getType()
        Returns:
        the type of the inner composite event
      • isRead

        public Boolean isRead()
        Returns:
        either or not the current usr has already read this notification
      • getDates

        public Collection<Date> getDates()
        Returns:
        the dates of the inner events, sorted by descending order
      • getDocument

        public String getDocument()
        Returns:
        the serialized document reference if the notification concerns a document, null otherwise
      • getHtml

        public String getHtml()
        Returns:
        html version of the notification
      • getException

        public String getException()
        Returns:
        the stacktrace of an exception if an error has occurred while rendering this notification, null otherwise