//If full enumeration is needed because  this provider is out of date due to tombstone cleanup, then this method will be called by the engine.
        public byte[] ProcessRemoteFullEnumerationChangeBatch(
            ConflictResolutionPolicy resolutionPolicy,
            FullEnumerationChangeBatch sourceChanges,
            CachedChangeDataRetriever changeDataRetriever,
            byte[] changeApplierInfo)
        {
            _metadataStore.BeginTransaction();

            //Get all my local change versions from the metadata store
            IEnumerable <ItemChange> localChanges = _metadata.GetFullEnumerationLocalVersions(sourceChanges);

            NotifyingChangeApplier changeApplier = new NotifyingChangeApplier(_idFormats);

            // The following step is required because we are remote change application
            changeApplier.LoadChangeApplierInfo(changeApplierInfo);

            changeApplier.ApplyFullEnumerationChanges(
                resolutionPolicy,
                sourceChanges,
                changeDataRetriever as IChangeDataRetriever,
                localChanges,
                _metadata.GetKnowledge(),
                _metadata.GetForgottenKnowledge(),
                this,
                null,                   // Note that we do not pass a sync session context
                new SyncCallbacks());

            _metadataStore.CommitTransaction();

            // Return the ChangeApplierInfo
            return(changeApplier.GetChangeApplierInfo());
        }
Пример #2
0
        //If full enumeration is needed because  this provider is out of date due to tombstone cleanup, then this method will be called by the engine.
        public virtual byte[] ProcessRemoteFullEnumerationChangeBatch(
            ConflictResolutionPolicy resolutionPolicy,
            FullEnumerationChangeBatch sourceChanges,
            object changeDataRetriever,
            byte[] changeApplierInfo)
        {
            BeginTransaction();

            //Get all my local change versions from the metadata store
            IEnumerable <ItemChange> localChanges = _metaData.GetFullEnumerationLocalVersions(sourceChanges);

            //Create a changeapplier object to make change application easier (make the engine call me
            //when it needs data and when I should save data)
            NotifyingChangeApplier changeApplier = new NotifyingChangeApplier(this.IdFormats);

            // The following step is required because we are remote change application
            changeApplier.LoadChangeApplierInfo(changeApplierInfo);

            changeApplier.ApplyFullEnumerationChanges(
                resolutionPolicy,
                sourceChanges,
                changeDataRetriever as IChangeDataRetriever,
                localChanges,
                _metaData.GetKnowledge(),
                _metaData.GetForgottenKnowledge(),
                this,
                null,                                    // Note that we do not pass a sync session context
                new SyncCallbacks());

            CommitTransaction();
            // Return the ChangeApplierInfo
            return(changeApplier.GetChangeApplierInfo());
        }
        public override void ProcessChangeBatch(ConflictResolutionPolicy resolutionPolicy, ChangeBatch sourceChanges,
                                                object changeDataRetriever, SyncCallbacks syncCallback, SyncSessionStatistics sessionStatistics)
        {
            _metadataStore.BeginTransaction();
            IEnumerable <ItemChange> localChanges  = _metadataStore.Metadata.GetLocalVersions(sourceChanges);
            NotifyingChangeApplier   changeApplier = new NotifyingChangeApplier(_idFormats);

            changeApplier.ApplyChanges(resolutionPolicy, sourceChanges, changeDataRetriever as IChangeDataRetriever, localChanges, _metadataStore.Metadata.GetKnowledge(),
                                       _metadataStore.Metadata.GetForgottenKnowledge(), _changeApplier, _currentSessionContext, syncCallback);

            _metadataStore.CommitTransaction();
        }
Пример #4
0
        public override void ProcessChangeBatch(ConflictResolutionPolicy resolutionPolicy, ChangeBatch sourceChanges, object changeDataRetriever, SyncCallbacks syncCallbacks, SyncSessionStatistics sessionStatistics)
        {
            IEnumerable <ItemChange> localVersions = _sync.GetChanges(sourceChanges);

            // Now we call the change applier
            // The change applier will compare the local and remote versions, apply
            // non-conflicting changes, and will also detect conflicts and react as specified
            ForgottenKnowledge     destinationForgottenKnowledge = new ForgottenKnowledge(_sync.IdFormats, _sync.SyncKnowledge);
            NotifyingChangeApplier changeApplier = new NotifyingChangeApplier(_sync.IdFormats);

            changeApplier.ApplyChanges(resolutionPolicy, sourceChanges, changeDataRetriever as IChangeDataRetriever, localVersions,
                                       _sync.SyncKnowledge.Clone(), destinationForgottenKnowledge, this, SyncSessionContext, syncCallbacks);
        }
Пример #5
0
        //If full enumeration is needed because  this provider is out of date due to tombstone cleanup, then this method will be called by the engine.
        public override void ProcessFullEnumerationChangeBatch(ConflictResolutionPolicy resolutionPolicy, FullEnumerationChangeBatch sourceChanges, object changeDataRetriever, SyncCallbacks syncCallback, SyncSessionStatistics sessionStatistics)
        {
            _metadataStore.BeginTransaction();

            //Get all my local change versions from the metadata store
            IEnumerable <ItemChange> localChanges = _metadata.GetFullEnumerationLocalVersions(sourceChanges);

            //Create a changeapplier object to make change application easier (make the engine call me
            //when it needs data and when I should save data)
            NotifyingChangeApplier changeApplier = new NotifyingChangeApplier(_idFormats);

            changeApplier.ApplyFullEnumerationChanges(resolutionPolicy, sourceChanges, changeDataRetriever as IChangeDataRetriever, localChanges, _metadata.GetKnowledge(),
                                                      _metadata.GetForgottenKnowledge(), this, _currentSessionContext, syncCallback);

            _metadataStore.CommitTransaction();
        }
