Microsoft.Synchronization.MetadataStorage Namespace

Metadata Storage Service provides support for storing and handling synchronization metadata.

Metadata Storage Service defines many of its classes as abstract so that storage service writers can implement a custom set of classes to store metadata in any kind of data store.

Metadata Storage Service also provides an implementation of the classes that use a lightweight database to store synchronization metadata in a single database file in a file system.

The main class for all metadata stores is MetadataStore. This abstract base class contains methods to initialize and get replica metadata in the metadata store, and to start and stop transactions on the database. Classes that override this base class will likely provide methods to create and open metadata stores, such as SqlMetadataStore. This class contains methods to create and open a metadata store.

Replica metadata is initialized in the metadata store by using InitializeReplicaMetadata. The FieldSchema parameter to this method enables a set of custom fields to be created. These fields can be used to store additional metadata for items in the metadata store. The IndexSchema parameter enables sets of fields to be defined as indexes. These can be used to efficiently locate items in the metadata store.

The ReplicaMetadata class encapsulates all the metadata for a particular replica. Replica metadata can be accessed by using members like GetKnowledge and ReplicaId:

ReplicaMetadata also contains DeleteDetector. A provider can use the object contained in this property to detect which items have been deleted from the item store and should be marked as deleted in the metadata store.

Item metadata can be found in the metadata store by using ReplicaMetadata methods to search by item ID or indexed fields, such as FindItemMetadataById or FindItemMetadataByIndexedFields. The ItemMetadata class encapsulates all the metadata for a particular item. This class contains standard synchronization metadata, such as ChangeVersion, CreationVersion, GlobalId, and IsDeleted. This class also contains several methods that can be used to access any custom fields that were defined when the replica metadata was initialized.

 ClassDescription
Public classChangeUnitMetadataRepresents the metadata that is associated with a change unit contained in an item in the synchronization scope.
Public classDeleteDetectorWhen implemented by a derived class, DeleteDetector determines which items were deleted from a replica. These items must be marked as deleted in the metadata store.
Public classExplicitTransactionRequiredExceptionThe exception that is thrown when a method is called that requires an explicit transaction to have been started on the metadata store.
Public classFieldSchemaContains schema information that defines a custom field of an item in the metadata store.
Public classIndexSchemaRepresents a single or multicolumn index that can be used to more efficiently find items that are in the metadata store.
Public classItemMetadataWhen overridden, represents the metadata that is associated with an item in the synchronization scope.
Public classItemMetadataNotFoundExceptionThe exception that is thrown when an item that has the specified ID or custom field value could not be found in the metadata store.
Public classKeyUniquenessExceptionThe exception that is thrown when an attempt is made to save an item that has an invalid or duplicate ID.
Public classMetadataFieldNotFoundExceptionThe exception that is thrown when the named custom field does not exist.
Public classMetadataStorageEngineExceptionThe exception that is thrown when an operation on the metadata storage engine fails.
Public classMetadataStoreWhen overridden, represents a metadata store and provides methods to obtain a replica metadata object. The replica metadata object is used to access the metadata for a specific replica. This is the abstract base class for all metadata stores that use the Metadata Storage Service API.
Public classMetadataStoreExceptionThe base class for all metadata storage exceptions.
Public classMetadataStoreInvalidOperationExceptionThe exception that is thrown when a method call is invalid for the current state of the object.
Public classReplicaMetadataWhen overridden, provides access to the replica metadata and item metadata in the metadata store. ReplicaMetadata also provides services for delete detection and helpers for implementing synchronization provider methods.
Public classReplicaMetadataAlreadyExistsExceptionThe exception that is thrown when an attempt is made to create new replica metadata in a metadata store when metadata for that replica already exists in the metadata store.
Public classReplicaMetadataInUseExceptionThe exception that is thrown when an attempt is made to create more than one active ReplicaMetadata instance for a particular replica ID.
Public classReplicaMetadataNotFoundExceptionThe exception that is thrown when no replica metadata exists in the metadata store for the specified replica ID.
Public classSqlMetadataStoreRepresents a metadata store that is implemented by using a lightweight database to store the metadata.
Public classVersionNotSupportedExceptionThe exception that is thrown when an attempt is made to get replica metadata from a metadata store, but the version of the metadata is not supported by the implementation of the metadata store.

 DelegateDescription
Public delegateReplicaMetadata.ItemFilterCallbackRepresents the method that will determine whether an item change should be included in a change batch.
Show: