Oracle Database Mobile Server .Net Sync API
12.1.0.0.0
Mobile Sync Client .NET API specification
|
Public Member Functions | |
BGSession () | |
void | Dispose () |
void | Close () |
void | Start () |
void | StartInternal () |
void | Stop () |
void | Kill () |
void | Pause () |
void | Resume () |
bool | WaitForStatus (BGStatusCode statusCode, long timeOut) |
void | WaitForStatus (BGStatusCode statusCode) |
BGAgentStatus | GetAgentStatus () |
BGSyncStatus | GetSyncStatus () |
void | ShowUI () |
Properties | |
BGStatusCode | StatusCode [get] |
BGMessageHandler | MessageReceived |
bool | Enabled [get, set] |
This class represents background sync control APIs. It allows application to control sync agent (such as start, stop, pause and resume) as well as to get various background sync status information and also to specify custom handlers for events that occur in background sync. Note that in multithreaded environment a single BGSession is not supposed to be used from multiple threads. Each thread should open its own session.
Example:
BGSession sess = new BGSession(); using(BGsession sess = new BGSession()) { sess.Start(); sess.WaitForStatus(BGAgentStatus.RUNNING); BGAgentStatus s = sess.getAgentStatus(); Console.WriteLine("User name: " + s.clientId); sess.MessageReceived += new BGMessageHandler(myHandler); ... }
Oracle.OpenSync.SyncAgent.BGSession.BGSession | ( | ) |
Create new session to interact with sync agent. Does not automatically start sync agent.
BGException | - if the session could not be established |
void Oracle.OpenSync.SyncAgent.BGSession.Close | ( | ) |
Close the session and release all its resources.
void Oracle.OpenSync.SyncAgent.BGSession.Dispose | ( | ) |
Close the session and release all its resources.
BGAgentStatus Oracle.OpenSync.SyncAgent.BGSession.GetAgentStatus | ( | ) |
Get current sync agent status information.
BGException | - if the status could not be obtained |
BGSyncStatus Oracle.OpenSync.SyncAgent.BGSession.GetSyncStatus | ( | ) |
Get current status of sync within sync agent
BGException | - if the sync status could not be obtained |
void Oracle.OpenSync.SyncAgent.BGSession.Kill | ( | ) |
Forcefully terminate sync agent process instead of trying to stop it gracefully. Use this option as a last resort, if the Stop method is not working because some tasks are hanging in sync agent. Also not recommended if sync agent was started with StartInternal().
void Oracle.OpenSync.SyncAgent.BGSession.Pause | ( | ) |
Pause sync agent. If the agent is already paused or being paused this call has no effect. This call is asynchronous, it does not wait for sync agent to be paused before returning. Use waitForStatus(int, long) to wait for sync agent.
BGException | - if sync agent is not in the state RUNNING, PAUSED, or PAUSE_PENDING or a system error has occured. |
void Oracle.OpenSync.SyncAgent.BGSession.Resume | ( | ) |
Resume sync agent. If the agent is already running, starting, or resuming this call has no effect. This call is asynchronous, it does not wait for sync agent to be resumed before returning. Use waitForStatus(int, long) to wait for sync agent.
BGException | - if sync agent is not in the state PAUSED, RESUME_PENDING, START_PENDING or RUNNING or a system error has occured. |
void Oracle.OpenSync.SyncAgent.BGSession.ShowUI | ( | ) |
Bring up sync agent UI. Currently this function is not supported for native clients and does nothing.
void Oracle.OpenSync.SyncAgent.BGSession.Start | ( | ) |
Start sync agent. If the agent is aready running, starting, or resuming this call has no effect. If the agent is paused, this call with resume the agent. This call is asynchronous, it does not wait for sync agent to be started before returning. Use waitForStatus() to wait for sync agent.
BGException | - if sync agent is not in the state STOPPED, START_PENDING, RUNNING, PAUSED or RESUME_PENDING (that is the agent is in the state PAUSE_PENDING or STOP_PENDING), if sync agent is disabled or a system error has occured. |
void Oracle.OpenSync.SyncAgent.BGSession.StartInternal | ( | ) |
Same as Start, but starts sync agent within application process.
BGException |
void Oracle.OpenSync.SyncAgent.BGSession.Stop | ( | ) |
Stop sync agent. If the agent is already stopped or stopping this call has no effect. This call is asynchronous, it does not wait for sync agent to be stopped before returning. Use waitForStatus(int, long) to wait for sync agent.
BGException | - if sync agent is not in the state RUNNING, PAUSED, STOPPED or STOP_PENDING or a system error has occured. |
bool Oracle.OpenSync.SyncAgent.BGSession.WaitForStatus | ( | BGStatusCode | statusCode, |
long | timeOut | ||
) |
Wait for sync agent to reach specified status.
statusCode | - the status to wait for. Only RUNNING, PAUSED or STOPPED are accepted. |
timeOut | - maximum time to wait for in milliseconds |
BGException | - if the statusCode parameter is not one of the values above or a system error has occurred. |
void Oracle.OpenSync.SyncAgent.BGSession.WaitForStatus | ( | BGStatusCode | statusCode) |
Wait for sync agent to reached specified status. Same as waitForStatus(int, long) but with unlimited timeout.
statusCode | - status to wait for |
BGException |
|
getset |
Gets or sets "Enabled" property of sync agent. The parameter "BGSYNC.DISABLE" in ose.ini will be set to TRUE or FALSE when this property is set to false or true correspondingly. When sync agent is disabled it is not allowed to start. This is useful when only foreground sync is desired.
|
addremove |
Adds or removes message handlers used to handle background sync events
BGException | if a handler could not be added or removed |
|
get |
Get current sync agent status code.