Getting Started with Microsoft Sync Framework (MSF)--Customizing the synchronization provider (Syncprovider)

Source: Internet
Author: User

In the previous article, we briefly introduced how to use an existing Syncprovider object for file (folder) synchronization. Today's demo mainly demonstrates the inheritance of the implementation of their own syncprovider to carry out the relevant synchronization metadata storage, of course, this will give us additional benefits, such as to create, version and delete items according to their own information, and so on. The other is to have a general idea of how the synchronization application works.

Before I started the text, I read the article on the internet about the coverage of MSF, and of course it said some of the points I agree with. MSF is really not so studious, the official documents are really difficult to understand, but things always have to slowly, only through continuous accumulation of progress, the product will do more and better. Let's make progress together with MSF!

Well, start today's text.

First, explain the interfaces that you want to inherit and implement for the custom Synchronizer ("Mysyncprovider" in this demo):

KnowledgeSyncProvider: A synchronization provider that uses knowledge to perform synchronization

Ichangedataretriever: Represents the mechanism used by the destination provider to retrieve item data from the source provider.

Inotifyingchangeappliertarget: An object that represents an item change that can be saved to a replica

Note: When using the Notifyingchangeapplier object to help apply changes to the destination replica, the destination provider must implement this interface. The Inotifyingchangeappliertarget object is passed to the ApplyChanges method. Then, Notifyingchangeapplier

Object calls the Inotifyingchangeappliertarget method to save the changes and conflicts to the destination replica.

The KnowledgeSyncProvider method defines the following main methods:

BeginSession When overridden in a derived class, notifies the provider that it will join a synchronization session.

EndSession When overridden in a derived class, notifies the provider that the synchronization session it is registering to has completed.

GetChangeBatch When overridden in a derived class, gets the batch of changes that contain item metadata for some items that are not included in the specified knowledge from the destination provider.

GetFullEnumerationChangeBatch When overridden in a derived class, gets the change batch that is part of a full enumeration that contains item metadata for an item with an ID greater than the specified lower bound.

GetSyncBatchParameters When overridden in a derived class, gets the number of item changes to include in the change batch, and the current knowledge of the synchronization scope.

ProcessChangeBatch When overridden in a derived class, handles a change group by detecting conflicts and applying changes to the item store.

ProcessFullEnumerationChangeBatch When overridden in a derived class, processes a change group to be used for full enumeration by applying the change to the item store.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.