|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.funambol.client.controller.SynchronizationController
public class SynchronizationController
This class provides a basic controller that can be used by any other controller that needs synchronization support. This controller is just a building block, it does not control any UI component. But it shall be extended by controllers that need synchronization capabilities (e.g. HomeScreenController and AccountScreenController).
Field Summary | |
---|---|
protected AppSyncSourceManager |
appSyncSourceManager
|
protected Configuration |
configuration
|
protected Controller |
controller
|
protected AppSyncSource |
currentSource
|
protected Customization |
customization
|
protected boolean |
doCancel
|
protected SyncEngine |
engine
|
protected Localization |
localization
|
protected boolean |
logConnectivityError
|
static java.lang.String |
MANUAL
|
static java.lang.String |
PUSH
|
static int |
REFRESH_FROM_SERVER
|
static int |
REFRESH_TO_SERVER
|
static java.lang.String |
SCHEDULED
|
protected boolean |
showTCPAlert
|
Method Summary | |
---|---|
void |
beginSync()
A sync is about to begin. |
void |
cancelSync()
Try to cancel the current sync. |
void |
clearErrors()
|
boolean |
confirmDeletes(java.util.Enumeration sourceNameList)
Invoked if there are many items to delete. |
void |
connectionClosed()
|
void |
connectionConfigurationChanged()
|
void |
connectionOpened()
|
void |
continueSynchronizationAfterDialogCheck(java.lang.String syncType,
java.util.Vector filteredSources,
boolean refresh,
int direction,
int delay,
boolean fromOutside,
boolean continueSyncFromDialog)
|
protected SyncEngine |
createSyncEngine()
|
void |
endSync(java.util.Vector sources,
boolean hadErrors)
The synchronizaion has been completed for the given sources. |
protected void |
forceSynchronization(java.lang.String syncType,
java.util.Vector syncSources,
boolean refresh,
int direction,
int delay,
boolean fromOutside)
|
Controller |
getController()
|
AppSyncSource |
getCurrentSource()
Returns the sync source currently being synchronized. |
java.lang.String |
getRemoteUri(AppSyncSource appSource)
|
SyncEngine |
getSyncEngine()
|
boolean |
isCancelled()
Check if the current sync should be cancelled |
boolean |
isConnectionConfigurationAllowed(java.lang.String apn)
|
boolean |
isSynchronizing()
Returns true iff a synchronization is in progress |
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 |
refresh(int mask,
int direction)
Perform a refresh for a set of sources and a given direction. |
void |
refreshSources(java.util.Vector syncSources,
int direction)
|
void |
requestWritten()
|
void |
responseReceived()
|
void |
serverOperationFailed()
|
void |
setCancel(boolean value)
|
void |
setIsUserConfirmationNeeded(boolean value)
|
protected void |
setScreen(Screen screen)
|
void |
showPendingFirstSyncQuestion()
|
void |
sourceEnded(AppSyncSource appSource)
This method notifies that a source has completed its synchronization |
void |
sourceFailed(AppSyncSource appSource,
SyncException e)
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) |
void |
synchronize(java.lang.String syncType,
java.util.Vector syncSources)
Triggers a synchronization for the given syncSources. |
void |
synchronize(java.lang.String syncType,
java.util.Vector syncSources,
int delay)
Schedules a synchronization for the given syncSources. |
void |
synchronize(java.lang.String syncType,
java.util.Vector syncSources,
int delay,
boolean fromOutside)
Schedules a synchronization for the given syncSources. |
boolean |
syncStarted(java.util.Vector sources)
A sync for the given sources is about to begin. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String MANUAL
public static final java.lang.String SCHEDULED
public static final java.lang.String PUSH
public static final int REFRESH_FROM_SERVER
public static final int REFRESH_TO_SERVER
protected Controller controller
protected Customization customization
protected Configuration configuration
protected AppSyncSourceManager appSyncSourceManager
protected Localization localization
protected SyncEngine engine
protected boolean doCancel
protected AppSyncSource currentSource
protected boolean showTCPAlert
protected boolean logConnectivityError
Method Detail |
---|
public boolean isSynchronizing()
public AppSyncSource getCurrentSource()
public SyncEngine getSyncEngine()
SyncEngine
instancepublic void cancelSync()
public void refresh(int mask, int direction)
syncMask
- the set of sources to syncdirection
- the refresh directionpublic void refreshSources(java.util.Vector syncSources, int direction)
public void syncEnded()
SyncEngineListener
syncEnded
in interface SyncEngineListener
public void synchronize(java.lang.String syncType, java.util.Vector syncSources)
syncType
- the caller type (SYNC_TYPE_MANUAL, SYNC_TYPE_SCHEDULED)syncSources
- is a vector of AppSyncSource to be syncedpublic void synchronize(java.lang.String syncType, java.util.Vector syncSources, int delay)
syncType
- the caller type (SYNC_TYPE_MANUAL, SYNC_TYPE_SCHEDULED)syncSources
- is a vector of AppSyncSource to be synceddelay
- the interval at which the sync shall be performed (relative
to now)public void synchronize(java.lang.String syncType, java.util.Vector syncSources, int delay, boolean fromOutside)
syncType
- the caller type (SYNC_TYPE_MANUAL, SYNC_TYPE_SCHEDULED)syncSources
- is a vector of AppSyncSource to be synceddelay
- the interval at which the sync shall be performed (relative
to now)fromOutside
- specifies if the request is generated outside of the
applicationprotected void forceSynchronization(java.lang.String syncType, java.util.Vector syncSources, boolean refresh, int direction, int delay, boolean fromOutside)
public void showPendingFirstSyncQuestion()
public void continueSynchronizationAfterDialogCheck(java.lang.String syncType, java.util.Vector filteredSources, boolean refresh, int direction, int delay, boolean fromOutside, boolean continueSyncFromDialog)
public boolean confirmDeletes(java.util.Enumeration sourceNameList)
SyncEngineListener
confirmDeletes
in interface SyncEngineListener
public boolean isConnectionConfigurationAllowed(java.lang.String apn)
public void noCredentials()
SyncEngineListener
noCredentials
in interface SyncEngineListener
public void noSources()
SyncEngineListener
noSources
in interface SyncEngineListener
public void noConnection()
SyncEngineListener
noConnection
in interface SyncEngineListener
public void noSignal()
SyncEngineListener
noSignal
in interface SyncEngineListener
public void setCancel(boolean value)
public boolean isCancelled()
isCancelled
in interface SyncEngineListener
public void setIsUserConfirmationNeeded(boolean value)
public void beginSync()
SyncEngineListener
beginSync
in interface SyncEngineListener
public boolean syncStarted(java.util.Vector sources)
SyncEngineListener
syncStarted
in interface SyncEngineListener
public void endSync(java.util.Vector sources, boolean hadErrors)
SyncEngineListener
endSync
in interface SyncEngineListener
sources
- the list of sources being synchronizedpublic void sourceStarted(AppSyncSource appSource)
SyncEngineListener
sourceStarted
in interface SyncEngineListener
public void sourceEnded(AppSyncSource appSource)
SyncEngineListener
sourceEnded
in interface SyncEngineListener
public void sourceFailed(AppSyncSource appSource, SyncException e)
SyncEngineListener
sourceFailed
in interface SyncEngineListener
public java.lang.String getRemoteUri(AppSyncSource appSource)
public void serverOperationFailed()
public Controller getController()
public void clearErrors()
public void connectionOpened()
public void requestWritten()
public void responseReceived()
public void connectionClosed()
public void connectionConfigurationChanged()
protected void setScreen(Screen screen)
protected SyncEngine createSyncEngine()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |