Share via


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.

Namespace: Microsoft.Synchronization.MetadataStorage
Assembly: Microsoft.Synchronization.MetadataStorage (in microsoft.synchronization.metadatastorage.dll)

Syntax

'Declaration
Public MustInherit Class DeleteDetector
'Usage
Dim instance As DeleteDetector
public abstract class DeleteDetector
public ref class DeleteDetector abstract
public abstract class DeleteDetector
public abstract class DeleteDetector

Remarks

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.

Inheritance Hierarchy

System.Object
  Microsoft.Synchronization.MetadataStorage.DeleteDetector

Thread Safety

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

See Also

Reference

DeleteDetector Members
Microsoft.Synchronization.MetadataStorage Namespace

Concepts

Detecting Deleted Items