C# Class Amazon.CognitoSync.SyncManager.Dataset

Inheritance: IDisposable
Afficher le fichier Open project: aws/aws-sdk-net Class Usage Examples

Private Properties

Свойство Type Description
Dataset Amazon.CognitoIdentity
DatasetSetupInternal void
EndSynchronizeAndCleanup void
HandleNetworkChange void
HandleNetworkChange void
OnNetworkReachabilityChanged void
RunSyncOperation void
RunSyncOperation void
RunSyncOperationAsync System.Threading.Task
SynchronizeHelper void
SynchronizeHelperAsync System.Threading.Task
SynchronizeHelperAsync void

Méthodes publiques

Méthode Description
Delete ( ) : void

Delete this Amazon.CognitoSync.SyncManager.Dataset. You cannot do any more operations on this dataset.

Dispose ( ) : void

Releases the resources consumed by this object

Get ( string key ) : string

Gets the value of a with the given key. If the Amazon.CognitoSync.SyncManager.Record doesn't exist or is marked deleted, null will be returned.

GetRecord ( string key ) : Record

Gets the Amazon.CognitoSync.SyncManager.Record with the given key. If the Amazon.CognitoSync.SyncManager.Record doesn't exist or is marked deleted, null will be returned.

GetSizeInBytes ( string key ) : long

Gets the size of a record with the given key. If the key is deleted, -1 will be returned. The size is calculated as sum of UTF-8 string length of record key and value

IsModified ( string key ) : bool

Retrieves the status of a record.

Put ( string key, string value ) : void

Puts a Amazon.CognitoSync.SyncManager.Record with the given key and value into the Dataset. If a Amazon.CognitoSync.SyncManager.Record with the same key exists, its value will be overwritten. If a Amazon.CognitoSync.SyncManager.Record is marked as deleted previously, then it will be resurrected with new value while the sync count continues with previous value. No matter whether the value changes or not, the record is considered as updated, and it will be written to Cognito Sync service on next synchronize operation. If value is null, a ArgumentNullException will be thrown.

PutAll ( string>.IDictionary values ) : void

Populates a dataset with a dictionary of key/value pairs

Remove ( string key ) : void

Marks a Amazon.CognitoSync.SyncManager.Record with the given key as deleted. Nothing happens if the Amazon.CognitoSync.SyncManager.Record doesn't exist or is deleted already.

Resolve ( List remoteRecords ) : void

Saves resolved conflicting Amazon.CognitoSync.SyncManager.Record into local storage. This is used inside SyncConflictDelegate after you resolve all conflicts.

Synchronize ( ) : void

Synchronize Dataset between local storage and remote storage.

SynchronizeAsync ( CancellationToken cancellationToken = default(CancellationToken) ) : System.Threading.Task

Synchronize Dataset between local storage and remote storage.

SynchronizeAsync ( AsyncOptions options = null ) : void

Synchronize Dataset between local storage and remote storage.

SynchronizeOnConnectivity ( CancellationToken cancellationToken = default(CancellationToken) ) : System.Threading.Task

Attempt to synchronize Dataset when connectivity is available. If the connectivity is available right away, it behaves the same as Dataset.SynchronizeAsync. Otherwise it listens to connectivity changes, and will do a sync once the connectivity is back. Note that if this method is called multiple times, only the last synchronize request is kept. If either the dataset or the callback is garbage collected , this method will not perform a sync and the callback won't fire.

SynchronizeOnConnectivity ( ) : void

Attempt to synchronize Dataset when connectivity is available. If the connectivity is available right away, it behaves the same as Dataset.Synchronize(). Otherwise it listens to connectivity changes, and will do a sync once the connectivity is back. Note that if this method is called multiple times, only the last synchronize request is kept. If either the dataset or the callback is garbage collected , this method will not perform a sync and the callback won't fire.

SynchronizeOnConnectivity ( AsyncOptions options = null ) : void

Attempt to synchronize Dataset when connectivity is available. If the connectivity is available right away, it behaves the same as Dataset.SynchronizeAsync(AsyncOptions). Otherwise it listens to connectivity changes, and will do a sync once the connectivity is back. Note that if this method is called multiple times, only the last synchronize request is kept. If either the dataset or the callback is garbage collected , this method will not perform a sync and the callback won't fire.

