public class Database
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
void |
closeDatabase()
Close the database.
|
<any> |
deleteOrphanedEvents(java.lang.String[] ids)
Delete orphaned events (events returned in message query related to some message that was send later then messages obtained from the query.
|
static Database |
getInstance(android.app.Application app,
boolean resetDBHelperInstance,
Logger log)
Creates database controller and new database instance if wasn't created yet or parameter reset was set to true.
|
<any> |
queryOrphanedEvents(java.lang.String[] ids)
Query orphaned events (events returned in message query related to some message that was send later then messages obtained from the query.
|
void |
resetDatabase()
Recreates empty database.
|
<any> |
save(java.util.List<OrphanedEvent> events)
Save orphaned events (events returned in message query related to some message that was send later then messages obtained from the query.
|
public static Database getInstance(android.app.Application app, boolean resetDBHelperInstance, Logger log)
app - Application instance.resetDBHelperInstance - True if underlying db helper should be recreated. This should be set to true only for tests.log - Logger instance to use Foundation logging mechanism.public <any> save(java.util.List<OrphanedEvent> events)
events - Orphaned events to insert.public <any> queryOrphanedEvents(java.lang.String[] ids)
ids - Message unique identifiers for a message that the orphaned events are updating.public <any> deleteOrphanedEvents(java.lang.String[] ids)
ids - Events unique identifiers for orophaned events that should be deleted from database.public void resetDatabase()
public void closeDatabase()