C# Class Amazon.CognitoSync.SyncManager.CognitoSyncManager

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

Méthodes publiques

Méthode Description
BeginRefreshDatasetMetadata ( AsyncCallback callback, object state ) : IAsyncResult

Initiates the asynchronous execution of the RefreshDatasetMetadata operation. Refreshes dataset metadata. Dataset metadata is pulled from remote storage and stored in local storage. Their record data isn't pulled down until you sync each dataset.

CognitoSyncManager ( CognitoAWSCredentials cognitoCredentials ) : System

Creates an instance of CognitoSyncManager using Cognito Credentials, the region is picked up from the config if it available CognitoSyncManager cognitoSyncManager = new CognitoSyncManager(credentials)

CognitoSyncManager ( CognitoAWSCredentials cognitoCredentials, AmazonCognitoSyncConfig config ) : System

Creates an instance of CognitoSyncManager using cognito credentials and a configuration object CognitoSyncManager cognitoSyncManager = new CognitoSyncManager(credentials,new AmazonCognitoSyncConfig { RegionEndpoint = RegionEndpoint.USEAST1})

CognitoSyncManager ( CognitoAWSCredentials cognitoCredentials, RegionEndpoint endpoint ) : System

Creates an instance of CognitoSyncManager using cognito credentials and a specific region CognitoSyncManager cognitoSyncManager = new CognitoSyncManager(credentials, RegionEndpoint.USEAST1)

Dispose ( ) : void

Releases the resources consumed by this object

EndRefreshDatasetMetadata ( IAsyncResult asyncResult ) : List

Finishes the asynchronous execution of the RefreshDatasetMetadata operation.

ListDatasets ( ) : List

Retrieves a list of datasets from local storage. It may not reflect the latest dataset on the remote storage until the RefreshDatasetMetadata operation is performed.

OpenOrCreateDataset ( string datasetName ) : Dataset

Opens or creates a dataset. If the dataset doesn't exist, an empty one with the given name will be created. Otherwise, the dataset is loaded from local storage. If a dataset is marked as deleted but hasn't been deleted on remote via the RefreshDatasetMetadata operation, it will throw System.InvalidOperationException. Dataset dataset = cognitoSyncManager.OpenOrCreateDataset("myDatasetName");

RefreshDatasetMetadataAsync ( CancellationToken cancellationToken = default(CancellationToken) ) : Task>

Refreshes dataset metadata. Dataset metadata is pulled from remote storage and stored in local storage. Their record data isn't pulled down until you sync each dataset.

RefreshDatasetMetadataAsync ( AmazonCognitoSyncCallback callback, AsyncOptions options = null ) : void

Refreshes dataset metadata. Dataset metadata is pulled from remote storage and stored in local storage. Their record data isn't pulled down until you sync each dataset.

WipeData ( ) : void

Wipes all user data cached locally, including identity id, session credentials, dataset metadata, and all records. Any data that hasn't been synced will be lost. This method is usually used when customer logs out.

WipeData ( bool wipeCredentialsAndID ) : void

Wipes all user data cached locally, including dataset metadata, and all records, and optionally identity id and session credentials. Any data that hasn't been synced will be lost. This method is usually used when customer logs out. Wipe Credentials and IdentityId.

Méthodes protégées

Méthode Description
Dispose ( bool disposing ) : void

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

IdentityChanged ( object sender, EventArgs e ) : void

This is triggered when an Identity Change event occurs. The dataset are then remapped to the new identity id. This may happend for example when a user is working with unauthenticated id and later decides to authenticate himself with a public login provider

Private Methods

Méthode Description
ValidateParameters ( ) : void

Method Details

BeginRefreshDatasetMetadata() public méthode

Initiates the asynchronous execution of the RefreshDatasetMetadata operation. Refreshes dataset metadata. Dataset metadata is pulled from remote storage and stored in local storage. Their record data isn't pulled down until you sync each dataset.
public BeginRefreshDatasetMetadata ( AsyncCallback callback, object state ) : IAsyncResult
callback AsyncCallback An AsyncCallback delegate that is invoked when the operation completes.
state object A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.
Résultat IAsyncResult

CognitoSyncManager() public méthode

