C# Класс Amazon.CognitoSync.SyncManager.CognitoSyncManager

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Защищенные методы

Метод Описание
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

Приватные методы

Метод Описание
ValidateParameters ( ) : void

Описание методов

BeginRefreshDatasetMetadata() публичный Метод

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.
Результат IAsyncResult

CognitoSyncManager() публичный Метод

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
Результат System

CognitoSyncManager() публичный Метод

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
Результат System

CognitoSyncManager() публичный Метод

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
Результат System

Dispose() публичный Метод

Releases the resources consumed by this object
public Dispose ( ) : void
Результат void

Dispose() защищенный Метод

Releases the resources consumed by this object if disposing is true.
protected Dispose ( bool disposing ) : void
disposing bool
Результат void

EndRefreshDatasetMetadata() публичный Метод

Finishes the asynchronous execution of the RefreshDatasetMetadata operation.
public EndRefreshDatasetMetadata ( IAsyncResult asyncResult ) : List
asyncResult IAsyncResult The IAsyncResult returned by the call to BeginRefreshDatasetMetadata.
Результат List

IdentityChanged() защищенный Метод

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
Результат void

ListDatasets() публичный Метод

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
Результат List

OpenOrCreateDataset() публичный Метод

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_.:-]+
Результат Dataset

RefreshDatasetMetadataAsync() публичный Метод

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. ///
Результат Task>

RefreshDatasetMetadataAsync() публичный Метод

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
Результат void

WipeData() публичный Метод

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
Результат void

WipeData() публичный Метод

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
Результат void