| Constructor and Description |
|---|
EncryptedSQLStore(Class<T> modelClass,
android.content.Context context,
com.google.gson.GsonBuilder builder,
IdGenerator idGenerator,
String passphrase) |
EncryptedSQLStore(Class<T> modelClass,
android.content.Context context,
com.google.gson.GsonBuilder builder,
IdGenerator idGenerator,
String passphrase,
String tableName) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
boolean |
isEmpty()
Checks if the storage system contains no stored elements.
|
void |
onCreate(android.database.sqlite.SQLiteDatabase sqLiteDatabase) |
void |
onOpen(android.database.sqlite.SQLiteDatabase db) |
void |
onUpgrade(android.database.sqlite.SQLiteDatabase sqLiteDatabase,
int oldVersion,
int newVersion) |
void |
open(org.jboss.aerogear.android.core.Callback<EncryptedSQLStore<T>> onReady) |
void |
openSync() |
T |
read(Serializable id)
Reads a specific object/record from the underlying storage system.
|
Collection<T> |
readAll()
Reads all the data from the underlying storage system.
|
List<T> |
readWithFilter(org.jboss.aerogear.android.core.ReadFilter filter)
Search for objects/records from the underlying storage system.
|
void |
remove(Serializable id)
Removes a specific object/record from the underlying storage system.
|
void |
reset()
Resets the entire storage system.
|
void |
save(Collection<T> items)
Saves the given objects in the underlying storage system.
|
void |
save(T item)
Saves the given object in the underlying storage system.
|
public EncryptedSQLStore(Class<T> modelClass, android.content.Context context, com.google.gson.GsonBuilder builder, IdGenerator idGenerator, String passphrase)
public EncryptedSQLStore(Class<T> modelClass, android.content.Context context, com.google.gson.GsonBuilder builder, IdGenerator idGenerator, String passphrase, String tableName)
public void onCreate(android.database.sqlite.SQLiteDatabase sqLiteDatabase)
onCreate in class android.database.sqlite.SQLiteOpenHelperpublic void onUpgrade(android.database.sqlite.SQLiteDatabase sqLiteDatabase,
int oldVersion,
int newVersion)
onUpgrade in class android.database.sqlite.SQLiteOpenHelperpublic void onOpen(android.database.sqlite.SQLiteDatabase db)
onOpen in class android.database.sqlite.SQLiteOpenHelperpublic Collection<T> readAll() throws org.jboss.aerogear.android.security.InvalidKeyException, StoreNotOpenException
readAll in interface Store<T>org.jboss.aerogear.android.security.InvalidKeyException - Will occur if you use the wrong passphrase to retrieve the dataStoreNotOpenException - Will occur if this method is called before opening the databasepublic T read(Serializable id) throws org.jboss.aerogear.android.security.InvalidKeyException, StoreNotOpenException
read in interface Store<T>id - id from the desired objectorg.jboss.aerogear.android.security.InvalidKeyException - Will occur if you use the wrong passphrase to retrieve the dataStoreNotOpenException - Will occur if this method is called before opening the databasepublic List<T> readWithFilter(org.jboss.aerogear.android.core.ReadFilter filter)
readWithFilter in interface Store<T>filter - a filter to use to fetch an objectpublic void save(T item) throws StoreNotOpenException
save in interface Store<T>item - Object to saveStoreNotOpenException - Will occur if this method is called before opening the databasepublic void save(Collection<T> items) throws StoreNotOpenException
save in interface Store<T>items - List of objects to saveStoreNotOpenException - Will occur if this method is called before opening the databasepublic void reset()
throws StoreNotOpenException
reset in interface Store<T>StoreNotOpenException - Will occur if this method is called before opening the databasepublic void remove(Serializable id) throws StoreNotOpenException
remove in interface Store<T>id - Id of item to remoteStoreNotOpenException - Will occur if this method is called before opening the databasepublic boolean isEmpty()
throws StoreNotOpenException
isEmpty in interface Store<T>StoreNotOpenException - Will occur if this method is called before opening the databasepublic void open(org.jboss.aerogear.android.core.Callback<EncryptedSQLStore<T>> onReady)
public void openSync()
public void close()
close in class android.database.sqlite.SQLiteOpenHelperCopyright © 2015 JBoss by Red Hat. All rights reserved.