public class EventStoreManager
extends java.lang.Object
Constructor and Description |
---|
EventStoreManager(java.lang.String filenameSuffix,
Context context,
java.lang.String encryptionKey)
Parameterized constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
deleteAllEvents()
Deletes all the events stored on the filesystem for that unique identifier.
|
boolean |
deleteEvent(java.lang.String eventId)
Deletes a specific event stored on the filesystem.
|
void |
deleteEvents(java.util.Collection<java.lang.String> eventIds)
Deletes the events stored on the filesystem for that unique identifier.
|
void |
enableLogging(boolean enabled)
Disables or enables logging of events.
|
java.util.List<InstrumentationEvent> |
fetchAllEvents()
Returns all the events stored on the filesystem.
|
InstrumentationEvent |
fetchEvent(java.lang.String eventId)
Returns a specific event stored on the filesystem for that unique identifier.
|
int |
getMaxEvents()
Returns the maximum number of events that can be stored.
|
int |
getNumStoredEvents()
Returns number of stored events.
|
boolean |
isLoggingEnabled()
Returns whether logging is enabled or disabled.
|
java.lang.Iterable<InstrumentationEvent> |
iterateAllEvents()
Streams all the events stored on the filesystem.
|
void |
setMaxEvents(int maxEvents)
Sets the maximum number of events that can be stored.
|
void |
storeEvent(InstrumentationEvent event)
Stores an event to the filesystem.
|
void |
storeEvents(java.util.List<InstrumentationEvent> events)
Stores a list of events to the filesystem.
|
public EventStoreManager(java.lang.String filenameSuffix, Context context, java.lang.String encryptionKey)
filenameSuffix
- Filename suffix to uniquely identify this batch of events.
Typically this would be used to batch events for a user or an org.context
- Context.encryptionKey
- Encryption key (must be Base 64 encoded).public void storeEvent(InstrumentationEvent event)
event
- Event to be persisted.public void storeEvents(java.util.List<InstrumentationEvent> events)
events
- List of events.public InstrumentationEvent fetchEvent(java.lang.String eventId)
eventId
- Unique identifier for the event.public java.util.List<InstrumentationEvent> fetchAllEvents()
public java.lang.Iterable<InstrumentationEvent> iterateAllEvents()
public boolean deleteEvent(java.lang.String eventId)
eventId
- Unique identifier for the event.public void deleteEvents(java.util.Collection<java.lang.String> eventIds)
public void deleteAllEvents()
public void enableLogging(boolean enabled)
enabled
- True - if logging should be enabled, False - otherwise.public boolean isLoggingEnabled()
public void setMaxEvents(int maxEvents)
maxEvents
- Maximum number of events.public int getMaxEvents()
public int getNumStoredEvents()