|
![]() |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.vodafone360.people.engine.contactsync.NativeExporter
public class NativeExporter
Field Summary | |
---|---|
private NativeContactsApi.Account |
mAccount
The Native Account where to write the Contacts. |
private static int |
MAX_CONTACTS_OPERATION_COUNT
Number of contacts to be processed "per tick". |
private int |
mCurrentSyncableIdIndex
The index in the current people id. |
private NativeContactsApi |
mNativeContactsApi
Handle to the Native Contacts API. |
private PeopleContactsApi |
mPeopleContactsApi
Handler to the People Contacts API. |
private int |
mProcessedIds
The current count of processed IDs. |
private int |
mResult
The result status. |
private int |
mState
The current state. |
private long[] |
mSyncableContactsIds
The list of local IDs from people contacts that need to be synced to Native. |
private int |
mTotalIds
The total count of IDs to process (Native Database + People Database). |
static int |
RESULT_ERROR
The undefined result when the NativeImporter has not been run yet. |
static int |
RESULT_OK
The ok result when the NativeImporter has finished successfully. |
static int |
RESULT_UNDEFINED
The undefined result when the NativeImporter has not been run yet. |
private static int |
STATE_DONE
Internal state representing the task to perform: final state, nothing else to perform. |
private static int |
STATE_GET_CONTACT_IDS
Internal state representing the task to perform: gets the list of local contacts IDs to be synced to Native. |
private static int |
STATE_ITERATE_THROUGH_IDS
Internal state representing the task to perform: iterates through the list of syncable contacts IDs and sync to Native side. |
Constructor Summary | |
---|---|
NativeExporter(PeopleContactsApi pca,
NativeContactsApi nca)
Constructor. |
Method Summary | |
---|---|
private void |
complete(int result)
Sets the internal state to DONE with the provided result status. |
private void |
exportContactChanges(ContactChange[] changes)
Exports the contact changes to the native address book. |
private void |
getContactIds()
Gets the list of local contacts IDs that need to be synced to Native. |
int |
getCount()
Gets the total number of IDs to process. |
int |
getPosition()
Gets the current position in the list of IDs. |
int |
getResult()
Gets the Import result. |
private void |
iterateThroughSyncableIds()
Iterates through the list of syncable contacts IDs and sync to Native side. |
boolean |
tick()
Tick method to call each time there is time for processing the Native Contacts Import. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int RESULT_UNDEFINED
getResult()
,
Constant Field Valuespublic static final int RESULT_OK
getResult()
,
Constant Field Valuespublic static final int RESULT_ERROR
getResult()
,
Constant Field Valuesprivate static final int MAX_CONTACTS_OPERATION_COUNT
tick()
,
Constant Field Valuesprivate PeopleContactsApi mPeopleContactsApi
private NativeContactsApi mNativeContactsApi
private static final int STATE_GET_CONTACT_IDS
private static final int STATE_ITERATE_THROUGH_IDS
private static final int STATE_DONE
private int mState
private long[] mSyncableContactsIds
private int mCurrentSyncableIdIndex
mSyncableContactsIds
private int mResult
private int mTotalIds
private int mProcessedIds
private NativeContactsApi.Account mAccount
Constructor Detail |
---|
public NativeExporter(PeopleContactsApi pca, NativeContactsApi nca)
pca
- handler to the People Contacts APInca
- handler to the Native Contacts APIMethod Detail |
---|
public int getPosition()
getCount()
public int getCount()
private void complete(int result)
result
- the result status to setpublic boolean tick()
public int getResult()
RESULT_OK
,
RESULT_ERROR
,
RESULT_UNDEFINED
private void getContactIds()
private void iterateThroughSyncableIds()
private void exportContactChanges(ContactChange[] changes)
changes
- the array of ContactChange that represent a full contact, a deleted contact or an updated contact
|
![]() |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
JavaDoc