-
public final class TrackerDatasourceTracker datasource. Wraps SQLite queries (DAO).
-
-
Constructor Summary
Constructors Constructor Description TrackerDatasource(Context context)
-
Method Summary
Modifier and Type Method Description voidclearDB()Clear all content booleanaddEvent(Event event)Add an event to the database List<Event>extractEventsToSend(int limit)Extract a set of events and set their state to SENDING booleanupdateEventsToNew(Array<String> eventIDs)Set the State to NEW for the given events ids booleanupdateEventsToOld(Array<String> eventIDs)Set the State to OLD for the given events ids intdeleteEvents(Array<String> eventIDs)Delete events by their ID intdeleteOverflowEvents(int limit)Delete events if there's too much in DB voidclose()Close the datasource. booleanresetEventStatus()Reset all event to OLD state -
-
Constructor Detail
-
TrackerDatasource
TrackerDatasource(Context context)
-
-
Method Detail
-
clearDB
void clearDB()
Clear all content
-
addEvent
boolean addEvent(Event event)
Add an event to the database
- Parameters:
event- Event to add
-
extractEventsToSend
List<Event> extractEventsToSend(int limit)
Extract a set of events and set their state to SENDING
-
updateEventsToNew
boolean updateEventsToNew(Array<String> eventIDs)
Set the State to NEW for the given events ids
-
updateEventsToOld
boolean updateEventsToOld(Array<String> eventIDs)
Set the State to OLD for the given events ids
-
deleteEvents
int deleteEvents(Array<String> eventIDs)
Delete events by their ID
- Parameters:
eventIDs- IDs of the events to delete
-
deleteOverflowEvents
int deleteOverflowEvents(int limit)
Delete events if there's too much in DB
- Parameters:
limit- maximum number of events wanted
-
close
void close()
Close the datasource. You should not make any other call to this datasource once this has been called.
-
resetEventStatus
boolean resetEventStatus()
Reset all event to OLD state
-
-
-
-