Пример #6
0
        public override void ProcessChangeBatch(ConflictResolutionPolicy resolutionPolicy, ChangeBatch sourceChanges, object changeDataRetriever, SyncCallbacks syncCallbacks, SyncSessionStatistics sessionStatistics)
        {
            ItemsChangeInfo localVersions = null;

            try {
                localVersions = Proxy.GetChanges(Path, sourceChanges, _filters);
            }
            catch (Exception ex) {
                throw ex;
            }

            // Now we call the change applier
            // The change applier will compare the local and remote versions, apply
            // non-conflicting changes, and will also detect conflicts and react as specified
            ForgottenKnowledge = new ForgottenKnowledge(IdFormats, SyncKnowledge);
            NotifyingChangeApplier changeApplier = new NotifyingChangeApplier(IdFormats);

            changeApplier.ApplyChanges(resolutionPolicy, sourceChanges, changeDataRetriever as IChangeDataRetriever, RemoteSyncDetails.GenerateChanges(localVersions),
                                       SyncKnowledge.Clone(), ForgottenKnowledge, this, SyncSessionContext, syncCallbacks);
        }
        public override void ProcessFullEnumerationChangeBatch(ConflictResolutionPolicy resolutionPolicy, FullEnumerationChangeBatch sourceChanges, object changeDataRetriever, SyncCallbacks syncCallback, SyncSessionStatistics sessionStatistics)
        {
            _metadataStore.BeginTransaction();

            IEnumerable<ItemChange> localChanges = _metadataStore.Metadata.GetFullEnumerationLocalVersions(sourceChanges);
            NotifyingChangeApplier changeApplier = new NotifyingChangeApplier(_idFormats);
            changeApplier.ApplyFullEnumerationChanges(resolutionPolicy, sourceChanges, changeDataRetriever as IChangeDataRetriever, localChanges, _metadataStore.Metadata.GetKnowledge(),
                _metadataStore.Metadata.GetForgottenKnowledge(), _changeApplier, _currentSessionContext, syncCallback);

            _metadataStore.CommitTransaction();
        }
Пример #8
0
        /// <summary>
        /// Upload mechanism
        /// </summary>
        /// <param name="resolutionPolicy"></param>
        /// <param name="sourceChanges">Local File Changes</param>
        /// <param name="changeDataRetriever"></param>
        /// <param name="syncCallback"></param>
        /// <param name="sessionStatistics"></param>
        public override void ProcessChangeBatch(ConflictResolutionPolicy resolutionPolicy, ChangeBatch sourceChanges, object changeDataRetriever, SyncCallbacks syncCallback, SyncSessionStatistics sessionStatistics)
        {
            myForgottenKnowledge = new ForgottenKnowledge(IdFormats, myKnowledge);

            NotifyingChangeApplier changeApplier = new NotifyingChangeApplier(IdFormats);

            changeApplier.ApplyChanges(resolutionPolicy, sourceChanges, (IChangeDataRetriever)changeDataRetriever, myKnowledge.Clone(), myForgottenKnowledge,
                this, currentSessionContext, syncCallback);
        }
Пример #9
0
        /// <summary>
        /// Download Mechanism 
        /// </summary>
        /// <param name="resolutionPolicy"></param>
        /// <param name="sourceChanges"></param>
        /// <param name="changeDataRetriever"></param>
        /// <param name="syncCallback"></param>
        /// <param name="sessionStatistics"></param>
        public override void ProcessChangeBatch(ConflictResolutionPolicy resolutionPolicy, ChangeBatch sourceChanges, 
            object changeDataRetriever, SyncCallbacks syncCallback, SyncSessionStatistics sessionStatistics)
        {
            ChangeBatch localVersions = sync.GetChanges(sourceChanges);

            ForgottenKnowledge destinationForgottenKnowledge = new ForgottenKnowledge(sync.IdFormats, sync.SyncKnowledge);

            NotifyingChangeApplier changeApplier = new NotifyingChangeApplier(sync.IdFormats);

            changeApplier.ApplyChanges(resolutionPolicy, CollisionConflictResolutionPolicy.Merge, sourceChanges,
            (IChangeDataRetriever)changeDataRetriever, localVersions, sync.SyncKnowledge.Clone(),
            destinationForgottenKnowledge, this, _memConflictLog, currentSessionContext, syncCallback);
        }
Пример #10
0
        //If full enumeration is needed because  this provider is out of date due to tombstone cleanup, then this method will be called by the engine.
        public override void ProcessFullEnumerationChangeBatch(ConflictResolutionPolicy resolutionPolicy, FullEnumerationChangeBatch sourceChanges, object changeDataRetriever, SyncCallbacks syncCallback, SyncSessionStatistics sessionStatistics)
        {
            _metadataStore.BeginTransaction();

            //Get all my local change versions from the metadata store
            IEnumerable<ItemChange> localChanges = _metadata.GetFullEnumerationLocalVersions(sourceChanges);

            //Create a changeapplier object to make change application easier (make the engine call me
            //when it needs data and when I should save data)
            NotifyingChangeApplier changeApplier = new NotifyingChangeApplier(_idFormats);
            changeApplier.ApplyFullEnumerationChanges(resolutionPolicy, sourceChanges, changeDataRetriever as IChangeDataRetriever, localChanges, _metadata.GetKnowledge(),
                _metadata.GetForgottenKnowledge(), this, _currentSessionContext, syncCallback);

            _metadataStore.CommitTransaction();
        }