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.

Inheritance Hierarchy

System.Object
  Microsoft.Synchronization.MetadataStorage.DeleteDetector

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
[<AbstractClassAttribute>]
type DeleteDetector =  class end
public abstract class DeleteDetector

The DeleteDetector type exposes the following members.

Constructors

  Name Description
Protected method DeleteDetector Initializes a new instance of the DeleteDetector class.

Top

Methods

  Name Description
Public method Equals (Inherited from Object.)
Protected method Finalize (Inherited from Object.)
Public method FindUnreportedItems When 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 method FindUnreportedItemsByIndexedField When 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 method FindUnreportedItemsByIndexedFields When 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 method GetHashCode (Inherited from Object.)
Public method GetType (Inherited from Object.)
Public method MarkAllItemsUnreported When overridden in a derived class, resets DeleteDetector by marking all items as unreported.
Protected method MemberwiseClone (Inherited from Object.)
Public method ReportLiveItemById When overridden in a derived class, reports that the specified item is active and should not be considered deleted.
Public method ReportLiveItemByIndexedField When 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 method ReportLiveItemByIndexedFields When 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 method ToString (Inherited from Object.)

Top

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.

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

Microsoft.Synchronization.MetadataStorage Namespace

Other Resources

Detecting Deleted Items