com.funambol.util
Class BasicSyncListener

java.lang.Object
  extended by com.funambol.util.BasicSyncListener
All Implemented Interfaces:
SyncListener

public class BasicSyncListener
extends java.lang.Object
implements SyncListener

This class provides a basic implementation for a SyncListener. All methods are empty and users can easily extend this class to provide their own callbacks.


Field Summary
 
Fields inherited from interface com.funambol.util.SyncListener
ITEMS_NUMBER_UNKNOWN
 
Constructor Summary
BasicSyncListener()
           
 
Method Summary
 void dataReceived(java.lang.String date, int size)
          Invoked each time data is received from the server, with the timestamp and the size in bytes of the receive data.
 void endConnecting(int action)
          Invoked at the end of the login phase.
 void endMapping()
          Invoked at the end of the mapping phase.
 void endReceiving()
          Invoked at the end of the receiving phase
 void endSending()
          Invoked when the mail protocol subsystem has finished to send message.
 void endSession(int status)
          Invoked at the end of a session, before closing the connection with the remote server.
 void endSyncing()
          Invoked at the end of the syncing phase
 void itemAddSent(java.lang.Object item)
          Invoked each time an item added is sent to the server.
 void itemDeleted(java.lang.Object item)
          Invoked each time a message is deleted
 void itemDeleteSent(java.lang.Object item)
          Invoked each time an item deleted is sent to the server.
 void itemReceived(java.lang.Object item)
          Invoked each time a message is received and stored successfully in the client.
 void itemReplaceSent(java.lang.Object item)
          Invoked each time an item replaced is sent to the server.
 void itemUpdated(java.lang.Object item)
          Invoked when an item changes on the other side.
 void itemUpdated(java.lang.Object item, java.lang.Object update)
          Invoked when an item changes on the other side.
 void startConnecting()
          Invoked at the beginning of the login phase.
 void startMapping()
          Invoked at the beginning of the mapping phase.
 void startReceiving(int number)
          Invoked when items are ready to be received from the server.
 void startSending(int numNewItems, int numUpdItems, int numDelItems)
          Invoked before beginning to send items to the server.
 void startSession()
          Invoked at the beginning of the session, before opening the connection with the server
 void startSyncing(int alertCode)
          Invoked at the beginning of the syncing phase
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicSyncListener

public BasicSyncListener()
Method Detail

startSession

public void startSession()
Invoked at the beginning of the session, before opening the connection with the server

Specified by:
startSession in interface SyncListener

endSession

public void endSession(int status)
Invoked at the end of a session, before closing the connection with the remote server.

Specified by:
endSession in interface SyncListener
Parameters:
status - gives an indication if the session was error free or if one or more errors were encountered. The value is encoded as a bit mask according to the value of the STATUS_* constants (see above). If no error was encountered then status has the value STATUS_SUCCESS.

startConnecting

public void startConnecting()
Invoked at the beginning of the login phase.

Specified by:
startConnecting in interface SyncListener

endConnecting

public void endConnecting(int action)
Invoked at the end of the login phase.

Specified by:
endConnecting in interface SyncListener
Parameters:
action - describes the action the server requires (this value is repository dependent)

startSyncing

public void startSyncing(int alertCode)
Invoked at the beginning of the syncing phase

Specified by:
startSyncing in interface SyncListener
Parameters:
alertCode - is the code returned by the server at the end of the connection phase

endSyncing

public void endSyncing()
Invoked at the end of the syncing phase

Specified by:
endSyncing in interface SyncListener

startReceiving

public void startReceiving(int number)
Invoked when items are ready to be received from the server.

Specified by:
startReceiving in interface SyncListener
Parameters:
number - number of items that will be sent during the session, if known, or ITEMS_NUMBER_UNKNOWN otherwise.

endReceiving

public void endReceiving()
Invoked at the end of the receiving phase

Specified by:
endReceiving in interface SyncListener

itemReceived

public void itemReceived(java.lang.Object item)
Invoked each time a message is received and stored successfully in the client.

Specified by:
itemReceived in interface SyncListener
Parameters:
item - is the new value received

itemDeleted

public void itemDeleted(java.lang.Object item)
Invoked each time a message is deleted

Specified by:
itemDeleted in interface SyncListener
Parameters:
itemId - is the id of the value being removed

itemUpdated

public void itemUpdated(java.lang.Object item,
                        java.lang.Object update)
Invoked when an item changes on the other side.

Specified by:
itemUpdated in interface SyncListener
Parameters:
item - is the item that has changed
update - is a description of the update (the semantics of this paramenter is completely SyncSource dependent)

itemUpdated

public void itemUpdated(java.lang.Object item)
Invoked when an item changes on the other side.

Specified by:
itemUpdated in interface SyncListener
Parameters:
item - is the item that changed

dataReceived

public void dataReceived(java.lang.String date,
                         int size)
Invoked each time data is received from the server, with the timestamp and the size in bytes of the receive data.

Specified by:
dataReceived in interface SyncListener
Parameters:
date - is the timestamp
size - is the number of bytes received

startSending

public void startSending(int numNewItems,
                         int numUpdItems,
                         int numDelItems)
Invoked before beginning to send items to the server.

Specified by:
startSending in interface SyncListener
Parameters:
numNewItems - number of new items to be sent
numUpdItems - number of updated items to be sent
numDelItems - number of deleted items to be sent

itemAddSent

public void itemAddSent(java.lang.Object item)
Invoked each time an item added is sent to the server.

Specified by:
itemAddSent in interface SyncListener

itemReplaceSent

public void itemReplaceSent(java.lang.Object item)
Invoked each time an item replaced is sent to the server.

Specified by:
itemReplaceSent in interface SyncListener

itemDeleteSent

public void itemDeleteSent(java.lang.Object item)
Invoked each time an item deleted is sent to the server.

Specified by:
itemDeleteSent in interface SyncListener

endSending

public void endSending()
Invoked when the mail protocol subsystem has finished to send message.

Specified by:
endSending in interface SyncListener

startMapping

public void startMapping()
Invoked at the beginning of the mapping phase.

Specified by:
startMapping in interface SyncListener

endMapping

public void endMapping()
Invoked at the end of the mapping phase.

Specified by:
endMapping in interface SyncListener


Copyright © 2006 Funambol.