Creates an instance of CognitoSyncManager using Cognito Credentials, the region is picked up from the config if it available CognitoSyncManager cognitoSyncManager = new CognitoSyncManager(credentials)
public CognitoSyncManager ( CognitoAWSCredentials cognitoCredentials ) : System
cognitoCredentials CognitoAWSCredentials
Résultat System

CognitoSyncManager() public méthode

Creates an instance of CognitoSyncManager using cognito credentials and a configuration object CognitoSyncManager cognitoSyncManager = new CognitoSyncManager(credentials,new AmazonCognitoSyncConfig { RegionEndpoint = RegionEndpoint.USEAST1})
public CognitoSyncManager ( CognitoAWSCredentials cognitoCredentials, AmazonCognitoSyncConfig config ) : System
cognitoCredentials CognitoAWSCredentials
config AmazonCognitoSyncConfig
Résultat System

CognitoSyncManager() public méthode

Creates an instance of CognitoSyncManager using cognito credentials and a specific region CognitoSyncManager cognitoSyncManager = new CognitoSyncManager(credentials, RegionEndpoint.USEAST1)
public CognitoSyncManager ( CognitoAWSCredentials cognitoCredentials, RegionEndpoint endpoint ) : System
cognitoCredentials CognitoAWSCredentials
endpoint RegionEndpoint
Résultat System

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

EndRefreshDatasetMetadata() public méthode

Finishes the asynchronous execution of the RefreshDatasetMetadata operation.
public EndRefreshDatasetMetadata ( IAsyncResult asyncResult ) : List
asyncResult IAsyncResult The IAsyncResult returned by the call to BeginRefreshDatasetMetadata.
Résultat List

IdentityChanged() protected méthode

This is triggered when an Identity Change event occurs. The dataset are then remapped to the new identity id. This may happend for example when a user is working with unauthenticated id and later decides to authenticate himself with a public login provider
protected IdentityChanged ( object sender, EventArgs e ) : void
sender object The object which triggered this methos
e System.EventArgs Event Arguments
Résultat void

ListDatasets() public méthode

Retrieves a list of datasets from local storage. It may not reflect the latest dataset on the remote storage until the RefreshDatasetMetadata operation is performed.
public ListDatasets ( ) : List
Résultat List

OpenOrCreateDataset() public méthode

Opens or creates a dataset. If the dataset doesn't exist, an empty one with the given name will be created. Otherwise, the dataset is loaded from local storage. If a dataset is marked as deleted but hasn't been deleted on remote via the RefreshDatasetMetadata operation, it will throw System.InvalidOperationException. Dataset dataset = cognitoSyncManager.OpenOrCreateDataset("myDatasetName");
public OpenOrCreateDataset ( string datasetName ) : Dataset
datasetName string DatasetName, must be [a-zA-Z0=9_.:-]+
Résultat Dataset

RefreshDatasetMetadataAsync() public méthode

Refreshes dataset metadata. Dataset metadata is pulled from remote storage and stored in local storage. Their record data isn't pulled down until you sync each dataset.
Thrown when fail to fresh dataset metadata
public RefreshDatasetMetadataAsync ( CancellationToken cancellationToken = default(CancellationToken) ) : Task>
cancellationToken System.Threading.CancellationToken /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. ///
Résultat Task>

RefreshDatasetMetadataAsync() public méthode

Refreshes dataset metadata. Dataset metadata is pulled from remote storage and stored in local storage. Their record data isn't pulled down until you sync each dataset.
Thrown when fail to fresh dataset metadata
public RefreshDatasetMetadataAsync ( AmazonCognitoSyncCallback callback, AsyncOptions options = null ) : void
callback AmazonCognitoSyncCallback Callback once the refresh is complete
options AsyncOptions Options for asynchronous execution
Résultat void

WipeData() public méthode

Wipes all user data cached locally, including identity id, session credentials, dataset metadata, and all records. Any data that hasn't been synced will be lost. This method is usually used when customer logs out.
public WipeData ( ) : void
Résultat void

WipeData() public méthode

Wipes all user data cached locally, including dataset metadata, and all records, and optionally identity id and session credentials. Any data that hasn't been synced will be lost. This method is usually used when customer logs out. Wipe Credentials and IdentityId.
public WipeData ( bool wipeCredentialsAndID ) : void
wipeCredentialsAndID bool
Résultat void