com.funambol.client.engine
Interface SyncEngineListener

All Known Implementing Classes:
AccountScreenController, HomeScreenController, SynchronizationController

public interface SyncEngineListener

This interface is a listener for the SyncEngine which generates several notification on the status of the synchronization. These events are a complement to the ones generated by the SyncManager, and they are meant to be "global" and not specific to one sync source. The SyncManager notifies the sync status for a specific sync source (as it synchronizes one source at a time) while the SyncEngine has an interface that allows the synchronization of multiple sources. The global events (not source specific) are therefore generated by the SyncEngine.


Method Summary
 void beginSync()
          A sync is about to begin.
 boolean confirmDeletes(java.util.Enumeration sources)
          Invoked if there are many items to delete.
 void endSync(java.util.Vector appSources, boolean failures)
          The synchronizaion has been completed for the given sources.
 boolean isCancelled()
          This method allows the client to stop the sync.
 void noConnection()
          Sync cannot be performed because connections cannot be established
 void noCredentials()
          Sync cannot be performed because the user did not set his credentials
 void noSignal()
          Sync cannot be performed because there is no network coverage
 void noSources()
          Sync cannot be performed because no sources are selected
 void sourceEnded(AppSyncSource appSource)
          This method notifies that a source has completed its synchronization
 void sourceFailed(AppSyncSource appSource, SyncException se)
          This method is invoked when the synchronization of a source throws an exception.
 void sourceStarted(AppSyncSource appSource)
          This method notifies that a new source is about to begin its synchronization.
 void syncEnded()
          Invoked at the end of the synchronization (always invoked, regardless of success or failure)
 boolean syncStarted(java.util.Vector appSources)
          A sync for the given sources is about to begin.
 

Method Detail

beginSync

void beginSync()
A sync is about to begin. This is always invoked when the SyncEngine starts a synchronization


noCredentials

void noCredentials()
Sync cannot be performed because the user did not set his credentials


noSources

void noSources()
Sync cannot be performed because no sources are selected


noConnection

void noConnection()
Sync cannot be performed because connections cannot be established


noSignal

void noSignal()
Sync cannot be performed because there is no network coverage


confirmDeletes

boolean confirmDeletes(java.util.Enumeration sources)
Invoked if there are many items to delete. "Many" means more than 1/3 of the total number of items. If the method returns true the sync proceeds, otherwise it is aborted (for this source).

Returns:
true if the sync shall proceed

syncStarted

boolean syncStarted(java.util.Vector appSources)
A sync for the given sources is about to begin.


syncEnded

void syncEnded()
Invoked at the end of the synchronization (always invoked, regardless of success or failure)


isCancelled

boolean isCancelled()
This method allows the client to stop the sync. When true is returned, then the SyncEngine interrupts the sync


sourceStarted

void sourceStarted(AppSyncSource appSource)
This method notifies that a new source is about to begin its synchronization.


sourceEnded

void sourceEnded(AppSyncSource appSource)
This method notifies that a source has completed its synchronization


sourceFailed

void sourceFailed(AppSyncSource appSource,
                  SyncException se)
This method is invoked when the synchronization of a source throws an exception. The exception is provided so the upper layers can decide if an error message shall be shown.


endSync

void endSync(java.util.Vector appSources,
             boolean failures)
The synchronizaion has been completed for the given sources.

Parameters:
appSources - the list of sources being synchronized
failure - is true iff at least one source failed


Copyright © 2001-2009 Funambol.