|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.funambol.syncclient.spds.SyncManager
public class SyncManager
The SyncManager is the contact point between a host application and the synchronization engine. It is designed to hidden as much as possible the details of the synchronization logic, protocol, communication and so on; the simplest way to use it is to get an instance of the SyncManager and call its sync() method, as in the examples below:
SyncManager syncManager = SyncManager.getSyncManager("test"); syncManager.sync();
SyncManager syncManager = SyncManager.getSyncManager("test", runtimeProperties); syncManager.sync();getSyncManager() is a factory method that creates a new SyncManager bound to the given application URI. The application URI is an application identifier that must be unique amongst all the SyncPlatform-enabled applications running on the device. It is intended for future use.
username password device-idThe information required by the synchronization engine for initialization and to kick off a data synchronization session is stored in the device management configuration tree and can be manipulated by the means of the SyncPlatform Device Management API. See Funambol SyncClient API 2.0 Programmer Guide for more information.
Field Summary | |
---|---|
static java.lang.String |
AUTHENTICATION_BASIC
|
static java.lang.String |
AUTHENTICATION_CLEAR
|
static java.lang.String |
CONTEXT_SOURCES
Configuration context for sync sources |
static java.lang.String |
CONTEXT_SYNCAGENT
Configuration context for the SyncML agent |
static java.lang.String |
DEFAULT_MESSAGE_ENC
|
static java.lang.String |
DEFAULT_MESSAGETYPE
|
static java.lang.String |
MIMETYPE_SYNCMLDS_WBXML
|
static java.lang.String |
MIMETYPE_SYNCMLDS_XML
|
static java.lang.String |
PROP_APPLICATION_DISPLAY_NAME
|
static java.lang.String |
PROP_APPLICATION_SUPPORT_MAIL
|
static java.lang.String |
PROP_APPLICATION_SUPPORT_URL
|
static java.lang.String |
SESSION_ID
|
static java.lang.String |
STATUS_COMMAND_CHANGE
|
static java.lang.String |
STATUS_COMMAND_NEW
|
static java.lang.String |
SYNC_NONE
Synchronization modes |
static java.lang.String |
SYNC_ONEWAY
|
static java.lang.String |
SYNC_REFRESH
|
static java.lang.String |
SYNC_SLOW
|
static java.lang.String |
SYNC_TWOWAY
|
static java.lang.String |
TAG_ALERT
|
static java.lang.String |
TAG_CMD
|
static java.lang.String |
TAG_DATA
|
static java.lang.String |
TAG_ITEM
|
static java.lang.String |
TAG_LOCALURI
|
static java.lang.String |
TAG_STATUS
|
static java.lang.String |
TAG_SYNCBODY
|
static java.lang.String |
TAG_SYNCHDR
|
static java.lang.String |
TAG_SYNCML
|
static java.lang.String |
TAG_TARGET
|
static java.lang.String |
WBXML_SYNCML_CLIENT
|
static java.lang.String |
XML_SYNCML_CLIENT
|
Constructor Summary | |
---|---|
|
SyncManager(java.lang.String appURI)
Creates a SyncManager bound to a specific application. |
protected |
SyncManager(java.lang.String appURI,
java.util.Properties runtimeProperties)
Creates a SyncManager bound to a specific application. |
Method Summary | |
---|---|
void |
addSyncItemListener(SyncItemListener listener)
Register a new SyncItemListener. |
void |
addSyncListener(SyncListener listener)
Register a new SyncListener. |
void |
addSyncSourceListener(SyncSourceListener listener)
Register a new SyncSourceListener. |
void |
addSyncStatusListener(SyncStatusListener listener)
Register a new SyncStatusListener. |
void |
addSyncTransportListener(SyncTransportListener listener)
Register a new SyncTransportListener. |
void |
dataReceived(SyncTransportEvent syncTransportEvent)
Send syncTransportEvent to syncTransportListeners on dataReceived method. |
static java.lang.String |
getItemsFormat(java.util.Vector items,
char state)
Return the format of the first item in the vector that has the specified type |
static SyncManager |
getSyncManager(java.lang.String appURI)
This is a factory method for SyncManager instances. |
static SyncManager |
getSyncManager(java.lang.String appURI,
java.util.Properties runtimeProperties)
This is a factory method for SyncManager instances. |
void |
receiveDataBegin(SyncTransportEvent syncTransportEvent)
Send syncTransportEvent to syncTransportListeners on receiveDataBegin method. |
void |
receiveDataEnd(SyncTransportEvent syncTransportEvent)
Send syncTransportEvent to syncTransportListeners on receiveDataEnd method. |
void |
removeSyncItemListener(SyncItemListener listener)
Remove the specified SyncItemListener. |
void |
removeSyncListener(SyncListener listener)
Remove the specified SyncListener. |
void |
removeSyncSourceListener(SyncSourceListener listener)
Remove the specified SyncSourceListener. |
void |
removeSyncStatusListener(SyncStatusListener listener)
Remove the specified SyncStatusListener. |
void |
removeSyncTransportListener(SyncTransportListener listener)
Remove the specified SyncTransportListener. |
void |
sendDataBegin(SyncTransportEvent syncTransportEvent)
Send syncTransportEvent to syncTransportListeners on sendDataBegin method. |
void |
sendDataEnd(SyncTransportEvent syncTransportEvent)
Send syncTransportEvent to syncTransportListeners on sendDataEnd method. |
void |
sync()
Synchronize all registered synchronization sources. |
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 CONTEXT_SOURCES
public static final java.lang.String CONTEXT_SYNCAGENT
public static final java.lang.String SYNC_NONE
public static final java.lang.String SYNC_SLOW
public static final java.lang.String SYNC_TWOWAY
public static final java.lang.String SYNC_ONEWAY
public static final java.lang.String SYNC_REFRESH
public static final java.lang.String TAG_ALERT
public static final java.lang.String TAG_CMD
public static final java.lang.String TAG_DATA
public static final java.lang.String TAG_ITEM
public static final java.lang.String TAG_LOCALURI
public static final java.lang.String TAG_STATUS
public static final java.lang.String TAG_SYNCBODY
public static final java.lang.String TAG_SYNCHDR
public static final java.lang.String TAG_SYNCML
public static final java.lang.String TAG_TARGET
public static final java.lang.String PROP_APPLICATION_DISPLAY_NAME
public static final java.lang.String PROP_APPLICATION_SUPPORT_URL
public static final java.lang.String PROP_APPLICATION_SUPPORT_MAIL
public static final java.lang.String AUTHENTICATION_BASIC
public static final java.lang.String AUTHENTICATION_CLEAR
public static final java.lang.String SESSION_ID
public static final java.lang.String MIMETYPE_SYNCMLDS_XML
public static final java.lang.String MIMETYPE_SYNCMLDS_WBXML
public static final java.lang.String XML_SYNCML_CLIENT
public static final java.lang.String WBXML_SYNCML_CLIENT
public static final java.lang.String DEFAULT_MESSAGETYPE
public static final java.lang.String STATUS_COMMAND_NEW
public static final java.lang.String STATUS_COMMAND_CHANGE
public static final java.lang.String DEFAULT_MESSAGE_ENC
Constructor Detail |
---|
protected SyncManager(java.lang.String appURI, java.util.Properties runtimeProperties) throws SyncException
appURI
- The unique application URIruntimeProperties
- are properties set
in runtime and not load by Device Management, may be:
username password device-id
SyncException
- in case an error occurs during initializationpublic SyncManager(java.lang.String appURI) throws SyncException
appURI
- The unique application URI
SyncException
Method Detail |
---|
public static SyncManager getSyncManager(java.lang.String appURI) throws SyncException, DMException
appURI
- The unique application URI
SyncException
- in case of a synchronization engine related error
DMException
- in case of a configuration errorpublic static SyncManager getSyncManager(java.lang.String appURI, java.util.Properties runtimeProperties) throws SyncException, DMException
appURI
- The unique application URIruntimeProperties
- are properties set in runtime
and not load by Device Management, may be:
username password device-id
SyncException
- in case of a synchronization engine related error
DMException
- in case of a configuration errorpublic void sync() throws SyncException, AuthenticationException, UpdateException
SyncException
- if an error occurs during synchronization
UpdateException
- if an error occurs during an update on server
AuthenticationException
- if the server responded with
"non authorized" return codepublic void addSyncListener(SyncListener listener)
listener
- public void removeSyncListener(SyncListener listener)
listener
- public void addSyncTransportListener(SyncTransportListener listener)
listener
- public void removeSyncTransportListener(SyncTransportListener listener)
listener
- public void addSyncSourceListener(SyncSourceListener listener)
listener
- public void removeSyncSourceListener(SyncSourceListener listener)
listener
- public void addSyncItemListener(SyncItemListener listener)
listener
- public void removeSyncItemListener(SyncItemListener listener)
listener
- public void addSyncStatusListener(SyncStatusListener listener)
listener
- public void removeSyncStatusListener(SyncStatusListener listener)
listener
- public void sendDataBegin(SyncTransportEvent syncTransportEvent)
sendDataBegin
in interface SyncTransportListener
syncTransportEvent
- public void sendDataEnd(SyncTransportEvent syncTransportEvent)
sendDataEnd
in interface SyncTransportListener
syncTransportEvent
- public void receiveDataBegin(SyncTransportEvent syncTransportEvent)
receiveDataBegin
in interface SyncTransportListener
syncTransportEvent
- public void dataReceived(SyncTransportEvent syncTransportEvent)
dataReceived
in interface SyncTransportListener
syncTransportEvent
- public void receiveDataEnd(SyncTransportEvent syncTransportEvent)
receiveDataEnd
in interface SyncTransportListener
syncTransportEvent
- public static java.lang.String getItemsFormat(java.util.Vector items, char state)
items
- vector of itemsstate
- the type for wich the format will be returned (update, add)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |