Share via


IReplicaMetadata::GetFilteredChangeBatch

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.

Syntax

HRESULT GetFilteredChangeBatch(
  DWORD dwBatchSize,
  ISyncKnowledge *pSyncKnowledge,
  ISyncFilterInfo * pFilterInfo,
  IChangeBatchCallback *pCallback,
  ISyncChangeBatch ** ppSyncChangeBatch);

Parameters

  • dwBatchSize
    [in] The size of the batch to be created.

  • pSyncKnowledge
    [in] The knowledge from the destination provider.

  • pFilterInfo
    [in] Information about the filter that controls which items are included in the change batch.

  • pCallback
    [in, unique] A callback interface that is called to determine whether an item should be added to the batch.

  • ppSyncChangeBatch
    [out] Returns the next batch of changes.

Return Value

  • S_OK

  • E_POINTER

  • E_INVALIDARG when dwBatchSize is 0.

Remarks

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

The IChangeBatchCallback::OnAddingItemToBatch method of pCallback will be called before each item is added to a batch. If the method returns TRUE in its pfShouldIncludeInBatch parameter, 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 ISqlSyncMetadataStore adds changes to the change batch in global ID order.

The implementation of this class that is available through ISqlSyncMetadataStore calls SetLastBatch on the returned change batch when there are no more changes to send.

Notes for 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, SetLastBatch must be called on the returned change batch, or Sync Framework will call IKnowledgeSyncProvider::GetChangeBatch again to retrieve another batch of changes.

See Also

Reference

IReplicaMetadata Interface