public abstract class

AbstractSqliteOfflineStore

extends Object
implements OfflineStore<T>
java.lang.Object
   ↳ com.kinvey.android.offline.AbstractSqliteOfflineStore<T>
Known Direct Subclasses

Class Overview

This class is an implementation of an OfflineStore

This class delegates requests to an appropriate OfflineTable, which is associated with the current collection.

It also enqueues requests in that same OfflineTable, and can start an Android Service to begin background sync.

Summary

Public Constructors
AbstractSqliteOfflineStore(Context context)
Public Methods
void clearStorage(String userid)
KinveyDeleteResponse executeDelete(AbstractClient client, AppData<T> appData, AbstractKinveyOfflineClientRequest request)
Execute a delete against this offline store
T executeGet(AbstractClient client, AppData<T> appData, AbstractKinveyOfflineClientRequest request)
Execute a get request against this offline store.
T executeSave(AbstractClient client, AppData<T> appData, AbstractKinveyOfflineClientRequest request)
Execute a save against this offline store
Context getContext()
void insertEntity(AbstractClient client, AppData<T> appData, T entity)
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.kinvey.java.offline.OfflineStore

Public Constructors

public AbstractSqliteOfflineStore (Context context)

Public Methods

public void clearStorage (String userid)

public KinveyDeleteResponse executeDelete (AbstractClient client, AppData<T> appData, AbstractKinveyOfflineClientRequest request)

Execute a delete against this offline store

Parameters
client - an instance of a client
appData - an instance of AppData
request - an Offline Client Request to be executed (must be a DELETE)
Returns
  • a delete response containing the count of entities deleted

public T executeGet (AbstractClient client, AppData<T> appData, AbstractKinveyOfflineClientRequest request)

Execute a get request against this offline store. This will method will expand the target URI into a String, and then grab the index of character right after "/". This character represents either: an empty string, which is an empty query, an _id, so the GET request is by _id or a query string, beginning with "?query="

Dependant on which case, this method will execute the apppriate GET method on the set DatabaseHandler.

Parameters
client - an instance of a client
appData - an instance of AppData
request - an Offline Client Request to be executed (must be a GET)
Returns
  • the entity or null

public T executeSave (AbstractClient client, AppData<T> appData, AbstractKinveyOfflineClientRequest request)

Execute a save against this offline store

Parameters
client - an instance of a client
appData - an instance of AppData
request - an Offline Client Request to be executed (must be a PUT or POST)
Returns
  • the entity saved

public Context getContext ()

public void insertEntity (AbstractClient client, AppData<T> appData, T entity)