com.vodafone360.people.engine.presence
Class PresenceDbUtils

java.lang.Object
  extended by com.vodafone360.people.engine.presence.PresenceDbUtils

public class PresenceDbUtils
extends java.lang.Object


Field Summary
private static java.lang.Long sMeProfileLocalContactId
           
private static java.lang.Long sMeProfileUserId
           
 
Constructor Summary
PresenceDbUtils()
           
 
Method Summary
private static boolean convertUserIds(User user, DatabaseHelper databaseHelper)
          Parses user data before storing it to database
protected static User getMeProfilePresenceStatus(DatabaseHelper databaseHelper)
           
protected static java.lang.Long getMeProfileUserId(DatabaseHelper databaseHelper)
           
static User getUserPresenceStatusByLocalContactId(long localContactId, DatabaseHelper databaseHelper)
          This method returns wrapper with the presence information for all user networks
static boolean notNullOrBlank(java.lang.String input)
           
static void resetMeProfileIds()
           
protected static void resetPresenceStatesAcceptForMe(long localContactIdOfMe, DatabaseHelper dbHelper)
          Removes all presence infos besides those related to MeProfile
protected static void setPresenceOfflineInDatabase(DatabaseHelper dbHelper)
          Set all users to offline state
protected static boolean updateDatabase(java.util.List<User> users, long idListeningTo, DatabaseHelper dbHelper)
          Here we update the PresenceTable, and the ContactSummaryTable afterwards the HandlerAgent receives the notification of presence states changes
protected static boolean updateMyPresence(User user, DatabaseHelper dbHelper)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sMeProfileUserId

private static java.lang.Long sMeProfileUserId

sMeProfileLocalContactId

private static java.lang.Long sMeProfileLocalContactId
Constructor Detail

PresenceDbUtils

public PresenceDbUtils()
Method Detail

resetMeProfileIds

public static void resetMeProfileIds()

convertUserIds

private static boolean convertUserIds(User user,
                                      DatabaseHelper databaseHelper)
Parses user data before storing it to database

Parameters:
user -
databaseHelper -
Returns:

getMeProfileUserId

protected static java.lang.Long getMeProfileUserId(DatabaseHelper databaseHelper)
Parameters:
databaseHelper -
Returns:

getMeProfilePresenceStatus

protected static User getMeProfilePresenceStatus(DatabaseHelper databaseHelper)
Parameters:
databaseHelper -
Returns:

getUserPresenceStatusByLocalContactId

public static User getUserPresenceStatusByLocalContactId(long localContactId,
                                                         DatabaseHelper databaseHelper)
This method returns wrapper with the presence information for all user networks

Parameters:
localContactId - - the localContactId of the contact we want to get presence states information for.
databaseHelper -
Returns:
User wrapper with the presence information for all user networks. If no information is on the database the payload is NULL

updateDatabase

protected static boolean updateDatabase(java.util.List<User> users,
                                        long idListeningTo,
                                        DatabaseHelper dbHelper)
Here we update the PresenceTable, and the ContactSummaryTable afterwards the HandlerAgent receives the notification of presence states changes

Parameters:
users -

updateMyPresence

protected static boolean updateMyPresence(User user,
                                          DatabaseHelper dbHelper)

setPresenceOfflineInDatabase

protected static void setPresenceOfflineInDatabase(DatabaseHelper dbHelper)
Set all users to offline state

Parameters:
dbHelper -

resetPresenceStatesAcceptForMe

protected static void resetPresenceStatesAcceptForMe(long localContactIdOfMe,
                                                     DatabaseHelper dbHelper)
Removes all presence infos besides those related to MeProfile

Parameters:
dbHelper -

notNullOrBlank

public static boolean notNullOrBlank(java.lang.String input)
Parameters:
input -
Returns:


JavaDoc