C# Class Amazon.CognitoSync.SyncManager.Internal.SQLiteLocalStorage

An implementation for Amazon.CognitoSync.SyncManager.ILocalStorage using SQLite
Inheritance: ILocalStorage
Afficher le fichier Open project: aws/aws-sdk-net Class Usage Examples

Méthodes publiques

Méthode Description
CacheIdentity ( string key, string identity ) : void

cache the identity

ChangeIdentityId ( string oldIdentityId, string newIdentityId ) : void

Reparents all datasets from old identity id to a new one.

ConditionallyPutRecords ( String identityId, String datasetName, List records, List localRecords ) : void

Puts a list of raw records into that dataset if the local version hasn't changed (to be used in synchronizations).

CreateDataset ( string identityId, string datasetName ) : void

Create a dataset

DeleteCachedIdentity ( string key ) : void

Delete the cached identity id

DeleteDataset ( string identityId, string datasetName ) : void

Deletes a dataset. All the records associated with dataset are cleared and dataset is marked as deleted for future sync.

Dispose ( ) : void

Releases the resources consumed by this object

GetDatasetMetadata ( string identityId ) : List

Gets a list of dataset's metadata information.

GetLastSyncCount ( string identityId, string datasetName ) : long

Retrieves the last sync count. This sync count is a counter that represents when the last sync happened. The counter should be updated on a successful sync.

GetModifiedRecords ( string identityId, string datasetName ) : List

Retrieves a list of locally modified records since last successful sync operation.

GetRecord ( string identityId, string datasetName, string key ) : Record

Gets a raw record from local store. If the dataset/key combo doesn't // exist, null will be returned.

GetRecords ( string identityId, string datasetName ) : List

Gets a list of all records.

GetValue ( string identityId, string datasetName, string key ) : string

Retrieves the string value of a key in dataset. The value can be null when the record doesn't exist or is marked as deleted.

GetValueMap ( string identityId, string datasetName ) : string>.Dictionary

Retrieves a key-value map from dataset, excluding marked as deleted values.

PurgeDataset ( string identityId, string datasetName ) : void

This is different from DeleteDataset(String,String). Not only does it clears all records in the dataset, it also remove it from metadata table. It won't be visible in GetDatasetMetadata(String,String).

PutAllValues ( string identityId, string datasetName, string>.IDictionary values ) : void

Puts a key-value map into a dataset. This is optimized for batch operation. It's the preferred way to put a list of records into dataset.

PutRecords ( string identityId, string datasetName, List records ) : void

Puts a list of raw records into dataset.

PutValue ( string identityId, string datasetName, string key, string value ) : void

Puts the value of a key in dataset. If a new value is assigned to the key, the record is marked as dirty. If the value is null, then the record is marked as deleted. The changed record will be synced with remote storage.

SQLiteLocalStorage ( ) : Mono.Data.Sqlite

An implementation for Amazon.CognitoSync.SyncManager.ILocalStorage using SQLite

SQLiteLocalStorage ( ) : System

Creates a new instance of SQLiteLocalStorage

UpdateDatasetMetadata ( string identityId, List datasetMetadata ) : void

Updates local dataset metadata

UpdateLastModifiedTimestamp ( string identityId, string datasetName ) : void

Updates the last modified timestamp

UpdateLastSyncCount ( string identityId, string datasetName, long lastSyncCount ) : void

Updates the last sync count after successful sync with the remote data store.

WipeData ( ) : void

Wipes all locally cached data including dataset metadata and records. All opened dataset handler should not perform further operations to avoid inconsistent state.

Méthodes protégées

Méthode Description
Dispose ( bool disposing ) : void

Implements the Dispose pattern

Private Methods

