public class TimestampBasedEventStore extends Object implements EventStore
| Modifier and Type | Field and Description |
|---|---|
static long |
TIMESTAMP_SLOP_TOLERANCE |
| Constructor and Description |
|---|
TimestampBasedEventStore(UserDao userDao,
GroupDao groupDao,
InternalMembershipDao membershipDao,
TombstoneDao tombstoneDao,
Clock clock,
int eventCountLimit) |
TimestampBasedEventStore(UserDao userDao,
TombstoneDao tombstoneDao,
GroupDao groupDao,
InternalMembershipDao membershipDao,
int eventCountLimit) |
| Modifier and Type | Method and Description |
|---|---|
String |
getCurrentEventToken(List<Long> directoryIds)
Returns a token that can be used for querying events that have happened
after the token was generated.
|
Events |
getNewEvents(String eventToken,
Application application)
Returns an events object which contains a new eventToken and events that
happened after the given
eventToken was generated. |
Events |
getNewEvents(String eventToken,
List<Long> directoryIds)
Returns an events object which contains a new eventToken and events that
happened after the given
eventToken was generated. |
void |
handleApplicationEvent(Object event)
Notifies the store that an application event happened that might make it impossible to recreate the event
stream.
|
void |
storeOperationEvent(OperationEvent event)
Stores the given event.
|
public TimestampBasedEventStore(UserDao userDao, TombstoneDao tombstoneDao, GroupDao groupDao, InternalMembershipDao membershipDao, int eventCountLimit)
public TimestampBasedEventStore(UserDao userDao, GroupDao groupDao, InternalMembershipDao membershipDao, TombstoneDao tombstoneDao, Clock clock, int eventCountLimit)
public String getCurrentEventToken(List<Long> directoryIds)
EventStoreIf the event token has not changed since the last call to this method, it is guaranteed that no new events have been received.
The format of event token is implementation specific and can change without a warning.
getCurrentEventToken in interface EventStoredirectoryIds - the ids of directories that the token should include events for@Transactional public Events getNewEvents(String eventToken, List<Long> directoryIds) throws EventTokenExpiredException
EventStoreeventToken was generated.
If for any reason event store is unable to retrieve events that happened
after the event token was generated, an
EventTokenExpiredException will be thrown. The caller is then
expected to call EventStore.getCurrentEventToken(List) again before asking for
new events.
getNewEvents in interface EventStoreeventToken - event token that was retrieved by a call to
EventStore.getCurrentEventToken(List) or EventStore.getNewEvents(String, List)directoryIds - the ids of directories to retrieve events foreventToken was generated.EventTokenExpiredException - if events that happened after the
event token was generated can not be retrieved@Transactional public Events getNewEvents(String eventToken, Application application) throws EventTokenExpiredException
EventStoreeventToken was generated.
If for any reason event store is unable to retrieve events that happened
after the event token was generated, an
EventTokenExpiredException will be thrown. The caller is then
expected to call EventStore.getCurrentEventToken(List) again before asking for
new events.
getNewEvents in interface EventStoreeventToken - event token that was retrieved by a call to
EventStore.getCurrentEventToken(List) or EventStore.getNewEvents(String, List)application - the application to retrieve events foreventToken was generated.EventTokenExpiredException - if events that happened after the
event token was generated can not be retrievedpublic void storeOperationEvent(OperationEvent event)
EventStorestoreOperationEvent in interface EventStoreevent - event to be storedpublic void handleApplicationEvent(Object event)
EventStorehandleApplicationEvent in interface EventStoreevent - the atlassian-events event triggering the actionCopyright © 2024 Atlassian. All rights reserved.