|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.vodafone360.people.database.tables.PresenceTable
public abstract class PresenceTable
PresenceTable... The table for storing the presence states of contacts.
Nested Class Summary | |
---|---|
private static class |
PresenceTable.Field
An enumeration of all the field names in the database, containing ID, LOCAL_CONTACT_ID, USER_ID, NETWORK_ID, NETWORK_STATUS. |
Field Summary | |
---|---|
private static java.lang.String |
DEFAULT_ERROR_MESSAGE
The default message for the NullPointerException caused by the null instance of database passed into PresenceTable methods. |
private static int |
LOCAL_CONTACT_ID
The constants for column indexes in the table: LocalContactId |
private static int |
NETWORK_ID
The constants for column indexes in the table: NetworkId |
private static int |
NETWORK_STATUS
The constants for column indexes in the table: Status |
static java.lang.String |
TABLE_NAME
The name of the table as it appears in the database. |
static int |
USER_ADDED
The return types for the add/update method: if a new record was added. |
private static int |
USER_ID
The constants for column indexes in the table: ImAddress |
static int |
USER_NOTADDED
The return types for the add/update method: if an error happened and prevented the record from being added or updated. |
static int |
USER_UPDATED
The return types for the add/update method: if an existing record was updated. |
Constructor Summary | |
---|---|
PresenceTable()
|
Method Summary | |
---|---|
static void |
create(SQLiteDatabase writableDb)
This method creates the PresenceTable. |
static User |
getUserPresenceByLocaContactId(long localContactId,
SQLiteDatabase readableDatabase)
This method returns user/me profile presence state. |
static int |
setAllUsersOffline(SQLiteDatabase writableDatabase)
The method cleans the presence table: deletes all the rows. |
static int |
setAllUsersOfflineExceptForMe(long localContactIdOfMe,
SQLiteDatabase writableDatabase)
The method cleans the presence table: deletes all the rows, except for the given user localContactId ("Me Profile" localContactId) |
static int |
updateUser(User user2Update,
SQLiteDatabase writableDatabase)
This method updates the user with the information from the User wrapper. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String TABLE_NAME
public static final int USER_ADDED
public static final int USER_UPDATED
public static final int USER_NOTADDED
private static final int LOCAL_CONTACT_ID
private static final int USER_ID
private static final int NETWORK_ID
private static final int NETWORK_STATUS
private static final java.lang.String DEFAULT_ERROR_MESSAGE
Constructor Detail |
---|
public PresenceTable()
Method Detail |
---|
public static void create(SQLiteDatabase writableDb) throws SQLException, java.lang.NullPointerException
writableDb
- - the writable database
SQLException
- is thrown when request to create a table fails with
an SQLException
java.lang.NullPointerException
- if the passed in database instance is nullpublic static int updateUser(User user2Update, SQLiteDatabase writableDatabase) throws SQLException, java.lang.NullPointerException
user2Update
- - User info to updatewritableDatabase
- - writable database
SQLException
- if the database layer throws this exception.
java.lang.NullPointerException
- if the passed in database instance is null.public static User getUserPresenceByLocaContactId(long localContactId, SQLiteDatabase readableDatabase) throws SQLException, java.lang.NullPointerException
localContactId
- - me profile localContactIdreadableDatabase
- - the database to read from
SQLException
- if the database layer throws this exception.
java.lang.NullPointerException
- if the passed in database instance is null.public static int setAllUsersOffline(SQLiteDatabase writableDatabase) throws java.lang.NullPointerException
writableDatabase
- - database to write to.
java.lang.NullPointerException
- if the passed in database instance is null.public static int setAllUsersOfflineExceptForMe(long localContactIdOfMe, SQLiteDatabase writableDatabase) throws java.lang.NullPointerException
localContactIdOfMe
- - the localContactId of the user (long), whose
info should not be deletedwritableDatabase
- - database to write to.
java.lang.NullPointerException
- if the passed in database instance is null.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
JavaDoc