Package org.xwiki.notifications
Class CompositeEvent
- java.lang.Object
-
- org.xwiki.notifications.CompositeEvent
-
public class CompositeEvent extends Object
A group of similar events that compose a "composite" event.- Since:
- 9.4RC1
- Version:
- $Id: d303541880d564a7e979ac664677a409e762e43a $
-
-
Constructor Summary
Constructors Constructor Description CompositeEvent(Event event)
Construct a CompositeEvent.CompositeEvent(CompositeEvent compositeEvent)
Copy constructor ofCompositeEvent
.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
add(Event event)
Add an event to the composite event and order it based on the dates.void
add(Event event, int similarity)
Deprecated.now that we have aGroupingEventStrategy
this method has no real reason to be used,add(Event)
should be used instead.boolean
equals(Object obj)
Date
getDate()
List<Date>
getDates()
org.xwiki.model.reference.DocumentReference
getDocument()
List<String>
getEventIds()
List<Event>
getEvents()
String
getGroupId()
int
getSimilarityBetweenEvents()
Deprecated.this method shouldn't be used anymore now we have aGroupingEventStrategy
String
getType()
Set<org.xwiki.model.reference.DocumentReference>
getUsers()
int
hashCode()
void
remove(Event event)
Remove an event from the current object.
-
-
-
Constructor Detail
-
CompositeEvent
public CompositeEvent(Event event)
Construct a CompositeEvent.- Parameters:
event
- the first event of the composite event
-
CompositeEvent
public CompositeEvent(CompositeEvent compositeEvent)
Copy constructor ofCompositeEvent
.- Parameters:
compositeEvent
- the composite event to copy
-
-
Method Detail
-
add
@Deprecated(since="15.5RC1") public void add(Event event, int similarity) throws NotificationException
Deprecated.now that we have aGroupingEventStrategy
this method has no real reason to be used,add(Event)
should be used instead.Add an event to the composite event.- Parameters:
event
- the event to addsimilarity
- the similarity between the event to add and the events of the composite events- Throws:
NotificationException
- if the addition is illegal (lower similarity for example)
-
add
@Unstable public void add(Event event)
Add an event to the composite event and order it based on the dates.- Parameters:
event
- the event to add- Since:
- 15.5RC1
-
getSimilarityBetweenEvents
@Deprecated(since="15.5RC1") public int getSimilarityBetweenEvents()
Deprecated.this method shouldn't be used anymore now we have aGroupingEventStrategy
- Returns:
- the greatest similarity between events of the composite event
-
getType
public String getType()
- Returns:
- the type of the events that compose the current object
-
getGroupId
public String getGroupId()
- Returns:
- the groupId of the first event of the current object
-
getDocument
public org.xwiki.model.reference.DocumentReference getDocument()
- Returns:
- the document of the first event of the current object
-
getUsers
public Set<org.xwiki.model.reference.DocumentReference> getUsers()
- Returns:
- the users who performed the events
-
getDate
public Date getDate()
- Returns:
- the date of the most recent event
- Since:
- 9.11RC1
-
remove
public void remove(Event event)
Remove an event from the current object.- Parameters:
event
- the event to remove
-
-