Package org.xwiki.eventstream
Interface EventStore
-
@Role public interface EventStore
Save and access store events.- Since:
- 12.4RC1
- Version:
- $Id: 4e538af7c52b07e619c18a6ced863edf369d304b $
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description CompletableFuture<Optional<Event>>
deleteEvent(String eventId)
Asynchronously deleted the event matching the passed identifier and all associated statuses.CompletableFuture<Optional<Event>>
deleteEvent(Event event)
Asynchronously deleted the event.CompletableFuture<Optional<EventStatus>>
deleteEventStatus(EventStatus status)
Asynchronously delete from the store the given status.CompletableFuture<Void>
deleteEventStatuses(String entityId, Date date)
Asynchronously delete from the store all the status associated with the passed entity and before the passed date.CompletableFuture<Optional<EventStatus>>
deleteMailEntityEvent(EntityEvent event)
Asynchronously delete from the store the given mail status.Optional<Event>
getEvent(String eventId)
Get the event matching the passed identifier.default List<EventStatus>
getEventStatuses(Collection<Event> events, Collection<String> entityIds)
Get the list of statuses concerning the given events and the given entities.CompletableFuture<Event>
prefilterEvent(Event event)
Asynchronously update the event to indicate that it's been pre filtered.CompletableFuture<Event>
saveEvent(Event event)
Asynchronously save in the store the given event.CompletableFuture<EventStatus>
saveEventStatus(EventStatus status)
Asynchronously save in the storage the given status.CompletableFuture<EventStatus>
saveMailEntityEvent(EntityEvent event)
Asynchronously save in the storage the given mail status.EventSearchResult
search(EventQuery query)
Search for event according to condition provided by theEventQuery
.EventSearchResult
search(EventQuery query, Set<String> fields)
Search for event according to condition provided by theEventQuery
.
-
-
-
Method Detail
-
saveEvent
CompletableFuture<Event> saveEvent(Event event)
Asynchronously save in the store the given event.- Parameters:
event
- the event to save- Returns:
- the new
CompletableFuture
providing the addedEvent
- Since:
- 12.5RC1
- See Also:
deleteEvent(Event)
-
saveEventStatus
CompletableFuture<EventStatus> saveEventStatus(EventStatus status)
Asynchronously save in the storage the given status.- Parameters:
status
- the status to save- Returns:
- the new
CompletableFuture
providing the addedEventStatus
- Since:
- 12.5RC1
- See Also:
deleteEventStatus(EventStatus)
-
saveMailEntityEvent
CompletableFuture<EventStatus> saveMailEntityEvent(EntityEvent event)
Asynchronously save in the storage the given mail status.- Parameters:
event
- the status to save- Returns:
- the new
CompletableFuture
providing the addedEntityEvent
- Since:
- 12.6
- See Also:
deleteMailEntityEvent(EntityEvent)
-
deleteEvent
CompletableFuture<Optional<Event>> deleteEvent(String eventId)
Asynchronously deleted the event matching the passed identifier and all associated statuses.- Parameters:
eventId
- the unique identifier of the event- Returns:
- the new
CompletableFuture
providing the deletedEvent
or empty if none could be found - Since:
- 12.5RC1
- See Also:
saveEvent(Event)
-
deleteEvent
CompletableFuture<Optional<Event>> deleteEvent(Event event)
Asynchronously deleted the event. Do nothing if the passed event does not exist.- Parameters:
event
- the event to remove from the store- Returns:
- the new
CompletableFuture
providing the deletedEvent
or empty if none could be found - Since:
- 12.5RC1
- See Also:
saveEvent(Event)
-
deleteEventStatus
CompletableFuture<Optional<EventStatus>> deleteEventStatus(EventStatus status)
Asynchronously delete from the store the given status.- Parameters:
status
- the status to delete- Returns:
- the new
CompletableFuture
providing the deletedEventStatus
or empty if none could be found - Since:
- 12.5RC1
- See Also:
saveEventStatus(EventStatus)
-
deleteEventStatuses
CompletableFuture<Void> deleteEventStatuses(String entityId, Date date)
Asynchronously delete from the store all the status associated with the passed entity and before the passed date.- Parameters:
entityId
- the id of the entity for which to remove the statusesdate
- the date before which to remove the statuses- Returns:
- the new
CompletableFuture
providing the deletedEventStatus
or empty if none could be found - Since:
- 12.6
-
deleteMailEntityEvent
CompletableFuture<Optional<EventStatus>> deleteMailEntityEvent(EntityEvent event)
Asynchronously delete from the store the given mail status.- Parameters:
event
- the status to delete- Returns:
- the new
CompletableFuture
providing the deletedEntityEvent
or empty if none could be found - Since:
- 12.5RC1
- See Also:
saveMailEntityEvent(EntityEvent)
-
prefilterEvent
CompletableFuture<Event> prefilterEvent(Event event)
Asynchronously update the event to indicate that it's been pre filtered.- Parameters:
event
- the event to update- Returns:
- the new
CompletableFuture
providing the updatedEvent
- Since:
- 12.6
-
getEvent
Optional<Event> getEvent(String eventId) throws EventStreamException
Get the event matching the passed identifier.- Parameters:
eventId
- the unique identifier of the event- Returns:
- the event corresponding to the passed id or null of none could be found
- Throws:
EventStreamException
- when failing to get the event
-
search
EventSearchResult search(EventQuery query) throws EventStreamException
Search for event according to condition provided by theEventQuery
.- Parameters:
query
- the query containing the filtering conditions- Returns:
- the result of the search
- Throws:
EventStreamException
- when failing to execute the search
-
search
EventSearchResult search(EventQuery query, Set<String> fields) throws EventStreamException
Search for event according to condition provided by theEventQuery
.- Parameters:
query
- the query containing the filtering conditionsfields
- the fields included in the result, null or empty means all fields- Returns:
- the result of the search
- Throws:
EventStreamException
- when failing to execute the search- Since:
- 12.6
-
getEventStatuses
default List<EventStatus> getEventStatuses(Collection<Event> events, Collection<String> entityIds) throws Exception
Get the list of statuses concerning the given events and the given entities.- Parameters:
events
- a list of eventsentityIds
- a list of ids of entities (users and groups)- Returns:
- the list of statuses corresponding to each pair or event/entity
- Throws:
Exception
- if an error occurs- Since:
- 14.6RC1
-
-