SynchronizeOnConnectivity ( CancellationToken cancellationToken = default(CancellationToken) ) : void

Attempt to synchronize Dataset when connectivity is available. If the connectivity is available right away, it behaves the same as Dataset.SynchronizeAsync. Otherwise it listens to connectivity changes, and will do a sync once the connectivity is back. Note that if this method is called multiple times, only the last synchronize request is kept. If either the dataset or the callback is garbage collected , this method will not perform a sync and the callback won't fire.

Méthodes protégées

Méthode Description
Dispose ( bool disposing ) : void

Releases the resources consumed by this object if disposing is true.

FireSyncFailureEvent ( Exception exception, AsyncOptions options ) : void

Fires a Sync Failure event.

FireSyncSuccessEvent ( List records, AsyncOptions options ) : void

Fires a Sync Success Event

Private Methods

Méthode Description
Dataset ( string datasetName, CognitoAWSCredentials cognitoCredentials, ILocalStorage local, CognitoSyncStorage remote ) : Amazon.CognitoIdentity

Creates a new Dataset

DatasetSetupInternal ( ) : void
EndSynchronizeAndCleanup ( ) : void
HandleNetworkChange ( object sender, System.Net.NetworkInformation.NetworkAvailabilityEventArgs e ) : void
HandleNetworkChange ( object sender, NetworkStatusEventArgs e ) : void
OnNetworkReachabilityChanged ( object sender, NetworkStatusEventArgs e ) : void
RunSyncOperation ( int retry ) : void
RunSyncOperation ( int retry, Runtime options ) : void
RunSyncOperationAsync ( int retry, CancellationToken cancellationToken ) : System.Threading.Task
SynchronizeHelper ( ) : void
SynchronizeHelperAsync ( CancellationToken cancellationToken ) : System.Threading.Task
SynchronizeHelperAsync ( AsyncOptions options ) : void

Method Details

Delete() public méthode

Delete this Amazon.CognitoSync.SyncManager.Dataset. You cannot do any more operations on this dataset.
public Delete ( ) : void
Résultat void

Dispose() public méthode

Releases the resources consumed by this object
public Dispose ( ) : void
Résultat void

Dispose() protected méthode

Releases the resources consumed by this object if disposing is true.
protected Dispose ( bool disposing ) : void
disposing bool
Résultat void

FireSyncFailureEvent() protected méthode

Fires a Sync Failure event.
protected FireSyncFailureEvent ( Exception exception, AsyncOptions options ) : void
exception System.Exception Exception object which caused the sync Failure
options AsyncOptions AsyncOptions object that controls whether
Résultat void

FireSyncSuccessEvent() protected méthode

Fires a Sync Success Event
protected FireSyncSuccessEvent ( List records, AsyncOptions options ) : void
records List List of records after successful sync
options AsyncOptions AsyncOptions object that controls whether
Résultat void

Get() public méthode

Gets the value of a with the given key. If the Amazon.CognitoSync.SyncManager.Record doesn't exist or is marked deleted, null will be returned.
public Get ( string key ) : string
key string Key of the record in the dataset.
Résultat string

GetRecord() public méthode

Gets the Amazon.CognitoSync.SyncManager.Record with the given key. If the Amazon.CognitoSync.SyncManager.Record doesn't exist or is marked deleted, null will be returned.
public GetRecord ( string key ) : Record
key string Key of the record in the dataset.
Résultat Record

GetSizeInBytes() public méthode

Gets the size of a record with the given key. If the key is deleted, -1 will be returned. The size is calculated as sum of UTF-8 string length of record key and value
public GetSizeInBytes ( string key ) : long
key string The key of a record
Résultat long

IsModified() public méthode

Retrieves the status of a record.
public IsModified ( string key ) : bool
key string Key identifying a record
Résultat bool

Put() public méthode

