Oracle Database Mobile Server .Net Sync API  11.3.0.0.0
Mobile Sync Client .NET API specification
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties
Public Member Functions | Properties | List of all members
Oracle.OpenSync.OSE.OSESession Class Reference
Inheritance diagram for Oracle.OpenSync.OSE.OSESession:

Public Member Functions

 OSESession ()
 
 OSESession (string user)
 
 OSESession (string user, char[] pwd)
 
void Dispose ()
 
void Close ()
 
void SelectPub (string name)
 
void UnselectPubs ()
 
void SaveUser ()
 
void Sync ()
 
void CancelSync ()
 
void ShareConnection (string dbName, IntPtr hdl)
 
void UnshareConnection (string dbName)
 

Properties

SyncDirection SyncDirection [get, set]
 
EncryptionType EncryptionType [get, set]
 
TransportType TransportType [get, set]
 
bool SavePassword [get, set]
 
bool Background [get, set]
 
DataPriority SyncPriority [get, set]
 
bool SyncApps [get, set]
 
bool SyncNewPub [get, set]
 
bool ForceRefresh [get, set]
 
bool UseFiles [get, set]
 
bool UseResume [get, set]
 
string User [get]
 
char[] Password [set]
 
char[] NewPassword [set]
 
string URL [get, set]
 
string Proxy [get, set]
 
string AppRoot [get, set]
 
TransportDirection TransportDirection [get, set]
 
string FileURL [get, set]
 
OSETransport UserTransport [set]
 
OSEProgressHandler SyncProgress
 

Detailed Description

OSESession is the main class in .Net Sync API for native client. OSESession allows setting sync parameters and options, invoking sync, canceling sync and tracking sync progress. Note that in multithreaded environment a single OSESession is not supposed to be used concurrently from multiple threads. Each thread should open its own session. The only exception is calling OSESession.CancelSync from another thread.

