|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.vodafone360.people.engine.meprofile.SyncMeDbUtils
public class SyncMeDbUtils
This class is a set of utility methods called by SyncMeEngine to save/read data to/from the database.
Field Summary | |
---|---|
private static java.lang.String |
PHOTO_MIME_TYPE
Mime type for the uploaded thumbnail picture of the me profile. |
private static java.lang.Long |
sMeProfileLocalContactId
Me profile local contact id. |
Constructor Summary | |
---|---|
SyncMeDbUtils()
|
Method Summary | |
---|---|
static ServiceStatus |
fetchMeProfile(DatabaseHelper dbHelper,
Contact contact)
This method reads Me Profile contact from the database. |
static java.lang.Long |
getMeProfileLocalContactId(DatabaseHelper dbHelper)
This method returns the Me Profile localContactId... |
private static boolean |
populatePhotoDetail(DatabaseHelper dbHelper,
Contact meProfile,
ContactDetail detail)
This method reads a photo data from a file into the ContactDetail... |
private static void |
populateWithDeletedContactDetails(DatabaseHelper dbHelper,
java.util.List<ContactDetail> contactDetails,
java.lang.Long contactId)
This method adds the deleted details to the detail list sent to server... |
private static void |
populateWithModifiedDetails(DatabaseHelper dbHelper,
java.util.ArrayList<ContactDetail> updates,
Contact meProfile)
|
private static ServiceStatus |
processMyContactChanges(DatabaseHelper dbHelper,
Contact currentMeProfile,
UserProfile profileChanges)
This method stores the getMyChanges() response to database - contacts part. |
private static java.lang.String |
processMyContactDetailsChanges(DatabaseHelper dbHelper,
Contact currentMeProfile,
UserProfile profileChanges)
This method stores the getMyChanges() response to database - details part. |
static java.util.ArrayList<ContactDetail> |
saveContactDetailChanges(DatabaseHelper dbHelper,
Contact meProfile)
A utility method to save the Me Profile contact before sending the updates to backend |
static void |
savePresenceStatusResponse(DatabaseHelper dbHelper,
ContactChanges result)
The utility method to save Contacts/setMe() response for the status text change to the database... |
static ServiceStatus |
setMeProfile(DatabaseHelper dbHelper,
Contact meProfile)
This method create a Me Profile contact in the database. |
static void |
setMeProfileId(java.lang.Long meProfileId)
This method sets Me Profile localContactId... |
static java.lang.String |
updateMeProfile(DatabaseHelper dbHelper,
Contact currentMeProfile,
UserProfile profileChanges)
This method updates current Me Profile with changes from user profile. |
static void |
updateMeProfileDbDetailIds(DatabaseHelper dbHelper,
java.util.ArrayList<ContactDetail> uploadedDetails,
ContactChanges result)
The utility method to save Contacts/setMe() response to the database... |
static ContactDetail |
updateStatus(DatabaseHelper dbHelper,
java.lang.String statusText)
The utility method to save the status text change to the database... |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static java.lang.Long sMeProfileLocalContactId
private static final java.lang.String PHOTO_MIME_TYPE
Constructor Detail |
---|
public SyncMeDbUtils()
Method Detail |
---|
public static ServiceStatus setMeProfile(DatabaseHelper dbHelper, Contact meProfile)
dbHelper
- DatabaseHelper - the database.meProfile
- Contact - the Me Profile contact
public static ServiceStatus fetchMeProfile(DatabaseHelper dbHelper, Contact contact)
dbHelper
- DatabaseHelper - the databasecontact
- Contact - the empty (stub) contact to read into
public static java.lang.Long getMeProfileLocalContactId(DatabaseHelper dbHelper)
dbHelper
- DatabaseHelper - the database
public static void setMeProfileId(java.lang.Long meProfileId)
meProfileId
- Long - localContactIDpublic static java.lang.String updateMeProfile(DatabaseHelper dbHelper, Contact currentMeProfile, UserProfile profileChanges)
dbHelper
- DatabaseHelper - databasecurrentMeProfile
- Contact - current me profile, from DBprofileChanges
- - the changes to the current Me Profile
private static ServiceStatus processMyContactChanges(DatabaseHelper dbHelper, Contact currentMeProfile, UserProfile profileChanges)
dbHelper
- DatabaseHelper - database.currentMeProfile
- Contact - me profile contact.profileChanges
- UserProfile - the contact changes.
private static java.lang.String processMyContactDetailsChanges(DatabaseHelper dbHelper, Contact currentMeProfile, UserProfile profileChanges)
dbHelper
- DatabaseHelper - database.currentMeProfile
- Contact - me profile contact.profileChanges
- UserProfile - the contact changes.
public static void updateMeProfileDbDetailIds(DatabaseHelper dbHelper, java.util.ArrayList<ContactDetail> uploadedDetails, ContactChanges result)
dbHelper
- Database - databaseuploadedMeProfile
- Contact - me profile which has been uploaded in
Contacts/setMe() callresult
- ContactChanges - the contents of response Contacts/setMe().
The contact details in response need to be in the same order
as they were in setMe() requestpublic static ContactDetail updateStatus(DatabaseHelper dbHelper, java.lang.String statusText)
dbHelper
- DatabaseHelper - databasestatusText
- String - status text
public static void savePresenceStatusResponse(DatabaseHelper dbHelper, ContactChanges result)
dbHelper
- DatabaseHelper - database.ContactChanges
- result - status text change.public static java.util.ArrayList<ContactDetail> saveContactDetailChanges(DatabaseHelper dbHelper, Contact meProfile)
dbHelper
- DataBaseHelper - databasemeProfile
- - the new me Profile to push to server
private static void populateWithModifiedDetails(DatabaseHelper dbHelper, java.util.ArrayList<ContactDetail> updates, Contact meProfile)
private static boolean populatePhotoDetail(DatabaseHelper dbHelper, Contact meProfile, ContactDetail detail)
dbHelper
- DatabaseHelper - databasemeProfile
- Contact - me profile contactdetail
- ContactDetail - the detail to write the photo into.
private static void populateWithDeletedContactDetails(DatabaseHelper dbHelper, java.util.List<ContactDetail> contactDetails, java.lang.Long contactId)
dbHelper
- DatabaseHelper - databasecontactDetails
- ListcontactId
- Long - Me Profile local contact id.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
JavaDoc