-
public class DatabaseAdapterDatabaseAdapter.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enumDatabaseAdapter.TableTable
-
Method Summary
Modifier and Type Method Description intaddJSON(JSONObject j, DatabaseAdapter.Table table, String token)Adds a JSON string representing an event with properties or a person recordto the SQLiteDatabase. intcleanupEvents(String lastId, DatabaseAdapter.Table table, String token)Removes events with an _id less lan last_id from table. voidcleanupEvents(DatabaseAdapter.Table table, String token)cleanupEvents voidcleanupEvents(long time, DatabaseAdapter.Table table)Removes events before time. Array<String>generateDataString(DatabaseAdapter.Table table, String token, int limit)Returns the data string to send to the serverand the maximum ID of the row that we are sending,so we know what rows to delete when a track request was successful. -
-
Method Detail
-
addJSON
int addJSON(JSONObject j, DatabaseAdapter.Table table, String token)
Adds a JSON string representing an event with properties or a person recordto the SQLiteDatabase.
- Parameters:
j- the JSON to recordtable- the table to insert intotoken- the token this event belongs to
-
cleanupEvents
int cleanupEvents(String lastId, DatabaseAdapter.Table table, String token)
Removes events with an _id less lan last_id from table.
- Parameters:
lastId- the last id to deletetable- the table to remove events fromtoken- the project token; if null, delete all related events.
-
cleanupEvents
void cleanupEvents(DatabaseAdapter.Table table, String token)
cleanupEvents
- Parameters:
table- Tabletoken- App ID
-
cleanupEvents
void cleanupEvents(long time, DatabaseAdapter.Table table)
Removes events before time.
- Parameters:
time- the unix epoch in milliseconds to remove events beforetable- the table to remove events from
-
generateDataString
Array<String> generateDataString(DatabaseAdapter.Table table, String token, int limit)
Returns the data string to send to the serverand the maximum ID of the row that we are sending,so we know what rows to delete when a track request was successful.
- Parameters:
table- the table to read the JSON fromtoken- the token of the project you want to retrieve the records forlimit- the maximum number of rows returned.
-
-
-
-