com.ibm.mobileservices.isync.event
Interface ISyncListener


public interface ISyncListener

This interface serves as the listener interface for receiving synchronization events. A class that is interested in receiving ISyncEvent would implement this interface and register with the sync driver's setSyncListener method.


Method Summary
 int eventIssued(com.ibm.mobileservices.isync.event.ISyncEvent syncEvent)
           Called when an event occurs in the synchronization engine.
 

Method Detail

eventIssued

public int eventIssued(com.ibm.mobileservices.isync.event.ISyncEvent syncEvent)
        Called when an event occurs in the synchronization engine.
        Event types and event codes are defined in ISync class. 
        

The return values of eventIssued MUST follow the protocol of the synchronization engine or else the synchronization might not process correctly:

(Rule 1) If the eventType is ISync.EVTTYPE_RETRY, eventIssued should return one of the following:

ISync.RTNCB_REPLY_YES - choose to try again ISync.RTNCB_REPLY_NO - choose to not try again ISync.RTNCB_DEFAULT - let sync engine take the default action

(Rule 2) If the eventType is ISync.EVTTYPE_QUERY, the semantics of the return code depends on the eventCode, that is, the listener should check the eventCode to be able to return the appropriate value. For ISync.EVT_QUE_CANCEL_UPON_ERROR, if the listener can simply return:

ISync.RTNCB_REPLY_YES - choose to continue with the synchronization ISync.RTNCB_REPLY_NO - choose to cancel the synchronization ISync.RTNCB_DEFAULT - choose to let sync engine take default action(RTNCB_REPLY_NO)
For ISync.EVT_QUE_LOGIN, the listener needs to supply login information and return
ISync.RTNCB_DONE - login information supplied.
see ISyncEvent's getEventInfo method for more details. (Rule 3) If the eventType is ISync.EVTTYPE_INFO or ISync.EVTTYPE_CONFLICT, the listener can simply return:
ISync.RTNCB_DONE - listener done with processing.
See ISyncEvent for its event types and each type's associated event codes.

Parameters:
syncEvent - an ISyncEvent object
Returns:
an int specifying the return code for the event


(c) Copyright IBM Corp. 2001, 2002, 2003. All Rights Reserved.