Méthode Description
BindData ( SQLiteCommand command ) : void
BindData ( SQLitePCL.sqlite3_stmt statement ) : void
BindData ( SqliteCommand command ) : void
CreateDatasetHelper ( string query ) : void
DatasetMetadataFromReader ( SqliteDataReader reader ) : DatasetMetadata
DeleteDataset ( string identityId, string datasetName, List additionalStatements ) : void
Execute ( string query ) : void
ExecuteMultipleHelper ( List statements ) : void
ExecuteQuery ( string query ) : SQLitePCL.sqlite3_stmt
GetColumnValue ( SQLitePCL.sqlite3_stmt stmt, Type t, string columnName ) : object
GetCommonDatasetNames ( string oldIdentityId, string newIdentityId ) : HashSet
GetDatasetMetadata ( string identityId, string datasetName ) : DatasetMetadata
GetDatasetMetadataHelper ( string query ) : List
GetIdentity ( string key ) : string
GetLastSyncCountHelper ( string query ) : long
GetMetadataHelper ( string identityId, string datasetName ) : DatasetMetadata
GetModifiedRecordsHelper ( string query ) : List
GetRecordHelper ( string query ) : Record
GetRecordsHelper ( string query ) : List
PutValueHelper ( string identityId, string datasetName, string key, string value ) : bool
RecordFromReader ( SqliteDataReader reader ) : Record
SetupDatabase ( ) : void
SqliteStmtToDatasetMetadata ( SQLiteDataReader reader ) : DatasetMetadata
SqliteStmtToDatasetMetadata ( SQLitePCL.sqlite3_stmt stmt ) : DatasetMetadata
SqliteStmtToRecord ( SQLiteDataReader reader ) : Record
SqliteStmtToRecord ( SQLitePCL.sqlite3_stmt stmt ) : Record
ToUtf8 ( string sText ) : byte[]
UpdateDatasetMetadataInternal ( string identityId, DatasetMetadata metadata ) : bool
UpdateLastModifiedTimestampHelper ( string query ) : void
UpdateLastSyncCountHelper ( string query ) : void
UpdateOrInsertRecord ( string identityId, string datasetName, Record record ) : void

Method Details

CacheIdentity() public méthode

cache the identity
public CacheIdentity ( string key, string identity ) : void
key string
identity string
Résultat void

ChangeIdentityId() public méthode

Reparents all datasets from old identity id to a new one.
public ChangeIdentityId ( string oldIdentityId, string newIdentityId ) : void
oldIdentityId string Old identity identifier.
newIdentityId string New identity identifier.
Résultat void

ConditionallyPutRecords() public méthode

Puts a list of raw records into that dataset if the local version hasn't changed (to be used in synchronizations).
public ConditionallyPutRecords ( String identityId, String datasetName, List records, List localRecords ) : void
identityId String Identity id.
datasetName String Dataset name.
records List A list of remote records to compare with
localRecords List A list of records to check for changes.
Résultat void

CreateDataset() public méthode

Create a dataset
public CreateDataset ( string identityId, string datasetName ) : void
identityId string Identity Id
datasetName string Dataset name.
Résultat void

DeleteCachedIdentity() public méthode

Delete the cached identity id
public DeleteCachedIdentity ( string key ) : void
key string
Résultat void

DeleteDataset() public méthode

Deletes a dataset. All the records associated with dataset are cleared and dataset is marked as deleted for future sync.
public DeleteDataset ( string identityId, string datasetName ) : void
identityId string Identity identifier.
datasetName string Dataset name.
Résultat void

Dispose() public méthode

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

Dispose() protected méthode

Implements the Dispose pattern
protected Dispose ( bool disposing ) : void
disposing bool Whether this object is being disposed via a call to Dispose /// or garbage collected.
Résultat void

GetDatasetMetadata() public méthode

Gets a list of dataset's metadata information.
public GetDatasetMetadata ( string identityId ) : List
identityId string Identity identifier.
Résultat List

GetLastSyncCount() public méthode

Retrieves the last sync count. This sync count is a counter that represents when the last sync happened. The counter should be updated on a successful sync.
public GetLastSyncCount ( string identityId, string datasetName ) : long
identityId string Identity identifier.
datasetName string Dataset name.
Résultat long

GetModifiedRecords() public méthode

