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 | |
---|---|---|
DeleteDetector | Initializes a new instance of the DeleteDetector class. |
Top
Methods
Name | Description | |
---|---|---|
Equals | (Inherited from Object.) | |
Finalize | (Inherited from Object.) | |
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. | |
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. | |
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. | |
GetHashCode | (Inherited from Object.) | |
GetType | (Inherited from Object.) | |
MarkAllItemsUnreported | When overridden in a derived class, resets DeleteDetector by marking all items as unreported. | |
MemberwiseClone | (Inherited from Object.) | |
ReportLiveItemById | When overridden in a derived class, reports that the specified item is active and should not be considered deleted. | |
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. | |
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. | |
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:
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.
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