ISqlSyncMetadataStore Interface
Represents a metadata store that uses a lightweight database for storage.
interface ISqlSyncMetadataStore : ISyncMetadataStore
Members
ISqlSyncMetadataStore methods | Description |
---|---|
Creates a metadata store file and a metadata store object to represent it. |
|
Opens an existing metadata store file and returns a metadata store object that represents it. |
|
Releases the resources that are used by the ISqlSyncMetadataStore object. |
Remarks
Metadata Storage Service offers a complete implementation of the Metadata Storage Service API that uses a lightweight database to store all the metadata that is required for synchronization in one database file in a specified location in the file system. The entry point into this implementation is ISqlSyncMetadataStore. To obtain an object that implements this interface, pass CLSID_SyncMetadataStore and IID_ISqlSyncMetadataStore to the CoCreateInstance function.
To use the implementation of the Metadata Storage Service API
Create a new metadata store by using ISqlSyncMetadataStore::CreateStore, or open an existing metadata store by using ISqlSyncMetadataStore::OpenStore.
Create metadata for a specified replica by using ISyncMetadataStore::InitializeReplicaMetadata, or open existing replica metadata by using ISyncMetadataStore::GetReplicaMetadata. GetReplicaMetadata return an implementation of IReplicaMetadata that can access replica metadata that is stored in the metadata store.
Begin a database transaction by using ISyncMetadataStore::BeginTransaction. This helps guarantee that, for changes made to the metadata after this method is called, either all are saved to the database or none are saved.
Create new item metadata by using IReplicaMetadata::CreateNewItemMetadata or find metadata for individual items by using methods such as IReplicaMetadata::FindItemMetadataByGlobalId. These methods return an implementation of IItemMetadata that can access item metadata that is stored in the metadata store.
Make changes to the item metadata and save those changes by using IReplicaMetadata::SaveItemMetadata.
Commit the changes to the metadata store by calling ISyncMetadataStore::CommitTransaction, or discard the changes by calling ISyncMetadataStore::RollbackTransaction.
This implementation of the API also provides methods on the IReplicaMetadata object that help detect items deleted from the item store. For example, IReplicaMetadata::GetUnreportedItems returns a list of items that exist in the metadata store but do not exist in the item store. A provider can then mark the items in this list as tombstones in the metadata store.
Requirements
Header: Metastore.h