Retrieves a list of locally modified records since last successful sync operation.
public GetModifiedRecords ( string identityId, string datasetName ) : List
identityId string Identity identifier.
datasetName string Dataset name.
Résultat List

GetRecord() public méthode

Gets a raw record from local store. If the dataset/key combo doesn't // exist, null will be returned.
public GetRecord ( string identityId, string datasetName, string key ) : Record
identityId string Identity identifier.
datasetName string Dataset name.
key string Key for the record.
Résultat Amazon.CognitoSync.SyncManager.Record

GetRecords() public méthode

Gets a list of all records.
public GetRecords ( string identityId, string datasetName ) : List
identityId string Identity identifier.
datasetName string Dataset name.
Résultat List

GetValue() public méthode

Retrieves the string value of a key in dataset. The value can be null when the record doesn't exist or is marked as deleted.
public GetValue ( string identityId, string datasetName, string key ) : string
identityId string Identity identifier.
datasetName string Dataset name.
key string record key.
Résultat string

GetValueMap() public méthode

Retrieves a key-value map from dataset, excluding marked as deleted values.
public GetValueMap ( string identityId, string datasetName ) : string>.Dictionary
identityId string Identity identifier.
datasetName string Dataset name.
Résultat string>.Dictionary

PurgeDataset() public méthode

This is different from DeleteDataset(String,String). Not only does it clears all records in the dataset, it also remove it from metadata table. It won't be visible in GetDatasetMetadata(String,String).
public PurgeDataset ( string identityId, string datasetName ) : void
identityId string Identity identifier.
datasetName string Dataset name.
Résultat void

PutAllValues() public méthode

Puts a key-value map into a dataset. This is optimized for batch operation. It's the preferred way to put a list of records into dataset.
public PutAllValues ( string identityId, string datasetName, string>.IDictionary values ) : void
identityId string Identity identifier.
datasetName string Dataset name.
values string>.IDictionary a key-value map.
Résultat void

PutRecords() public méthode

Puts a list of raw records into dataset.
public PutRecords ( string identityId, string datasetName, List records ) : void
identityId string Identity identifier.
datasetName string Dataset name.
records List A list of Records.
Résultat void

PutValue() public méthode

Puts the value of a key in dataset. If a new value is assigned to the key, the record is marked as dirty. If the value is null, then the record is marked as deleted. The changed record will be synced with remote storage.
public PutValue ( string identityId, string datasetName, string key, string value ) : void
identityId string Identity identifier.
datasetName string Dataset name.
key string record key.
value string string value. If null, the record is marked as deleted.
Résultat void

SQLiteLocalStorage() public méthode

An implementation for Amazon.CognitoSync.SyncManager.ILocalStorage using SQLite
public SQLiteLocalStorage ( ) : Mono.Data.Sqlite
Résultat Mono.Data.Sqlite

SQLiteLocalStorage() public méthode

Creates a new instance of SQLiteLocalStorage
public SQLiteLocalStorage ( ) : System
Résultat System

UpdateDatasetMetadata() public méthode

Updates local dataset metadata
public UpdateDatasetMetadata ( string identityId, List datasetMetadata ) : void
identityId string Identity identifier.
datasetMetadata List Dataset metadata.
Résultat void

UpdateLastModifiedTimestamp() public méthode

Updates the last modified timestamp
public UpdateLastModifiedTimestamp ( string identityId, string datasetName ) : void
identityId string Identity Identifier.
datasetName string Dataset name.
Résultat void

UpdateLastSyncCount() public méthode

Updates the last sync count after successful sync with the remote data store.
public UpdateLastSyncCount ( string identityId, string datasetName, long lastSyncCount ) : void
identityId string Identity identifier.
datasetName string Dataset name.
lastSyncCount long Last sync count.
Résultat void

WipeData() public méthode

Wipes all locally cached data including dataset metadata and records. All opened dataset handler should not perform further operations to avoid inconsistent state.
public WipeData ( ) : void
Résultat void