Class SyncClient

Definition

Namespace:
Tizen.Account.SyncManager
Assembly:
Tizen.Account.SyncManager.dll
API Level:
4

The SyncClient APIs for managing the sync operations. Applications will call these APIs to schedule their sync operations. The sync service maintains sync requests from all the applications and invokes their respective callback methods to perform account synchronization operations.

C#
Copy
public static class SyncClient
Inheritance
SyncClient

Methods

View Source

AddDataChangeSyncJob(SyncJobData, SyncOption)

Requests the sync manager to perform sync operations whenever the corresponding DB is changed.

Declaration
C#
Copy
public static int AddDataChangeSyncJob(SyncJobData request, SyncOption syncOptions)
Parameters
Type Name Description
SyncJobData request

The sync job information of the sync job request.

SyncOption syncOptions

Sync options determine a way to operate the sync job and can be used as ORing.

Returns
Type Description
System.Int32

A unique value which can manage sync jobs. The number of sync job IDs is limited as it is less than hundred.

Exceptions
Type Condition
UnauthorizedAccessException

In case of a privilege is not defined.

ArgumentNullException

Thrown when any of the arguments are null.

InvalidOperationException

Thrown when the application calling this API doesn't have a sync adapter.

API Level: 4
Privilege Level: public
Privilege: http://tizen.org/privilege/calendar.readhttp://tizen.org/privilege/contact.read
View Source

AddPeriodicSyncJob(SyncJobData, SyncPeriod, SyncOption)

Requests the sync manager to perform periodic sync operations.

Declaration
C#
Copy
public static int AddPeriodicSyncJob(SyncJobData request, SyncPeriod period, SyncOption syncOptions)
Parameters
Type Name Description
SyncJobData request

The sync job information of the sync job request.

SyncPeriod period

Determines the time interval of the periodic sync. The periodic sync operation can be triggered in that interval, but it does not guarantee the exact time. The minimum value is 30 minutes.

SyncOption syncOptions

Sync options determine a way to operate the sync job and can be used as ORing.

Returns
Type Description
System.Int32

A unique value which can manage sync jobs. The number of sync job IDs is limited as it is less than hundred.

Exceptions
Type Condition
UnauthorizedAccessException

In case of a privilege not defined.

ArgumentNullException

Thrown when any of the arguments are null.

InvalidOperationException

Thrown when the application calling this API doesn't have a sync adapter.

API Level: 4
Privilege Level: public
Privilege: http://tizen.org/privilege/alarm.set
View Source

GetAllSyncJobs()

Gets all the sync jobs registered with the sync manager.

Declaration
C#
Copy
public static IEnumerable<KeyValuePair<int, SyncJobData>> GetAllSyncJobs()
Returns
Type Description
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.Int32, SyncJobData>>

Returns the list of SyncJobData corresponding to sync requests.

API Level: 4
View Source

RemoveSyncJob(Int32)

Requests the sync manager to remove the corresponding sync job based on the ID.

Declaration
C#
Copy
public static void RemoveSyncJob(int id)
Parameters
Type Name Description
System.Int32 id

A unique value of each sync job, it can be used to search a specific sync job and remove it.

Exceptions
Type Condition
System.ArgumentException

Thrown if the input arugments is invalid.

API Level: 4
View Source

RequestOnDemandSyncJob(SyncJobData, SyncOption)

Requests the sync manager to perform one time sync operation.

Declaration
C#
Copy
public static int RequestOnDemandSyncJob(SyncJobData request, SyncOption syncOptions)
Parameters
Type Name Description
SyncJobData request

The sync job information of the sync job request.

SyncOption syncOptions

Sync options determine a way to operate the sync job and can be used as ORing.

Returns
Type Description
System.Int32

An unique value which can manage sync jobs. The number of sync job ID is limite as it is less than hundred.

Exceptions
Type Condition
ArgumentNullException

Thrown when any of the arugments are null.

InvalidOperationException

Thrown when the application calling this API doesn't have a sync adapter.

API Level: 4