com.atlassian.crowd.event
Interface EventStore

All Known Implementing Classes:
EventStoreGeneric

public interface EventStore

Represents an event store, which can be used to store events. The amount of events store depends on the implementation and is hidden from the callers.

Since:
2.2

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.
 

Method Detail

getCurrentEventToken

String getCurrentEventToken()
Returns a token that can be used for querying events that have happened after the token was generated.

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.

Returns:
token that can be used for querying events that have happened after the token was generated.

getNewEvents

Events getNewEvents(String eventToken)
                    throws EventTokenExpiredException
Returns an events object which contains a new eventToken and events that happened after the given 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 getCurrentEventToken() again before asking for new events.

Parameters:
eventToken - event token that was retrieved by a call to getCurrentEventToken() or getNewEvents(String)
Returns:
events object which contains a new eventToken and events that happened after the given eventToken was generated.
Throws:
EventTokenExpiredException - if events that happened after the event token was generated can not be retrieved

storeEvent

void storeEvent(OperationEvent event)
Stores the given event. Implementations are free to limit the amount of events stored.

Parameters:
event - event to be stored

invalidateEvents

void invalidateEvents()
Removes all events from the EventStore.



Copyright © 2013 Atlassian. All Rights Reserved.