| 构造器和说明 |
|---|
EventStore(android.content.Context context,
int sendLimit)
Creates a new Event Store
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
add(DataLoad dataLoad)
Adds an event to the database.
|
void |
close()
Closes the database
|
static java.util.Map<java.lang.String,java.lang.String> |
deserializer(byte[] bytes)
Converts a byte array back into an
event map for sending.
|
java.util.List<java.util.Map<java.lang.String,java.lang.Object>> |
getAllEvents()
Returns a list of all the events in the
database.
|
java.util.List<java.util.Map<java.lang.String,java.lang.Object>> |
getDescEventsInRange(int range)
Returns a descending range of events
from the top of the database.
|
EmittableEvents |
getEmittableEvents()
Returns an EmittableEvents object which
contains events and eventIds within a
defined range of the database.
|
java.util.Map<java.lang.String,java.lang.Object> |
getEvent(long id)
Returns a Map containing the event
payload values, the table row ID and
the date it was created.
|
long |
getLastInsertedRowId()
Returns the last rowId to be
inserted.
|
long |
getSize()
Returns amount of events currently
in the database.
|
long |
insertEvent(DataLoad dataLoad)
Inserts a payload into the database
|
boolean |
isDatabaseOpen()
Returns truth on if database is open.
|
boolean |
isOpen()
whether the store is open
|
void |
open()
Opens a new writable database if it
is currently closed.
|
java.util.List<java.util.Map<java.lang.String,java.lang.Object>> |
queryDatabase(java.lang.String query,
java.lang.String orderBy)
Returns the events that validate a
specific query.
|
boolean |
removeAllEvents()
Empties the database of all events
|
boolean |
removeEvent(long id)
Removes an event from the database
|
static byte[] |
serialize(java.util.Map<java.lang.String,java.lang.String> map)
Converts an event map to a byte
array for storage.
|
public EventStore(android.content.Context context,
int sendLimit)
context - The android context objectsendLimit - The maximum amount of events that can be sent
concurrentlypublic void add(DataLoad dataLoad)
public void open()
public long insertEvent(DataLoad dataLoad)
dataLoad - The event dataLoad to
be storedpublic boolean removeEvent(long id)
removeEvent 在接口中 Storeid - the row id of the eventpublic boolean removeAllEvents()
removeAllEvents 在接口中 Storepublic static byte[] serialize(java.util.Map<java.lang.String,java.lang.String> map)
map - the map containing all
the event parameterspublic static java.util.Map<java.lang.String,java.lang.String> deserializer(byte[] bytes)
bytes - the bytes to be convertedpublic java.util.List<java.util.Map<java.lang.String,java.lang.Object>> queryDatabase(java.lang.String query,
java.lang.String orderBy)
query - the query to be passed against
the databaseorderBy - what to order the query bypublic long getSize()
public long getLastInsertedRowId()
public EmittableEvents getEmittableEvents()
getEmittableEvents 在接口中 Storepublic java.util.Map<java.lang.String,java.lang.Object> getEvent(long id)
id - the row id of the event to getpublic java.util.List<java.util.Map<java.lang.String,java.lang.Object>> getAllEvents()
public java.util.List<java.util.Map<java.lang.String,java.lang.Object>> getDescEventsInRange(int range)
range - amount of rows to takepublic boolean isDatabaseOpen()