IAsynchronousNotifyingChangeApplier::ApplyChanges
Performs conflict detection, conflict handling, and change application for a batch of changes.
HRESULT ApplyChanges(
CONFLICT_RESOLUTION_POLICY resolutionPolicy,
ISyncChangeBatch *pSourceChanges,
IUnknown * pUnkDataRetriever,
IEnumSyncChanges * pDestinationVersions,
ISyncKnowledge *pDestinationKnowledge,
IForgottenKnowledge *pDestinationForgottenKnowledge,
IAsynchronousNotifyingChangeApplierTarget * pChangeApplierTarget,
ISyncSessionState * pSessionState,
ISyncCallback *pCallback);
Parameters
- resolutionPolicy
[in] The policy to use for resolving conflicts.
- pSourceChanges
[in] The batch of changes from the source provider.
- pUnkDataRetriever
[in] An object that can be used to retrieve item data from the source replica.
- pDestinationVersions
[in] A list of changes that contains the versions of items that are stored in the destination replica. These items correspond to the items in pSourceChanges.
- pDestinationKnowledge
[in] The knowledge of the destination replica.
- pDestinationForgottenKnowledge
[in] The forgotten knowledge of the destination replica.
- pChangeApplierTarget
[in] The object that will be called to save changes and conflicts.
- pSessionState
[in] State information about the current session.
- pCallback
[in] Callbacks that will receive notifications about change application events.
Return Value
S_OK
E_OUTOFMEMORY
E_POINTER
SYNC_E_OBJECT_NEEDS_STATE
SYNC_E_INTERNAL_ERROR
SYNC_E_CHANGE_COUNT_MISMATCH
SYNC_E_CHANGE_NEEDS_KNOWLEDGE
SYNC_E_ITEM_HAS_NO_CHANGE_UNITS
SYNC_E_CHANGE_NOT_IN_KNOWLEDGE
SYNC_E_CHANGE_UNIT_COUNT_MISMATCH
SYNC_E_NOT_EXPECTED_CHANGE
SYNC_E_ITEM_MUST_EXIST
SYNC_E_ID_FORMAT_MISMATCH
SYNC_E_BATCH_NEEDS_KNOWLEDGE
Remarks
Typically, this method is called by a provider from its IKnowledgeSyncProvider::ProcessChangeBatch method.
This method detects conflicts that occur between the changes that are sent in pSourceChanges and the corresponding items in the destination replica. It resolves any conflicts according to the policy specified by resolutionPolicy. If it is necessary, this method then calls methods on pChangeApplierTarget to save changes to the destination replica and to save unresolved conflicts.
If pDestinationKnowledge is NULL, Sync Framework calls IASynchronousNotifyingChangeApplierTarget::GetDestinationVersion on pChangeApplierTarget for each item in pSourceChanges.
See Also
Reference
IAsynchronousNotifyingChangeApplier Interface
CONFLICT_RESOLUTION_POLICY Enumeration