ReplicaMetadata.GetFilteredChangeBatch Method

When overridden in a derived class, gets a change batch that contains item metadata for items that are not contained in the specified knowledge from the destination provider and that are accepted by the specified filter.

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

Syntax

'Declaration
Public MustOverride Function GetFilteredChangeBatch ( _
    batchSize As UInteger, _
    destinationKnowledge As SyncKnowledge, _
    filterInfo As FilterInfo, _
    filterCallback As ItemFilterCallback _
) As ChangeBatch
'Usage
Dim instance As ReplicaMetadata
Dim batchSize As UInteger
Dim destinationKnowledge As SyncKnowledge
Dim filterInfo As FilterInfo
Dim filterCallback As ItemFilterCallback
Dim returnValue As ChangeBatch

returnValue = instance.GetFilteredChangeBatch(batchSize, destinationKnowledge, filterInfo, filterCallback)
public abstract ChangeBatch GetFilteredChangeBatch (
    uint batchSize,
    SyncKnowledge destinationKnowledge,
    FilterInfo filterInfo,
    ItemFilterCallback filterCallback
)
public:
virtual ChangeBatch^ GetFilteredChangeBatch (
    unsigned int batchSize, 
    SyncKnowledge^ destinationKnowledge, 
    FilterInfo^ filterInfo, 
    ItemFilterCallback^ filterCallback
) abstract
public abstract ChangeBatch GetFilteredChangeBatch (
    UInt32 batchSize, 
    SyncKnowledge destinationKnowledge, 
    FilterInfo filterInfo, 
    ItemFilterCallback filterCallback
)
public abstract function GetFilteredChangeBatch (
    batchSize : uint, 
    destinationKnowledge : SyncKnowledge, 
    filterInfo : FilterInfo, 
    filterCallback : ItemFilterCallback
) : ChangeBatch

Parameters

  • batchSize
    The size of the batch to be created.
  • destinationKnowledge
    The knowledge from the destination provider.
  • filterInfo
    Information about the filter that controls which items are included in the change batch.
  • filterCallback
    The delegate that is called to determine whether the item should be added to the batch.

Return Value

A change batch that contains item metadata for items that are not contained in the specified knowledge from the destination provider and that are accepted by the specified static or dynamic filter.

Exceptions

Exception type Condition

ObjectDisposedException

The object has been disposed or was not initialized correctly.

ArgumentOutOfRangeException

batchSize is 0.

ArgumentNullException

destinationKnowledge is a null reference (Nothing in Visual Basic), or filterInfo is a null reference (Nothing in Visual Basic).

Remarks

This method helps a synchronization provider implement its GetChangeBatch method when a filtered synchronization has been specified.

The filterCallback delegate will be called before each item is added to a batch. If the delegate returns true, the item is added to the batch; otherwise, it is not added.

Before providers call this method, they must ensure that the versions in the metadata store reflect all local changes, including deletes. This is achieved through an explicit metadata maintenance pass to enumerate items and update their metadata.

The implementation of this class that is available through SqlMetadataStore adds changes to the change batch in global ID order.

The implementation of this class that is available through SqlMetadataStore sets IsLastBatch to true on the returned change batch when there are no more changes to send.

Notes to Implementers: To aid a provider that uses global ID ordering and has the ability to use ranges, changes should be enumerated and added to the change batch in global ID order. The first change in the returned change batch starts a new range. If there are no more changes to send after this batch, IsLastBatch must be set to true on the returned change batch, or Sync Framework will call GetChangeBatch again to retrieve another batch of changes.

See Also

Reference

ReplicaMetadata Class
ReplicaMetadata Members
Microsoft.Synchronization.MetadataStorage Namespace