C# Класс Amazon.CognitoSync.SyncManager.Internal.SQLiteLocalStorage

An implementation for Amazon.CognitoSync.SyncManager.ILocalStorage using SQLite
Наследование: ILocalStorage
Показать файл Открыть проект Примеры использования класса

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

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

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

Метод Описание
Dispose ( bool disposing ) : void

Implements the Dispose pattern

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

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

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

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

cache the identity
public CacheIdentity ( string key, string identity ) : void
key string
identity string
Результат void

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

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

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

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

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

Create a dataset
public CreateDataset ( string identityId, string datasetName ) : void
identityId string Identity Id
datasetName string Dataset name.
Результат void

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

Delete the cached identity id
public DeleteCachedIdentity ( string key ) : void
key string
Результат void

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

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

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

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

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

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

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

Gets a list of dataset's metadata information.
public GetDatasetMetadata ( string identityId ) : List
identityId string Identity identifier.
Результат List

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

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

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

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

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

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.
Результат Amazon.CognitoSync.SyncManager.Record

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

Gets a list of all records.
public GetRecords ( string identityId, string datasetName ) : List
identityId string Identity identifier.
datasetName string Dataset name.
Результат List

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

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

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

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

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

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

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

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

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

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

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

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

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

An implementation for Amazon.CognitoSync.SyncManager.ILocalStorage using SQLite
public SQLiteLocalStorage ( ) : Mono.Data.Sqlite
Результат Mono.Data.Sqlite

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

Creates a new instance of SQLiteLocalStorage
public SQLiteLocalStorage ( ) : System
Результат System

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

Updates local dataset metadata
public UpdateDatasetMetadata ( string identityId, List datasetMetadata ) : void
identityId string Identity identifier.
datasetMetadata List Dataset metadata.
Результат void

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

Updates the last modified timestamp
public UpdateLastModifiedTimestamp ( string identityId, string datasetName ) : void
identityId string Identity Identifier.
datasetName string Dataset name.
Результат void

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

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

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

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