public class FileEventStore extends java.lang.Object implements EventStore
| Constructor and Description |
|---|
FileEventStore(java.lang.String projectId,
java.io.File root) |
| Modifier and Type | Method and Description |
|---|---|
void |
acknowledge(java.lang.String collection,
Event event)
Acknowledge a single event has been sent.
|
void |
add(java.lang.String collection,
Event event)
Add a single event to the store.
|
protected java.io.File |
getCollectionDir(java.lang.String collection) |
java.lang.Iterable<Event> |
read(java.lang.String collection)
Read all events for a specific collection.
|
java.util.Map<java.lang.String,java.lang.Iterable<Event>> |
readAll()
Read all events in the store.
|
public FileEventStore(java.lang.String projectId,
java.io.File root)
throws java.io.IOException
java.io.IOExceptionprotected java.io.File getCollectionDir(java.lang.String collection)
throws java.io.IOException
java.io.IOExceptionpublic void add(java.lang.String collection,
Event event)
throws java.io.IOException
EventStoreadd in interface EventStorecollection - Collection for which to add the event.event - Event to add.java.io.IOException - If there is a problem adding the event to the store.public java.lang.Iterable<Event> read(java.lang.String collection) throws java.io.IOException
EventStoreread in interface EventStorecollection - Collection for which to retrieve the events.Iterable of events under that collection.java.io.IOException - If there is a problem reading the events from the store.public java.util.Map<java.lang.String,java.lang.Iterable<Event>> readAll() throws java.io.IOException
EventStorereadAll in interface EventStoreMap of collection names to a list of events in the store.java.io.IOException - If there is a problem reading the events from the store.public void acknowledge(java.lang.String collection,
Event event)
throws java.io.IOException
EventStoreacknowledge in interface EventStorecollection - The collection in which the event belongs.event - The event to acknowledge.java.io.IOException - If there is a problem acknowledging the event.