Example:

     String user = "JOHN";
     String pwd  = "john";
     using(OSESession sess = new OSESession(user, pwd.toCharArray())
     {
         sess.setURL("localhost:88");
         sess.sync();
     }

Constructor & Destructor Documentation

Oracle.OpenSync.OSE.OSESession.OSESession ( )

Initialize OSESession with last user info saved in OSE meta files.

Exceptions
OSEExceptionif last user was not saved or error occured loading user configuration
See Also
OSEException
Oracle.OpenSync.OSE.OSESession.OSESession ( string  user)

Initialize OSESession with given user name. If the password was not saved, it can be set later by using Password property.

Parameters
usersync user name
Exceptions
OSEExceptionif error occured loading user configuration
See Also
Password
OSEException
Oracle.OpenSync.OSE.OSESession.OSESession ( string  user,
char[]  pwd 
)

Initialize OSESession with given user name and password.

Parameters
usersync user name sync password
Exceptions
OSEExceptionif error occured loading user configuration

Member Function Documentation

void Oracle.OpenSync.OSE.OSESession.CancelSync ( )

Cancels sync operation from another thread. This call returns immediately. There is no guarantee on how long it will take for the sync to abort.

void Oracle.OpenSync.OSE.OSESession.Close ( )

Close OSESession and release its resources

See Also
Dispose
void Oracle.OpenSync.OSE.OSESession.Dispose ( )

Close OSESession and release its resources

void Oracle.OpenSync.OSE.OSESession.SaveUser ( )

Save user information into OSE meta files. Usually this is done at the end of sync if changes are detected. This call allows to do it before sync. Password will be saved only if SavePassword property is set to true.

Exceptions
OSEExceptionif saving failed
void Oracle.OpenSync.OSE.OSESession.SelectPub ( string  name)

Select publication for selective sync. Select multiple publications by repeatedly calling this method.

Parameters
namepublication name
Exceptions
OSEExceptionif the publication with the given name was not found
void Oracle.OpenSync.OSE.OSESession.ShareConnection ( string  dbName,
IntPtr  hdl 
)

Provides database connection handle from the application to use in OSE engine, instead of engine opening its own database connection, which is default. The connection handle is set for the duration of the session unless explicitly unset by calling UnshareConnection().

Parameters
dbNamedatabase name connection handle, has to be a valid native handle for particular type of database as used in OSE plugin. For example, for sqlite and BDB plugins hdl value should be of native type "sqlite3 *".
Exceptions
OSEExceptionif plugin error has occured
See Also
UnshareConnection
void Oracle.OpenSync.OSE.OSESession.Sync ( )

Performs sync.

Exceptions
OSExceptionif sync failed or was canceled from another thread.
See Also
CancelSync
void Oracle.OpenSync.OSE.OSESession.UnselectPubs ( )

Unselect all publications and revert back from selective to normal sync.

void Oracle.OpenSync.OSE.OSESession.UnshareConnection ( string  dbName)

Unshares connection, which forces OSE engine to use its own database connection for this database

Parameters
dbNamedatabase name

Property Documentation

string Oracle.OpenSync.OSE.OSESession.AppRoot
getset

Gets or sets root directory for internal sync files. The default is the sync client installation bin directory.

bool Oracle.OpenSync.OSE.OSESession.Background
getset

Gets or sets flag which indicates whether sync should be background. The default is false, indicating foreground sync.

EncryptionType Oracle.OpenSync.OSE.OSESession.EncryptionType
getset

Gets or sets encryption type. The default is EncryptionType.AES

See Also
EncryptionType
string Oracle.OpenSync.OSE.OSESession.FileURL
getset

Gets or sets file url for file-based sync

bool Oracle.OpenSync.OSE.OSESession.ForceRefresh
getset

Gets or sets flag that indicates whether sync is force-refresh. The default is false.

char [] Oracle.OpenSync.OSE.OSESession.NewPassword
set

Sets new sync password in order to change password during next sync.

char [] Oracle.OpenSync.OSE.OSESession.Password
set

Sets sync password for this session

string Oracle.OpenSync.OSE.OSESession.Proxy
getset

Gets or sets http proxy in the format "host:port" or "host", in which case the port defaults to 80.

bool Oracle.OpenSync.OSE.OSESession.SavePassword
getset

Gets or sets flag which indicates whether user sync password should be saved on the client so it doesn't have to be explicitely provided to future sessions. The password is saved in encrypted form. The default is false.

bool Oracle.OpenSync.OSE.OSESession.SyncApps
getset

Gets or sets flag that indicates whether sync should download a list of application/client updates so they can later be installed. The default is true.

SyncDirection Oracle.OpenSync.OSE.OSESession.SyncDirection
getset

Gets or sets sync direction. The default is SyncDirection.SendReceive

See Also
SyncDirection
bool Oracle.OpenSync.OSE.OSESession.SyncNewPub
getset

Gets or sets flag that indicates whether new publication(s) can be created during sync. The default is true.

DataPriority Oracle.OpenSync.OSE.OSESession.SyncPriority
getset

Gets or sets sync priority. The default is SyncPriority.Normal

See Also
DataPriority
OSEProgressHandler Oracle.OpenSync.OSE.OSESession.SyncProgress
addremove

Adds or removes sync progress handlers

Exceptions
OSEExceptionif a handler could not be added or removed
See Also
OSEProgressHandler
TransportDirection Oracle.OpenSync.OSE.OSESession.TransportDirection
getset

Gets or sets transport direction. The default is TransportDirection.SendReceive

See Also
TransportDirection
TransportType Oracle.OpenSync.OSE.OSESession.TransportType
getset

Gets or sets transport type. The default is TransportType.Http

See Also
TransportType
string Oracle.OpenSync.OSE.OSESession.URL
getset

Gets or sets mobile server url

bool Oracle.OpenSync.OSE.OSESession.UseFiles
getset

Gets or sets flag that indicates whether files are used to temporarily store the data before it's sent/after it's received. The default is false.

string Oracle.OpenSync.OSE.OSESession.User
get

Gets sync user name for this session

bool Oracle.OpenSync.OSE.OSESession.UseResume
getset

Gets or sets flag that indicates whether resume protocol should be used on top of sync transport. UseFiles will be implicitely set to true if this property is set to true. The default is false.

OSETransport Oracle.OpenSync.OSE.OSESession.UserTransport
set

Sets custom user-defined transport. This will automatically set TransportType to TransportType.User

See Also
TransporType
OSETransport