The deletions element contains information about IDs of messaging objects that had been deleted, expired, or moved out of the synchronization scope since the last synchronization, as specified in the initial ICS state. deletions = IncrSyncDel propList
상속: SyntacticalBase
예제 #1
0
 /// <summary>
 /// Verify that a stream's current position contains a serialized hierarchySync.
 /// </summary>
 /// <param name="stream">A FastTransferStream.</param>
 /// <returns>If the stream's current position contains
 /// a serialized hierarchySync, return true, else false.</returns>
 public static bool Verify(FastTransferStream stream)
 {
     return((FolderChange.Verify(stream) ||
             Deletions.Verify(stream) ||
             State.Verify(stream)) &&
            stream.VerifyMarker(
                Markers.PidTagIncrSyncEnd,
                (int)stream.Length - MarkersHelper.PidTagLength - (int)stream.Position));
 }
예제 #2
0
 /// <summary>
 /// Verify that a stream's current position contains a serialized contentsSync.
 /// </summary>
 /// <param name="stream">A FastTransferStream.</param>
 /// <returns>If the stream's current position contains
 /// a serialized contentsSync, return true, else false.</returns>
 public static bool Verify(FastTransferStream stream)
 {
     return((ProgressTotal.Verify(stream) ||
             ProgressPerMessage.Verify(stream) ||
             MessageChange.Verify(stream) ||
             Deletions.Verify(stream) ||
             ReadStateChanges.Verify(stream) ||
             State.Verify(stream)) &&
            stream.VerifyMarker(
                EndMarker,
                (int)stream.Length - MarkersHelper.PidTagLength - (int)stream.Position));
 }
예제 #3
0
        /// <summary>
        /// Deserialize fields from a FastTransferStream.
        /// </summary>
        /// <param name="stream">A FastTransferStream.</param>
        public override void Deserialize(FastTransferStream stream)
        {
            this.folderChangeList = new List <FolderChange>();
            while (FolderChange.Verify(stream))
            {
                this.folderChangeList.Add(new FolderChange(stream));
            }

            if (Deletions.Verify(stream))
            {
                this.deletions = new Deletions(stream);
            }

            this.state = new State(stream);
            if (!stream.ReadMarker(Markers.PidTagIncrSyncEnd))
            {
                AdapterHelper.Site.Assert.Fail("The stream cannot be deserialized successfully.");
            }
        }
예제 #4
0
        /// <summary>
        /// Deserialize fields from a FastTransferStream.
        /// </summary>
        /// <param name="stream">A FastTransferStream.</param>
        public override void Deserialize(FastTransferStream stream)
        {
            this.messageChangeTuples = new List <Tuple <ProgressPerMessage, MessageChange> >();
            if (ProgressTotal.Verify(stream))
            {
                this.progressTotal = new ProgressTotal(stream);
            }

            while (ProgressPerMessage.Verify(stream) ||
                   MessageChange.Verify(stream))
            {
                ProgressPerMessage tmp1 = null;
                MessageChange      tmp2 = null;
                if (ProgressPerMessage.Verify(stream))
                {
                    tmp1 = new ProgressPerMessage(stream);
                }

                tmp2 = MessageChange.DeserializeFrom(stream) as MessageChange;
                this.messageChangeTuples.Add(
                    new Tuple <ProgressPerMessage, MessageChange>(
                        tmp1, tmp2));
            }

            if (Deletions.Verify(stream))
            {
                this.deletions = new Deletions(stream);
            }

            if (ReadStateChanges.Verify(stream))
            {
                this.readStateChanges = new ReadStateChanges(stream);
            }

            this.state = new State(stream);
            if (!stream.ReadMarker(Markers.PidTagIncrSyncEnd))
            {
                AdapterHelper.Site.Assert.Fail("The stream cannot be deserialized successfully.");
            }
        }
        /// <summary>
        /// Gets abstract deletion
        /// </summary>
        /// <param name="deletion">A deletion object.</param>
        /// <returns>The corresponding AbstractDeletion object.</returns>
        private AbstractDeletion GetAbstractDeletion(Deletions deletion)
        {
            AbstractDeletion ad = new AbstractDeletion
            {
                IdSetDeleted = new Modeling.Set<int>()
            };

            // If the deletion is not null change the AbstractDeletion's field,
            // else do nothing.
            if (deletion != null)
            {
                // If the deletion is not null the deletion is present.
                ad.IsDeletionPresent = true;

                // Check pidtags in the deletions property list.
                ad.IsPidTagIdsetExpiredExist
                    = deletion.PropList.HasPidTagIdsetExpired;
                ad.IsPidTagIdsetNoLongerInScopeExist
                    = deletion.PropList.HasPidTagIdsetNoLongerInScope;

                // Check IDSET in the deletion.
                // If the IDSET that can be got from PidTagIdsetDeleted value 
                // in the PropList of the deletions is contained in the objectIdContainer
                // add it to the IdsetDeleted field in the AbstractDeletion
                List<ulong> ids = deletion.IdsetDeleted;

                this.VerifyMetaTagIdsetDeletedProperty(this.hasExecuteSynchronizationImportDeletes, this.importDelFlag, ids, this.delObjId);
                this.hasExecuteSynchronizationImportDeletes = false;

                foreach (int key in this.objectIdContainer.Keys)
                {
                    if (ids.Contains(this.objectIdContainer[key]))
                    {
                        ad.IdSetDeleted = ad.IdSetDeleted.Add(key);
                    }
                }
            }

            return ad;
        }
예제 #6
0
        /// <summary>
        /// Deserialize fields from a FastTransferStream.
        /// </summary>
        /// <param name="stream">A FastTransferStream.</param>
        public override void Deserialize(FastTransferStream stream)
        {
            this.messageChangeTuples = new List<Tuple<ProgressPerMessage, MessageChange>>();
            if (ProgressTotal.Verify(stream))
            {
                this.progressTotal = new ProgressTotal(stream);
            }

            while (ProgressPerMessage.Verify(stream)
                || MessageChange.Verify(stream))
            {
                ProgressPerMessage tmp1 = null;
                MessageChange tmp2 = null;
                if (ProgressPerMessage.Verify(stream))
                {
                    tmp1 = new ProgressPerMessage(stream);
                }

                tmp2 = MessageChange.DeserializeFrom(stream) as MessageChange;
                this.messageChangeTuples.Add(
                    new Tuple<ProgressPerMessage, MessageChange>(
                        tmp1, tmp2));
            }

            if (Deletions.Verify(stream))
            {
                this.deletions = new Deletions(stream);
            }

            if (ReadStateChanges.Verify(stream))
            {
                this.readStateChanges = new ReadStateChanges(stream);
            }

            this.state = new State(stream);
            if (!stream.ReadMarker(Markers.PidTagIncrSyncEnd))
            {
                AdapterHelper.Site.Assert.Fail("The stream cannot be deserialized successfully.");
            }
        }
        /// <summary>
        /// Deserialize fields from a FastTransferStream.
        /// </summary>
        /// <param name="stream">A FastTransferStream.</param>
        public override void Deserialize(FastTransferStream stream)
        {
            this.folderChangeList = new List<FolderChange>();
            while (FolderChange.Verify(stream))
            {
                this.folderChangeList.Add(new FolderChange(stream));
            }

            if (Deletions.Verify(stream))
            {
                this.deletions = new Deletions(stream);
            }

            this.state = new State(stream);
            if (!stream.ReadMarker(Markers.PidTagIncrSyncEnd))
            {
                AdapterHelper.Site.Assert.Fail("The stream cannot be deserialized successfully.");
            }
        }