Puts a Amazon.CognitoSync.SyncManager.Record with the given key and value into the Dataset. If a Amazon.CognitoSync.SyncManager.Record with the same key exists, its value will be overwritten. If a Amazon.CognitoSync.SyncManager.Record is marked as deleted previously, then it will be resurrected with new value while the sync count continues with previous value. No matter whether the value changes or not, the record is considered as updated, and it will be written to Cognito Sync service on next synchronize operation. If value is null, a ArgumentNullException will be thrown.
public Put ( string key, string value ) : void
key string Key of the record
value string String value of a to be put into the ///
Résultat void

PutAll() public méthode

Populates a dataset with a dictionary of key/value pairs
public PutAll ( string>.IDictionary values ) : void
values string>.IDictionary An IDictionary of key/value pairs
Résultat void

Remove() public méthode

Marks a Amazon.CognitoSync.SyncManager.Record with the given key as deleted. Nothing happens if the Amazon.CognitoSync.SyncManager.Record doesn't exist or is deleted already.
public Remove ( string key ) : void
key string Key identifying the Record
Résultat void

Resolve() public méthode

Saves resolved conflicting Amazon.CognitoSync.SyncManager.Record into local storage. This is used inside SyncConflictDelegate after you resolve all conflicts.
public Resolve ( List remoteRecords ) : void
remoteRecords List A list of records to save into local storage
Résultat void

Synchronize() public méthode

Synchronize Dataset between local storage and remote storage.
public Synchronize ( ) : void
Résultat void

SynchronizeAsync() public méthode

Synchronize Dataset between local storage and remote storage.
public SynchronizeAsync ( CancellationToken cancellationToken = default(CancellationToken) ) : System.Threading.Task
cancellationToken System.Threading.CancellationToken
Résultat System.Threading.Task

SynchronizeAsync() public méthode

Synchronize Dataset between local storage and remote storage.
public SynchronizeAsync ( AsyncOptions options = null ) : void
options AsyncOptions
Résultat void

SynchronizeOnConnectivity() public méthode

Attempt to synchronize Dataset when connectivity is available. If the connectivity is available right away, it behaves the same as Dataset.SynchronizeAsync. Otherwise it listens to connectivity changes, and will do a sync once the connectivity is back. Note that if this method is called multiple times, only the last synchronize request is kept. If either the dataset or the callback is garbage collected , this method will not perform a sync and the callback won't fire.
public SynchronizeOnConnectivity ( CancellationToken cancellationToken = default(CancellationToken) ) : System.Threading.Task
cancellationToken System.Threading.CancellationToken
Résultat System.Threading.Task

SynchronizeOnConnectivity() public méthode

Attempt to synchronize Dataset when connectivity is available. If the connectivity is available right away, it behaves the same as Dataset.Synchronize(). Otherwise it listens to connectivity changes, and will do a sync once the connectivity is back. Note that if this method is called multiple times, only the last synchronize request is kept. If either the dataset or the callback is garbage collected , this method will not perform a sync and the callback won't fire.
public SynchronizeOnConnectivity ( ) : void
Résultat void

SynchronizeOnConnectivity() public méthode

Attempt to synchronize Dataset when connectivity is available. If the connectivity is available right away, it behaves the same as Dataset.SynchronizeAsync(AsyncOptions). Otherwise it listens to connectivity changes, and will do a sync once the connectivity is back. Note that if this method is called multiple times, only the last synchronize request is kept. If either the dataset or the callback is garbage collected , this method will not perform a sync and the callback won't fire.
public SynchronizeOnConnectivity ( AsyncOptions options = null ) : void
options AsyncOptions
Résultat void

SynchronizeOnConnectivity() public méthode

Attempt to synchronize Dataset when connectivity is available. If the connectivity is available right away, it behaves the same as Dataset.SynchronizeAsync. Otherwise it listens to connectivity changes, and will do a sync once the connectivity is back. Note that if this method is called multiple times, only the last synchronize request is kept. If either the dataset or the callback is garbage collected , this method will not perform a sync and the callback won't fire.
public SynchronizeOnConnectivity ( CancellationToken cancellationToken = default(CancellationToken) ) : void
cancellationToken System.Threading.CancellationToken
Résultat void