Class Notification
- java.lang.Object
-
- org.xwiki.notifications.rest.model.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 Summary
Constructors Constructor Description Notification(org.xwiki.notifications.CompositeEvent compositeEvent, Boolean read, String html, String exception, org.xwiki.model.reference.EntityReferenceSerializer<String> entityReferenceSerializer)
Construct a Notification.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Collection<Date>
getDates()
String
getDocument()
String
getException()
String
getHtml()
Collection<String>
getIds()
String
getType()
Boolean
isRead()
-
-
-
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 handlingread
- either or not the current usr has already read this notificationhtml
- html version of the notificationexception
- stacktrace of an exception if an error has occurred while rendering this notificationentityReferenceSerializer
- 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
-
-