DeleteDetector Class

When 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.

System.Object
  Microsoft.Synchronization.MetadataStorage.DeleteDetector

Namespace:  Microsoft.Synchronization.MetadataStorage
Assembly:  Microsoft.Synchronization.MetadataStorage (in Microsoft.Synchronization.MetadataStorage.dll)

public abstract class DeleteDetector

The DeleteDetector type exposes the following members.

  NameDescription
Protected methodDeleteDetectorInitializes a new instance of the DeleteDetector class.
Top

  NameDescription
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodFindUnreportedItemsWhen overridden in a derived class, returns a list of items that are not currently marked as active in the metadata store and that are not already marked as deleted.
Public methodFindUnreportedItemsByIndexedFieldWhen overridden in a derived class, returns a list of items that have the specified indexed field value and are not currently marked as active in the metadata store and that are not already marked as deleted.
Public methodFindUnreportedItemsByIndexedFieldsWhen overridden in a derived class, returns a list of items that have the specified set of indexed field values and are not currently marked as active in the metadata store and that are not already marked as deleted.
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Public methodMarkAllItemsUnreportedWhen overridden in a derived class, resets DeleteDetector by marking all items as unreported.
Protected methodMemberwiseClone (Inherited from Object.)
Public methodReportLiveItemByIdWhen overridden in a derived class, reports that the specified item is active and should not be considered deleted.
Public methodReportLiveItemByIndexedFieldWhen overridden in a derived class, reports that the item that is identified by the indexed field value is active and should not be considered deleted.
Public methodReportLiveItemByIndexedFieldsWhen overridden in a derived class, reports that the item identified by the specified set of indexed field values is active and should not be considered deleted.
Public methodToString (Inherited from Object.)
Top

This class helps a provider perform metadata maintenance when its store does not track deletes.

To retrieve a list of all items that are detected as deleted from the store, call FindUnreportedItems. This list can then be enumerated, and each item marked as a deleted in the metadata store. This should be done before a synchronization session is started to ensure that the metadata is up-to-date.

An active metadata entry exists for an item when the item was changed and then ReplicaMetadata.SaveItemMetadata was called to save the changed item, or when ReportLiveItemByIndexedField or ReportLiveItemByIndexedFields was called for an unchanged but still active item. Be aware that calling ReplicaMetadata.SaveItemMetadata for an unchanged item does not mark that item as active.

A call to MarkAllItemsUnreported resets the delete detector for future detection passes.

To use the metadata storage service implementation of this class, use SqlMetadataStore to create or open a ReplicaMetadata class. DeleteDetector can be accessed through ReplicaMetadata.DeleteDetector.

Notes to Inheritors

When you inherit from DeleteDetector, you must override the following members:

To detect deleted items, an implementation of DeleteDetector must use the following high-level algorithm:

  1. Record all items that are reported as active. An item is reported as active when its metadata is changed and saved, or when the provider explicitly reports it as active.

  2. Any metadata entry that is not active must be reported as deleted.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show: