|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.vodafone360.people.database.tables.StateTable
public abstract class StateTable
Contains all the functionality related to the state database table. This table is used to persist individual setting data. The table always has only one record. This class is never instantiated hence all methods must be static.
Nested Class Summary | |
---|---|
private static class |
StateTable.Field
An enumeration of all the field names in the database. |
Field Summary | |
---|---|
private static int |
PRIMARY_STATE_KEY_VALUE
The state table only has one record with the primary key set to the following value. |
private static java.lang.String |
TABLE_NAME
Name of the table as it appears in the database. |
Constructor Summary | |
---|---|
private |
StateTable()
Private constructor to prevent instantiation. |
Method Summary | |
---|---|
static void |
create(SQLiteDatabase writableDb)
Create Settings Table and add a record with default setting values. |
static java.lang.Integer |
fetchContactRevision(SQLiteDatabase readableDb)
Fetches the current contact revision for the server sync. |
static long |
fetchLatestMmsTime(SQLiteDatabase readableDb)
Fetches the timestamp of the latest MMS timeline activity that was synced. |
static long |
fetchLatestPhoneCallTime(SQLiteDatabase readableDb)
Fetches the timestamp of the latest phone call timeline activity that was synced. |
static long |
fetchLatestSmsTime(SQLiteDatabase readableDb)
Fetches the timestamp of the latest SMS timeline activity that was synced. |
static long |
fetchLatestStatusUpdateTime(SQLiteDatabase readableDb)
Fetches the timestamp of the latest status activity that was synced. |
static ServiceStatus |
fetchLogonCredentials(LoginDetails details,
SQLiteDatabase readableDb)
Fetches cached user login credentials (without encryption information). |
static ServiceStatus |
fetchLogonCredentialsAndPublicKey(LoginDetails details,
PublicKeyDetails pubKeyDetails,
SQLiteDatabase readableDb)
Fetches cached user login credentials (with encryption information). |
static boolean |
fetchMeProfileAvatarChangedFlag(SQLiteDatabase readableDb)
Fetches the "me profile avatar changed flag" from the state table. |
static boolean |
fetchMeProfileChangedFlag(SQLiteDatabase readableDb)
Fetches the "me profile changed" flag from the database. |
static java.lang.Long |
fetchMeProfileId(SQLiteDatabase readableDb)
Fetches the local contact ID for the me profile (which is stored in the contacts table with the other contacts). |
static long |
fetchMeProfileRevision(SQLiteDatabase readableDb)
Fetches the current me profile revision for the server sync. |
static long |
fetchOldestMmsTime(SQLiteDatabase readableDb)
Fetches the timestamp of the oldest MMS status activity that was synced. |
static long |
fetchOldestPhoneCallTime(SQLiteDatabase readableDb)
Fetches the timestamp of the oldest phone call timeline activity that was synced. |
static long |
fetchOldestSmsTime(SQLiteDatabase readableDb)
Fetches the timestamp of the oldest SMS that was synced. |
static long |
fetchOldestStatusUpdate(SQLiteDatabase readableDb)
Fetches the timestamp of the oldest status activity that was synced. |
static PersistSettings |
fetchOption(PersistSettings.Option option,
SQLiteDatabase readableDb)
Fetches an option from the settings table. |
static AuthSessionHolder |
fetchSession(SQLiteDatabase readableDb)
Fetches the current session from the database. |
static boolean |
isRegistrationComplete(SQLiteDatabase readableDb)
Fetch value of registration complete flag from database. |
static boolean |
modifyContactRevision(java.lang.Integer revision,
SQLiteDatabase writableDb)
Stores a new server contact revision in the database. |
static ServiceStatus |
modifyCredentials(LoginDetails details,
SQLiteDatabase writableDb)
Modify cached user credentials settings (without encryption information). |
static ServiceStatus |
modifyCredentialsAndPublicKey(LoginDetails details,
PublicKeyDetails pubKeyDetails,
SQLiteDatabase writableDb)
Modify cached user credentials settings (without encryption information). |
static ServiceStatus |
modifyLatestMmsTime(long value,
SQLiteDatabase writableDb)
Modifies the timestamp for the last MMS timeline activity that has been synced. |
static ServiceStatus |
modifyLatestPhoneCallTime(long value,
SQLiteDatabase writableDb)
Modifies the timestamp for the last phone call activity that has been synced. |
static ServiceStatus |
modifyLatestSmsTime(long value,
SQLiteDatabase writableDb)
Modifies the timestamp for the last SMS timeline activity that has been synced. |
static ServiceStatus |
modifyLatestStatusUpdateTime(long value,
SQLiteDatabase writableDb)
Modifies the timestamp for the last status activity that has been synced. |
static ServiceStatus |
modifyMeProfileChangedFlag(boolean myContactChanged,
SQLiteDatabase writableDb)
Sets the "me profile changed" flag in the database to the given value. |
static ServiceStatus |
modifyMeProfileID(java.lang.Long myContactID,
SQLiteDatabase writableDb)
Sets the me profile ID. |
static boolean |
modifyMeProfileRevision(long revision,
SQLiteDatabase writableDb)
Stores a new server me profile revision in the database. |
static ServiceStatus |
modifyOldestMmsTime(long value,
SQLiteDatabase writableDb)
Modifies the timestamp for the oldest MMS activity that has been synced. |
static ServiceStatus |
modifyOldestPhoneCallTime(long value,
SQLiteDatabase writableDb)
Modifies the timestamp for the oldest phone call timeline activity that has been synced. |
static ServiceStatus |
modifyOldestSmsTime(long value,
SQLiteDatabase writableDb)
Modifies the timestamp for the oldest SMS activity that has been synced. |
static ServiceStatus |
modifyOldestStatusTime(long value,
SQLiteDatabase writableDb)
Modifies the timestamp for the oldest status activity that has been synced. |
static ServiceStatus |
setOption(PersistSettings setting,
SQLiteDatabase writableDb)
Stores a persist setting option in the database. |
static boolean |
setRegistrationComplete(boolean complete,
SQLiteDatabase writableDb)
Set registration complete flag. |
static ServiceStatus |
setSession(AuthSessionHolder session,
SQLiteDatabase writableDb)
Stores the latest session in the database. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final java.lang.String TABLE_NAME
private static final int PRIMARY_STATE_KEY_VALUE
Constructor Detail |
---|
private StateTable()
Method Detail |
---|
public static void create(SQLiteDatabase writableDb)
writableDb
- A writable SQLite database.public static ServiceStatus fetchLogonCredentials(LoginDetails details, SQLiteDatabase readableDb)
details
- An empty LoginDetails object to be filledreadableDb
- Readable SQLite database for fetching the information
public static ServiceStatus fetchLogonCredentialsAndPublicKey(LoginDetails details, PublicKeyDetails pubKeyDetails, SQLiteDatabase readableDb)
details
- An empty LoginDetails object to be filledpubKeyDetails
- An empty PublicKeyDetails object to be filledreadableDb
- Readable SQLite database for fetching the information
public static ServiceStatus modifyCredentials(LoginDetails details, SQLiteDatabase writableDb)
details
- The new credentials.writableDb
- Writable SQLite database
public static ServiceStatus modifyCredentialsAndPublicKey(LoginDetails details, PublicKeyDetails pubKeyDetails, SQLiteDatabase writableDb)
details
- The new credentials.pubKeyDetails
- The new key details.writableDb
- Writable SQLite database
public static boolean setRegistrationComplete(boolean complete, SQLiteDatabase writableDb)
complete
- The flag value (true or false)writableDb
- Writable SQLite database
public static boolean isRegistrationComplete(SQLiteDatabase readableDb)
readableDb
- Readable SQLite database for fetching the information
public static java.lang.Integer fetchContactRevision(SQLiteDatabase readableDb)
readableDb
- Readable SQLite database for fetching the information
public static boolean modifyContactRevision(java.lang.Integer revision, SQLiteDatabase writableDb)
revision
- New revision numberwritableDb
- Writable SQLite database for storing the information
public static PersistSettings fetchOption(PersistSettings.Option option, SQLiteDatabase readableDb)
option
- Specifies which option is requiredreadableDb
- Readable SQLite database for fetching the information
public static ServiceStatus setOption(PersistSettings setting, SQLiteDatabase writableDb)
setting
- The setting to store. Must have an option set with data.writableDb
- Writable SQLite database for storing the information
public static AuthSessionHolder fetchSession(SQLiteDatabase readableDb)
readableDb
- Readable SQLite database for fetching the information
public static ServiceStatus setSession(AuthSessionHolder session, SQLiteDatabase writableDb)
session
- The session object to store.writableDb
- Writable SQLite database for storing the information
public static java.lang.Long fetchMeProfileId(SQLiteDatabase readableDb)
readableDb
- Readable SQLite database for fetching the information
public static ServiceStatus modifyMeProfileID(java.lang.Long myContactID, SQLiteDatabase writableDb)
myContactID
- The local contact ID of the me profile, or null if the
me profile is deleted (the latter is currently possibly by the
UI).writableDb
- Writable SQLite database for storing the information
public static boolean fetchMeProfileChangedFlag(SQLiteDatabase readableDb)
readableDb
- Readable SQLite database for fetching the information
public static ServiceStatus modifyMeProfileChangedFlag(boolean myContactChanged, SQLiteDatabase writableDb)
myContactChanged
- The new value for the flagwritableDb
- Writable SQLite database for storing the information
public static long fetchLatestStatusUpdateTime(SQLiteDatabase readableDb)
readableDb
- Readable SQLite database for fetching the information.
public static long fetchOldestStatusUpdate(SQLiteDatabase readableDb)
readableDb
- Readable SQLite database for fetching the information
public static long fetchOldestSmsTime(SQLiteDatabase readableDb)
readableDb
- Readable SQLite database for fetching the information
public static long fetchOldestMmsTime(SQLiteDatabase readableDb)
readableDb
- Readable SQLite database for fetching the information
public static long fetchLatestPhoneCallTime(SQLiteDatabase readableDb)
readableDb
- Readable SQLite database for fetching the information
public static long fetchLatestSmsTime(SQLiteDatabase readableDb)
readableDb
- Readable SQLite database for fetching the information
public static long fetchLatestMmsTime(SQLiteDatabase readableDb)
readableDb
- Readable SQLite database for fetching the information
public static long fetchOldestPhoneCallTime(SQLiteDatabase readableDb)
readableDb
- Readable SQLite database for fetching the information
public static ServiceStatus modifyLatestStatusUpdateTime(long value, SQLiteDatabase writableDb)
value
- The new timestamp value (in milliseconds)writableDb
- Writable SQLite database for storing the information
public static ServiceStatus modifyOldestStatusTime(long value, SQLiteDatabase writableDb)
value
- The new timestamp value (in milliseconds)writableDb
- Writable SQLite database for storing the information
public static ServiceStatus modifyOldestSmsTime(long value, SQLiteDatabase writableDb)
value
- The new timestamp value (in milliseconds)writableDb
- Writable SQLite database for storing the information
public static ServiceStatus modifyOldestMmsTime(long value, SQLiteDatabase writableDb)
value
- The new timestamp value (in milliseconds)writableDb
- Writable SQLite database for storing the information
public static ServiceStatus modifyLatestPhoneCallTime(long value, SQLiteDatabase writableDb)
value
- The new timestamp value (in milliseconds)writableDb
- Writable SQLite database for storing the information
public static ServiceStatus modifyLatestSmsTime(long value, SQLiteDatabase writableDb)
value
- The new timestamp value (in milliseconds)writableDb
- Writable SQLite database for storing the information
public static ServiceStatus modifyLatestMmsTime(long value, SQLiteDatabase writableDb)
value
- The new timestamp value (in milliseconds)writableDb
- Writable SQLite database for storing the information
public static ServiceStatus modifyOldestPhoneCallTime(long value, SQLiteDatabase writableDb)
value
- The new timestamp value (in milliseconds)writableDb
- Writable SQLite database for storing the information
public static long fetchMeProfileRevision(SQLiteDatabase readableDb)
readableDb
- Readable SQLite database for fetching the information
public static boolean modifyMeProfileRevision(long revision, SQLiteDatabase writableDb)
revision
- New revision numberwritableDb
- Writable SQLite database for storing the information
public static boolean fetchMeProfileAvatarChangedFlag(SQLiteDatabase readableDb)
readableDb
- The SQLite database with read access
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
JavaDoc