|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.vodafone360.people.engine.contactsync.BaseSyncProcessor
public abstract class BaseSyncProcessor
Base-class for processor handling for the various stages of Contact sync.
Field Summary | |
---|---|
protected IContactSyncCallback |
mCallback
Provides useful callback methods in the contact sync engine |
protected DatabaseHelper |
mDb
Provides processors with access to the people database. |
protected java.lang.String |
mFailureList
String used by processors to compile extra information when a contact sync isn't successful. |
Constructor Summary | |
---|---|
protected |
BaseSyncProcessor(IContactSyncCallback callback,
DatabaseHelper db)
Base constructor. |
Method Summary | |
---|---|
protected void |
cancel()
Cancel processor |
protected void |
complete(ServiceStatus status)
Helper method to complete the processor. |
protected abstract void |
doCancel()
Can be called anytime when the processor is active, to cancel the sync. |
protected abstract void |
doStart()
Implemented by all contact sync processors to initiate the sync. |
protected BaseEngine |
getEngine()
Provides access to the contact sync engine object. |
protected void |
markDbChanged()
Called by processors when they make changes to the people database. |
void |
onComplete()
Processors may override this function is they have any additional cleanup to do when the processor has finished. |
void |
onTimeoutEvent()
Can be overriden by processors which are interested in timeout events. |
abstract void |
processCommsResponse(ResponseQueue.Response resp)
Called when a comms response is received from the server. |
protected void |
setReqId(int reqId)
Processors can call this method when they issue a comms requests. |
protected void |
setSyncStatus(SyncStatus syncStatus)
Used by processors to provide an indication of their current progress. |
protected void |
setTimeout(long timeout)
Helper function that can be used by processors to set a timeout. |
void |
start()
Start the processor. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected IContactSyncCallback mCallback
protected java.lang.String mFailureList
protected DatabaseHelper mDb
Constructor Detail |
---|
protected BaseSyncProcessor(IContactSyncCallback callback, DatabaseHelper db)
callback
- Provides access to the contact sync enginedb
- The database helper referenceMethod Detail |
---|
public void start()
complete(ServiceStatus)
).
protected void cancel()
protected abstract void doStart()
IContactSyncCallback.onProcessorComplete(ServiceStatus, String, Object)
method when the sync is finished (the usual way to do this is by calling
complete(ServiceStatus)
).
protected abstract void doCancel()
cancel()
will take care of this.
public void onTimeoutEvent()
public abstract void processCommsResponse(ResponseQueue.Response resp)
resp
- The response dataprotected void complete(ServiceStatus status)
status
- The result of the syncprotected BaseEngine getEngine()
protected void markDbChanged()
protected void setTimeout(long timeout)
onTimeoutEvent()
will be called once the timeout completes.
timeout
- The timeout value in milliseconds.protected void setSyncStatus(SyncStatus syncStatus)
SyncStatus
- Status of the processor, must not be NULL.
java.security.InvalidParameterException
- when SyncStatus is NULL.protected void setReqId(int reqId)
reqId
- The request ID returned by the comms framework.public void onComplete()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
JavaDoc