Share via


NotifyingChangeApplier.ApplyChanges Method (ConflictResolutionPolicy, CollisionConflictResolutionPolicy, ChangeBatch, IChangeDataRetriever, IEnumerable<ItemChange>, SyncKnowledge, ForgottenKnowledge, INotifyingChangeApplierTarget, IConflictLogAccess, SyncSessionContext, SyncCallbacks)

Performs conflict detection, concurrency conflict handling, constraint conflict handling, change application, and conflict log management for a batch of changes.

Namespace:  Microsoft.Synchronization
Assembly:  Microsoft.Synchronization (in Microsoft.Synchronization.dll)

Syntax

'Declaration
Public Sub ApplyChanges ( _
    resolutionPolicy As ConflictResolutionPolicy, _
    collisionConflictResolutionPolicy As CollisionConflictResolutionPolicy, _
    sourceChanges As ChangeBatch, _
    changeDataRetriever As IChangeDataRetriever, _
    destinationVersions As IEnumerable(Of ItemChange), _
    destinationKnowledge As SyncKnowledge, _
    destinationForgottenKnowledge As ForgottenKnowledge, _
    changeApplierTarget As INotifyingChangeApplierTarget, _
    conflictLogAccess As IConflictLogAccess, _
    syncSessionState As SyncSessionContext, _
    syncCallback As SyncCallbacks _
)
'Usage
Dim instance As NotifyingChangeApplier
Dim resolutionPolicy As ConflictResolutionPolicy
Dim collisionConflictResolutionPolicy As CollisionConflictResolutionPolicy
Dim sourceChanges As ChangeBatch
Dim changeDataRetriever As IChangeDataRetriever
Dim destinationVersions As IEnumerable(Of ItemChange)
Dim destinationKnowledge As SyncKnowledge
Dim destinationForgottenKnowledge As ForgottenKnowledge
Dim changeApplierTarget As INotifyingChangeApplierTarget
Dim conflictLogAccess As IConflictLogAccess
Dim syncSessionState As SyncSessionContext
Dim syncCallback As SyncCallbacks

instance.ApplyChanges(resolutionPolicy, _
    collisionConflictResolutionPolicy, _
    sourceChanges, changeDataRetriever, _
    destinationVersions, destinationKnowledge, _
    destinationForgottenKnowledge, _
    changeApplierTarget, conflictLogAccess, _
    syncSessionState, syncCallback)
public void ApplyChanges(
    ConflictResolutionPolicy resolutionPolicy,
    CollisionConflictResolutionPolicy collisionConflictResolutionPolicy,
    ChangeBatch sourceChanges,
    IChangeDataRetriever changeDataRetriever,
    IEnumerable<ItemChange> destinationVersions,
    SyncKnowledge destinationKnowledge,
    ForgottenKnowledge destinationForgottenKnowledge,
    INotifyingChangeApplierTarget changeApplierTarget,
    IConflictLogAccess conflictLogAccess,
    SyncSessionContext syncSessionState,
    SyncCallbacks syncCallback
)
public:
void ApplyChanges(
    ConflictResolutionPolicy resolutionPolicy, 
    CollisionConflictResolutionPolicy collisionConflictResolutionPolicy, 
    ChangeBatch^ sourceChanges, 
    IChangeDataRetriever^ changeDataRetriever, 
    IEnumerable<ItemChange^>^ destinationVersions, 
    SyncKnowledge^ destinationKnowledge, 
    ForgottenKnowledge^ destinationForgottenKnowledge, 
    INotifyingChangeApplierTarget^ changeApplierTarget, 
    IConflictLogAccess^ conflictLogAccess, 
    SyncSessionContext^ syncSessionState, 
    SyncCallbacks^ syncCallback
)
member ApplyChanges : 
        resolutionPolicy:ConflictResolutionPolicy * 
        collisionConflictResolutionPolicy:CollisionConflictResolutionPolicy * 
        sourceChanges:ChangeBatch * 
        changeDataRetriever:IChangeDataRetriever * 
        destinationVersions:IEnumerable<ItemChange> * 
        destinationKnowledge:SyncKnowledge * 
        destinationForgottenKnowledge:ForgottenKnowledge * 
        changeApplierTarget:INotifyingChangeApplierTarget * 
        conflictLogAccess:IConflictLogAccess * 
        syncSessionState:SyncSessionContext * 
        syncCallback:SyncCallbacks -> unit 
public function ApplyChanges(
    resolutionPolicy : ConflictResolutionPolicy, 
    collisionConflictResolutionPolicy : CollisionConflictResolutionPolicy, 
    sourceChanges : ChangeBatch, 
    changeDataRetriever : IChangeDataRetriever, 
    destinationVersions : IEnumerable<ItemChange>, 
    destinationKnowledge : SyncKnowledge, 
    destinationForgottenKnowledge : ForgottenKnowledge, 
    changeApplierTarget : INotifyingChangeApplierTarget, 
    conflictLogAccess : IConflictLogAccess, 
    syncSessionState : SyncSessionContext, 
    syncCallback : SyncCallbacks
)

Parameters

Exceptions

Exception Condition
ArgumentNullException

sourceChanges, changeDataRetriever, destinationKnowledge, changeApplierTarget, or syncCallback is a null reference (Nothing in Visual Basic).

ArgumentOutOfRangeException

—or—

collisionResolutionPolicy is not a member of the CollisionConflictResolutionPolicy enumeration.

SyncIdFormatMismatchException
  • sourceChanges has some forgotten knowledge which is in a different format than that of destinationKnowledge

—or—

  • destinationForgottenKnowledge was given and has a different format than that of destinationKnowledge

Remarks

This method detects concurrency conflicts that occur between the changes that are sent in sourceChanges and the corresponding items in the destination replica. It resolves any concurrency conflicts according to the policy specified by resolutionPolicy. When collision constraint conflicts are reported by the destination provider, this method resolves them according to the policy specified by collisionConflictResolutionPolicy. If no conflict resolution policy is set, this method notifies the application of a conflict, and the application specifies a conflict resolution action. If it is necessary, this method then calls methods on changeApplierTarget to save changes to the destination replica and to save unresolved conflicts.

The change applier helps manage the conflict log specified by conflictLogAccess, by resolving conflicts in the log and removing obsolete conflicts from the log. The change applier may also use the conflict log to store temporary conflicts that occur as a result of merging constraint conflicts. Any temporary conflicts added to the log will be removed before the synchronization session ends.

See Also

Reference

NotifyingChangeApplier Class

ApplyChanges Overload

Microsoft.Synchronization Namespace