|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectio.keen.client.java.FileEventStore
public class FileEventStore
Implementation of the KeenEventStore interface using the file system
to cache events in between queueing and batch posting.
| Constructor Summary | |
|---|---|
FileEventStore(java.io.File root)
Constructs a new File-based event store. |
|
| Method Summary | |
|---|---|
java.lang.String |
get(java.lang.Object handle)
Gets the event corresponding to the given handle. |
java.lang.String |
getAttempts(java.lang.String projectId,
java.lang.String eventCollection)
Gets the stored attempts String for a given project and collection. |
java.util.Map<java.lang.String,java.util.List<java.lang.Object>> |
getHandles(java.lang.String projectId)
Retrieves a map from collection names to lists of handles currently stored under each collection. |
void |
remove(java.lang.Object handle)
Removes the specified event from the store. |
void |
setAttempts(java.lang.String projectId,
java.lang.String eventCollection,
java.lang.String attemptsString)
Set and stores the attempts String for a given project and collection. |
java.lang.Object |
store(java.lang.String projectId,
java.lang.String eventCollection,
java.lang.String 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 FileEventStore(java.io.File root)
throws java.io.IOException
root - The root directory in which to store queued event files.
java.io.IOException - If the provided root isn't an existing directory.| Method Detail |
|---|
public java.lang.Object store(java.lang.String projectId,
java.lang.String eventCollection,
java.lang.String event)
throws java.io.IOException
store in interface KeenEventStoreprojectId - The ID of the project in which the event should be stored.eventCollection - The name of the collection in which the event should be stored.event - The serialized JSON for the event to store.
java.io.IOException - If there is an error storing the event.
public java.lang.String get(java.lang.Object handle)
throws java.io.IOException
get in interface KeenEventStorehandle - A handle returned from a previous call to KeenEventStore.store(String, String,
String)
or KeenEventStore.getHandles(String).
java.io.IOException - If there is an error retrieving the event.
public void remove(java.lang.Object handle)
throws java.io.IOException
remove in interface KeenEventStorehandle - A handle returned from a previous call to KeenEventStore.store(String, String,
String)
or KeenEventStore.getHandles(String).
java.io.IOException - If there is an error removing the event.
public java.util.Map<java.lang.String,java.util.List<java.lang.Object>> getHandles(java.lang.String projectId)
throws java.io.IOException
KeenClient to retrieve the
events to send in a batch to the Keen server, as well as to remove all successfully posted
events after processing the response.
getHandles in interface KeenEventStoreprojectId - The ID of the project for which to retrieve event handles.
java.io.IOException - If there is an error retrieving the handles.
public java.lang.String getAttempts(java.lang.String projectId,
java.lang.String eventCollection)
throws java.io.IOException
getAttempts in interface KeenAttemptCountingEventStoreprojectId - the project ideventCollection - the collection name
java.io.IOException - exception
public void setAttempts(java.lang.String projectId,
java.lang.String eventCollection,
java.lang.String attemptsString)
throws java.io.IOException
setAttempts in interface KeenAttemptCountingEventStoreprojectId - the project ideventCollection - the collection nameattemptsString - the String to stored for this project and collection
java.io.IOException - exception
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||