|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.funambol.client.engine.SyncEngine
public class SyncEngine
This class represents an engine for synchronizations. It wraps the APIs and in particular it is built on top of the SyncScheduler. This class has the following main goals: 1) Perform some basic checks before firing a sync. For example it checks if radio signal is good. These checks are platform dependent and not performed by the APIs 2) Incapsulate error handling and sync threading. When a sync is requested it is run in a separate thread, and this thread is monitored by the SyncEngine which intercepts exceptions and handle them 3) Support compression error recovering. If a sync throws an error because compression is not supported, then the sync is resumed without compression 4) Add a listener for the entire sync. Each sync source has its own listener for source specific events, but the SyncEngine has a different listener that generats events global to the entire synchronization.
Field Summary | |
---|---|
protected AppSyncSourceManager |
appSyncSourceManager
|
protected Configuration |
configuration
|
protected Customization |
customization
|
Constructor Summary | |
---|---|
SyncEngine(Customization customization,
Configuration configuration,
AppSyncSourceManager appSyncSourceManager,
NetworkStatus networkStatus)
|
Method Summary | |
---|---|
void |
cancelSync()
|
protected SyncManager |
createManager(AppSyncSource source,
SyncConfig config)
|
protected void |
fireSync(SyncManager manager,
SyncSource source,
int syncMode,
boolean askServerCaps)
|
AppSyncSource |
getCurrentSource()
Returns the source which is currently being synchronized. |
SyncEngineListener |
getListener()
Gets the current listener. |
boolean |
isSynchronizing()
Returns true iff a sync is in progress |
void |
setListener(SyncEngineListener listener)
|
void |
setNetworkStatus(NetworkStatus networkStatus)
|
void |
setSpawnThread(boolean value)
|
void |
setTransportAgent(TransportAgent ta)
|
void |
sync(java.lang.Object[] requestContent)
SyncSchedulerListener callback. |
boolean |
synchronize(java.util.Vector sources)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Customization customization
protected AppSyncSourceManager appSyncSourceManager
protected Configuration configuration
Constructor Detail |
---|
public SyncEngine(Customization customization, Configuration configuration, AppSyncSourceManager appSyncSourceManager, NetworkStatus networkStatus)
Method Detail |
---|
public void setListener(SyncEngineListener listener)
public SyncEngineListener getListener()
public void setSpawnThread(boolean value)
public void setNetworkStatus(NetworkStatus networkStatus)
public void cancelSync()
public void setTransportAgent(TransportAgent ta)
public void sync(java.lang.Object[] requestContent)
public boolean isSynchronizing()
public AppSyncSource getCurrentSource()
public boolean synchronize(java.util.Vector sources)
protected SyncManager createManager(AppSyncSource source, SyncConfig config)
protected void fireSync(SyncManager manager, SyncSource source, int syncMode, boolean askServerCaps)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |