|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.crowd.event.EventStoreGeneric
public final class EventStoreGeneric
Thread-safe EventStore
implementation that uses main memory as a
backing store. The amount of events stored is fixed, and after reaching the
limit, the oldest events will start to get dropped.
Constructor Summary | |
---|---|
EventStoreGeneric(long maxStoredEvents)
Creates a new EventStoreGeneric instance. |
Method Summary | |
---|---|
String |
getCurrentEventToken()
Returns a token that can be used for querying events that have happened after the token was generated. |
Events |
getNewEvents(String eventToken)
Returns an events object which contains a new eventToken and events that happened after the given eventToken was generated. |
void |
invalidateEvents()
Removes all events from the EventStore. |
void |
storeEvent(OperationEvent event)
Stores the given event. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public EventStoreGeneric(long maxStoredEvents)
maxStoredEvents
- maximum amount of events to keep in the memoryMethod Detail |
---|
public String getCurrentEventToken()
EventStore
If 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 EventStore
public Events getNewEvents(String eventToken) throws EventTokenExpiredException
EventStore
eventToken
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()
again before asking for
new events.
getNewEvents
in interface EventStore
eventToken
- event token that was retrieved by a call to
EventStore.getCurrentEventToken()
or EventStore.getNewEvents(String)
eventToken
was generated.
EventTokenExpiredException
- if events that happened after the
event token was generated can not be retrievedpublic void storeEvent(OperationEvent event)
EventStore
storeEvent
in interface EventStore
event
- event to be storedpublic void invalidateEvents()
EventStore
invalidateEvents
in interface EventStore
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |