public class AccountPublicDbSQLHelper extends KDFIterationsAwareSQLOpenHelper
Modifier and Type | Field and Description |
---|---|
protected static String |
ACCOUNTS_TABLE |
protected net.sqlcipher.database.SQLiteDatabase |
db |
protected static String |
FIELD_KEY_COLUMN |
protected static String |
FIELD_VALUE_COLUMN |
protected static String |
IDENTIFIER_ID_COLUMN |
protected static String |
IDENTIFIER_NAME_COLUMN |
protected static String |
PUBLIC_FIELDS_TABLE |
Constructor and Description |
---|
AccountPublicDbSQLHelper(Context context,
SQLiteInitializer sqLiteInitializer) |
Modifier and Type | Method and Description |
---|---|
int |
addAccount(String identifier)
Assumes account does not exist.
|
String |
addField(int identifierId,
String key,
String value) |
Integer |
getAccountId(String identifier) |
Map<String,Map<String,String>> |
getAccounts() |
net.sqlcipher.database.SQLiteDatabase |
getDb() |
void |
onCreate(net.sqlcipher.database.SQLiteDatabase db) |
void |
onUpgrade(net.sqlcipher.database.SQLiteDatabase db,
int oldVersion,
int newVersion) |
boolean |
removeAccount(int identifierId) |
boolean |
removeField(int identifierId,
String key) |
createKDFIterationHook
protected static final String ACCOUNTS_TABLE
protected static final String PUBLIC_FIELDS_TABLE
protected static final String IDENTIFIER_ID_COLUMN
protected static final String IDENTIFIER_NAME_COLUMN
protected static final String FIELD_KEY_COLUMN
protected static final String FIELD_VALUE_COLUMN
protected net.sqlcipher.database.SQLiteDatabase db
@Inject public AccountPublicDbSQLHelper(Context context, SQLiteInitializer sqLiteInitializer)
public void onCreate(net.sqlcipher.database.SQLiteDatabase db)
onCreate
in class net.sqlcipher.database.SQLiteOpenHelper
public void onUpgrade(net.sqlcipher.database.SQLiteDatabase db, int oldVersion, int newVersion)
onUpgrade
in class net.sqlcipher.database.SQLiteOpenHelper
public Integer getAccountId(String identifier) throws net.sqlcipher.SQLException
identifier
- net.sqlcipher.SQLException
public int addAccount(String identifier) throws net.sqlcipher.database.SQLiteException
identifier
- net.sqlcipher.database.SQLiteException
- if the database cannot be opened for writingpublic boolean removeAccount(int identifierId) throws net.sqlcipher.SQLException
net.sqlcipher.SQLException
public Map<String,Map<String,String>> getAccounts() throws net.sqlcipher.database.SQLiteException
net.sqlcipher.database.SQLiteException
public String addField(int identifierId, String key, String value) throws net.sqlcipher.SQLException
net.sqlcipher.SQLException
public boolean removeField(int identifierId, String key) throws net.sqlcipher.SQLException
key
- net.sqlcipher.SQLException
public net.sqlcipher.database.SQLiteDatabase getDb()