Class SyncClient
Definition
- Namespace:
- Tizen.Account.SyncManager
- Assembly:
- Tizen.Account.SyncManager.dll
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.
public static class SyncClient
- Inheritance
-
objectSyncClient
Methods
View SourceAddDataChangeSyncJob(SyncJobData, SyncOption)
Requests the sync manager to perform sync operations whenever the corresponding DB is changed.
Declaration
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 |
---|---|
int | 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 |
---|---|
System.UnauthorizedAccessException | In case of a privilege is not defined. |
System.ArgumentNullException | Thrown when any of the arguments are null. |
System.InvalidOperationException | Thrown when the application calling this API doesn't have a sync adapter. |
AddPeriodicSyncJob(SyncJobData, SyncPeriod, SyncOption)
Requests the sync manager to perform periodic sync operations.
Declaration
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 |
---|---|
int | 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 |
---|---|
System.UnauthorizedAccessException | In case of a privilege not defined. |
System.ArgumentNullException | Thrown when any of the arguments are null. |
System.InvalidOperationException | Thrown when the application calling this API doesn't have a sync adapter. |
GetAllSyncJobs()
Gets all the sync jobs registered with the sync manager.
Declaration
public static IEnumerable<KeyValuePair<int, SyncJobData>> GetAllSyncJobs()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T><System.Collections.Generic.KeyValuePair<TKey, TValue><int, SyncJobData>> | Returns the list of SyncJobData corresponding to sync requests. |
RemoveSyncJob(int)
Requests the sync manager to remove the corresponding sync job based on the ID.
Declaration
public static void RemoveSyncJob(int id)
Parameters
Type | Name | Description |
---|---|---|
int | 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. |
RequestOnDemandSyncJob(SyncJobData, SyncOption)
Requests the sync manager to perform one time sync operation.
Declaration
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 |
---|---|
int | 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 |
---|---|
System.ArgumentNullException | Thrown when any of the arugments are null. |
System.InvalidOperationException | Thrown when the application calling this API doesn't have a sync adapter. |