|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.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 | |
|---|---|
java.lang.String |
getCurrentEventToken()
Returns a token that can be used for querying events that have happened after the token was generated. |
Events |
getNewEvents(java.lang.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 memory| Method Detail |
|---|
public java.lang.String getCurrentEventToken()
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 EventStore
public Events getNewEvents(java.lang.String eventToken)
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() again before asking for
new events.
getNewEvents in interface EventStoreeventToken - 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 EventStoreevent - 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 | |||||||||