public class SyncEngine
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
void |
cancelHttpConnection(com.unvired.sync.out.ISyncAppCallback appCallback) |
static void |
destroy() |
CustomDataHandler |
getCustomDataHandler()
Gets the registered custom data handler.
|
static SyncEngine |
getInstance()
Gets the single instance of SyncEngine.
|
boolean |
getIsInDemoMode() |
java.util.Hashtable<java.lang.String,java.lang.String> |
getMobileApplicationSettings() |
IDataStructure[] |
getMobileUserSettings() |
com.unvired.utils.NetworkChangeReceiver |
getNetworkChangeReceiver() |
NotificationListener |
getNotificationListener() |
com.unvired.sync.in.IConflictHandler |
getSyncConflictHandler() |
com.unvired.sync.notifier.SynchronizationStateListener |
getSynchronizationStateListener() |
void |
initialize() |
boolean |
isInOutbox(java.lang.String beLid) |
boolean |
isInSentItems(java.lang.String beLid) |
void |
queuePushNotificationTestMessage() |
void |
receiveData() |
void |
registerCustomDataHandler(CustomDataHandler customDataHandler)
Registers a custom data handler for callback.
|
void |
registerDataRequestFunctionCallHandler(com.unvired.sync.in.DataRequestFunctionCallHandler dataRequestFunctionCallHandler) |
void |
registerNotificationListener(NotificationListener notificationListener)
Registers a notification listener.
|
void |
registerSyncConflictHandler(com.unvired.sync.in.IConflictHandler syncConflictHandler) |
void |
registerSynchronizationStateListener(com.unvired.sync.notifier.SynchronizationStateListener synchronizationStateListener)
Registers a Synchronization State Listener.
|
void |
resendDataInAsyncMode(com.unvired.model.OutObject outObject) |
void |
resubmitInAsyncMode(SyncConstants.MESSAGE_REQUEST_TYPE requestType,
IDataStructure dataStructure,
java.lang.String customData,
java.lang.String processAgentFunctionName,
java.lang.String beName,
java.lang.String beLid,
boolean byPassAttachment)
Resent data is same as send data in async mode
#resubmitInAsyncMode(MESSAGE_REQUEST_TYPE, IDataStructure, String, String, String, String, boolean)
has been sent to the server has resulted in an error then it can be
resent using this method. |
void |
sendAttachmentToServerAsync(com.unvired.model.AttachmentOutObject attachmentOutObject)
Do not use.
|
void |
sendDataRequest(java.lang.String functionName,
java.lang.String inputData)
Request data for the given process agent function which is marked for
pulling data from the backend servers.
|
void |
sendDataRequestForAllFunctions()
Request data for all process agent functions which are marked for pulling
data from the backend servers.
|
void |
sendDataRequests(java.util.Vector<java.lang.String> functions) |
void |
sendPushNotificationIdToServer(java.lang.String pushNotificationId) |
void |
sendToServerAsync(com.unvired.model.OutObject outObject)
Do not use.
|
void |
sendToServerSync(com.unvired.model.OutObject outObject)
Do not use.
|
void |
setMobileUserSettings(IDataStructure[] userSettingsDataStructures) |
void |
submitInAsyncMode(SyncConstants.MESSAGE_REQUEST_TYPE requestType,
IDataStructure dataStructure,
java.lang.String customData,
java.lang.String processAgentFunctionName,
java.lang.String beName,
java.lang.String beLid,
boolean byPassAttachment)
Exchange data with the server in asynchronous mode.
|
void |
submitInSyncMode(SyncConstants.MESSAGE_REQUEST_TYPE requestType,
IDataStructure dataStructure,
java.lang.String customData,
java.lang.String processAgentFunctionName,
boolean autoSave,
com.unvired.sync.out.ISyncAppCallback appCallback)
Exchange data with the server in synchronous mode.
|
public boolean getIsInDemoMode()
public static SyncEngine getInstance()
public static void destroy()
public void initialize()
public com.unvired.utils.NetworkChangeReceiver getNetworkChangeReceiver()
public void registerCustomDataHandler(CustomDataHandler customDataHandler)
customDataHandler - Custom data handler for call backpublic CustomDataHandler getCustomDataHandler()
public void registerSyncConflictHandler(com.unvired.sync.in.IConflictHandler syncConflictHandler)
public com.unvired.sync.in.IConflictHandler getSyncConflictHandler()
public void registerNotificationListener(NotificationListener notificationListener)
notificationListener - Set the Notification Listenerpublic NotificationListener getNotificationListener()
public void registerSynchronizationStateListener(com.unvired.sync.notifier.SynchronizationStateListener synchronizationStateListener)
Outbox items, processing Inbox items, receiving data,
waiting for network connection, being idle.synchronizationStateListener - public com.unvired.sync.notifier.SynchronizationStateListener getSynchronizationStateListener()
public void receiveData()
public void resubmitInAsyncMode(SyncConstants.MESSAGE_REQUEST_TYPE requestType, IDataStructure dataStructure, java.lang.String customData, java.lang.String processAgentFunctionName, java.lang.String beName, java.lang.String beLid, boolean byPassAttachment) throws ApplicationException
#resubmitInAsyncMode(MESSAGE_REQUEST_TYPE, IDataStructure, String, String, String, String, boolean)
has been sent to the server has resulted in an error then it can be
resent using this method.dataStructure - Data structure to be sent to the serverprocessAgentFunctionName - Name of the process agent that is required to be called in the
serverbyPassAttachment - Flag to indicate if attachment bypass is required.Pass true if attachment
bypass is required and false otherwise.ApplicationException - Throws ApplicationException if there is a failure while
queuing the data.public void resendDataInAsyncMode(com.unvired.model.OutObject outObject)
throws ApplicationException,
DBException
ApplicationExceptionDBExceptionpublic void sendToServerAsync(com.unvired.model.OutObject outObject)
throws ApplicationException,
DBException
outObject - ApplicationExceptionDBExceptionpublic void sendAttachmentToServerAsync(com.unvired.model.AttachmentOutObject attachmentOutObject)
throws ApplicationException
attachmentOutObject - ApplicationExceptionpublic void submitInSyncMode(SyncConstants.MESSAGE_REQUEST_TYPE requestType, IDataStructure dataStructure, java.lang.String customData, java.lang.String processAgentFunctionName, boolean autoSave, com.unvired.sync.out.ISyncAppCallback appCallback) throws ApplicationException, DBException
ISyncResponse. The response can
either be SyncBEResponse or SyncRawResponse.
SyncBEResponse is provided as the response when the output data
format is IBXML / standard data format. The data BEs in
SyncBEResponse is saved automatically if autoSave flag is
enabled. Otherwise the data BEs are provided to the caller for action.
SyncRawResponse is provided as the response when the output data
format is custom.requestType - MESSAGE_REQUEST_TYPE(RQST/PULL/PUSH/QUERY) to be sent to the server.customData - customData Custom data that has to be sent to the server. Data
can be in any format (as decided during the data modeling).dataStructure - Data structure to be sent to the server.processAgentFunctionName - Name of the process agent that is required to be called in the
server.autoSave - Flag to indicate if auto save is required.Pass true if auto
save is required and flase otherwise.ApplicationException - Throws ApplicationException if there is a failure while
queuing the data.DBException - Throws a DBException is the relevant data cannot be accesses
from the database.public void submitInAsyncMode(SyncConstants.MESSAGE_REQUEST_TYPE requestType, IDataStructure dataStructure, java.lang.String customData, java.lang.String processAgentFunctionName, java.lang.String beName, java.lang.String beLid, boolean byPassAttachment) throws ApplicationException, DBException
NotificationListener
implementation registered by the application.requestType - MESSAGE_REQUEST_TYPE(RQST/PULL/PUSH/QUERY) to be sent to the server.dataStructure - Data structure to be sent to the server.customData - customData Custom data that has to be sent to the server. Data
can be in any format (as decided during the data modeling).processAgentFunctionName - Name of the process agent that is required to be called in the
server.beName - StringbeLid - LongbyPassAttachment - Flag to indicate if attachment bypass is required.Pass true if attachment
bypass is required and false otherwise.ApplicationException - Throws ApplicationException if there is a failure while
queuing the data.DBException - Throws a DBException is the relevant data cannot be accesses
from the database.public void sendToServerSync(com.unvired.model.OutObject outObject)
throws ApplicationException,
DBException
outObject - ApplicationExceptionDBExceptionpublic boolean isInOutbox(java.lang.String beLid)
throws ApplicationException
ApplicationExceptionpublic boolean isInSentItems(java.lang.String beLid)
throws ApplicationException
ApplicationExceptionpublic void sendDataRequestForAllFunctions()
throws ApplicationException,
DBException
ApplicationException - Throws ApplicationException if there is a failure while
requesting the data.DBExceptionpublic void registerDataRequestFunctionCallHandler(com.unvired.sync.in.DataRequestFunctionCallHandler dataRequestFunctionCallHandler)
public void sendDataRequests(java.util.Vector<java.lang.String> functions)
throws ApplicationException,
DBException
ApplicationExceptionDBExceptionpublic void sendDataRequest(java.lang.String functionName,
java.lang.String inputData)
throws ApplicationException,
DBException
functionName - Process agent function name required to run in the serverinputData - Input data for the process agent function, if the process
agent function take input (Optional).ApplicationException - Throws ApplicationException if there is a failure while
requesting the data.DBException - the dB exceptionpublic void sendPushNotificationIdToServer(java.lang.String pushNotificationId)
throws ApplicationException,
DBException
ApplicationExceptionDBExceptionpublic java.util.Hashtable<java.lang.String,java.lang.String> getMobileApplicationSettings()
public IDataStructure[] getMobileUserSettings()
public void setMobileUserSettings(IDataStructure[] userSettingsDataStructures)
public void cancelHttpConnection(com.unvired.sync.out.ISyncAppCallback appCallback)
public void queuePushNotificationTestMessage()
Copyright © 2017 Unvired Inc. All Rights Reserved.