Example #1
0
        // Token: 0x06000390 RID: 912 RVA: 0x00019008 File Offset: 0x00017208
        private static IEnumerable <TagExpirationExecutor.ItemSet> GetItemSets(List <ItemData> listToSend)
        {
            ItemData        startOfChunk = null;
            List <ItemData> items        = null;

            foreach (ItemData itemData in listToSend)
            {
                if (startOfChunk != null && TagExpirationExecutor.CompareItemData(startOfChunk, itemData) != 0)
                {
                    TagExpirationExecutor.ItemSet itemSet = new TagExpirationExecutor.ItemSet(startOfChunk.ParentId, items);
                    yield return(itemSet);

                    startOfChunk = null;
                }
                if (startOfChunk == null)
                {
                    startOfChunk = itemData;
                    items        = new List <ItemData>();
                }
                items.Add(itemData);
            }
            if (startOfChunk != null)
            {
                TagExpirationExecutor.ItemSet itemSet2 = new TagExpirationExecutor.ItemSet(startOfChunk.ParentId, items);
                yield return(itemSet2);
            }
            yield break;
        }
Example #2
0
 // Token: 0x06000538 RID: 1336 RVA: 0x00027650 File Offset: 0x00025850
 public void MoveToArchive(TagExpirationExecutor.ItemSet itemSet, ElcSubAssistant assistant, FolderArchiver folderArchiver, int totalFailuresSoFar, ref List <Exception> allExceptionsSoFar, out List <string> foldersWithErrors, out int newMoveErrorsTotal)
 {
     if (this.PrimaryEwsClient == null)
     {
         throw new ElcEwsException(ElcEwsErrorType.PrimaryExchangeWebServiceNotAvailable, "Primary EWS url is unknown.");
     }
     foldersWithErrors  = new List <string>();
     newMoveErrorsTotal = 0;
     if (this.IsCrossPremise && this.moveToArchiveTotalCount > this.MoveToArchiveTotalCountLimit)
     {
         RemoteArchiveProcessorBase.Tracer.TraceDebug <RemoteArchiveProcessorBase>((long)this.GetHashCode(), "{0}: Move to archive total count limit reached.  No more item is moved to the archive mailbox during this run.", this);
         return;
     }
     using (Folder folder = Folder.Bind(this.primaryMailboxSession, itemSet.FolderId))
     {
         FolderTupleRemoteArchive folderTupleRemoteArchive = folderArchiver.GetArchiveFolderTuple(itemSet.FolderId) as FolderTupleRemoteArchive;
         if (folderTupleRemoteArchive != null)
         {
             RemoteArchiveProcessorBase.Tracer.TraceDebug <RemoteArchiveProcessorBase, string, string>((long)this.GetHashCode(), "{0}: Was able to open target folder {1} in the archive, corresponding to source folder {2}. Will proceed to move in batches.", this, folderTupleRemoteArchive.DisplayName, folder.DisplayName);
             this.MoveItemsInBatches(itemSet.Items, folder, folderTupleRemoteArchive.Folder, ExpirationExecutor.Action.MoveToArchive, totalFailuresSoFar, ref allExceptionsSoFar, out foldersWithErrors, out newMoveErrorsTotal);
         }
         else
         {
             RemoteArchiveProcessorBase.Tracer.TraceWarning <RemoteArchiveProcessorBase, string>((long)this.GetHashCode(), "{0}: Unable to get target folder in the archive corresponding to source folder {1}. Will not move anything to it.", this, folder.DisplayName);
         }
     }
 }
 // Token: 0x0600050D RID: 1293 RVA: 0x00025F00 File Offset: 0x00024100
 public void MoveToArchive(TagExpirationExecutor.ItemSet itemSet, ElcSubAssistant assistant, FolderArchiver folderArchiver, int totalFailuresSoFar, ref List <Exception> allExceptionsSoFar, out List <string> foldersWithErrors, out int newMoveErrorsTotal)
 {
     if (itemSet == null)
     {
         throw new ArgumentNullException("itemSet");
     }
     if (assistant == null)
     {
         throw new ArgumentNullException("assistant");
     }
     if (folderArchiver == null)
     {
         throw new ArgumentNullException("folderArchiver");
     }
     foldersWithErrors  = new List <string>();
     newMoveErrorsTotal = 0;
     if (this.archiveMailboxSession == null)
     {
         LocalArchiveProcessor.Tracer.TraceWarning <LocalArchiveProcessor>((long)this.GetHashCode(), "{0}: Could not open archive session for this mailbox", this);
         return;
     }
     assistant.EnableLoadTrackingOnSession(this.archiveMailboxSession);
     using (Folder folder = Folder.Bind(this.primaryMailboxSession, itemSet.FolderId))
     {
         if (folder != null)
         {
             FolderTuple archiveFolderTuple = folderArchiver.GetArchiveFolderTuple(folder.Id.ObjectId);
             if (archiveFolderTuple != null)
             {
                 using (Folder folder2 = Folder.Bind(this.archiveMailboxSession, archiveFolderTuple.FolderId))
                 {
                     if (folder2 != null)
                     {
                         LocalArchiveProcessor.Tracer.TraceDebug <LocalArchiveProcessor, string, string>((long)this.GetHashCode(), "{0}: Was able to open target folder {1} in the archive, corresponding to source folder {2}. Will proceed to move in batches.", this, folder2.DisplayName, folder.DisplayName);
                         this.ExpireInBatches(itemSet.Items, folder, folder2, assistant, ExpirationExecutor.Action.MoveToArchive, totalFailuresSoFar, ref allExceptionsSoFar, out foldersWithErrors, out newMoveErrorsTotal);
                     }
                     else
                     {
                         LocalArchiveProcessor.Tracer.TraceWarning <LocalArchiveProcessor, string>((long)this.GetHashCode(), "{0}: Unable to open target folder in the archive corresponding to source folder {1}. Will not move anything to it (obviously).", this, folder.DisplayName);
                     }
                     goto IL_14B;
                 }
             }
             LocalArchiveProcessor.Tracer.TraceWarning <LocalArchiveProcessor, string>((long)this.GetHashCode(), "{0}: Unable to get target folder in the archive corresponding to source folder {1}. Will not move anything to it (obviously).", this, folder.DisplayName);
         }
         else
         {
             LocalArchiveProcessor.Tracer.TraceWarning <LocalArchiveProcessor, string>((long)this.GetHashCode(), "{0}: Unable to open source folder {1}. Will not move anything from it (obviously).", this, itemSet.FolderId.ToHexEntryId());
         }
         IL_14B :;
     }
 }
 // Token: 0x0600051E RID: 1310 RVA: 0x000269B4 File Offset: 0x00024BB4
 public void MoveToArchive(TagExpirationExecutor.ItemSet itemSet, ElcSubAssistant assistant, FolderArchiver folderArchiver, int totalFailuresSoFar, ref List <Exception> allExceptionsSoFar, out List <string> foldersWithErrors, out int newMoveErrorsTotal)
 {
     foldersWithErrors  = new List <string>();
     newMoveErrorsTotal = 0;
     using (Folder folder = Folder.Bind(this.primaryMailboxSession, itemSet.FolderId))
     {
         FolderTupleCrossServerArchive folderTupleCrossServerArchive = folderArchiver.GetArchiveFolderTuple(itemSet.FolderId) as FolderTupleCrossServerArchive;
         if (folderTupleCrossServerArchive != null)
         {
             RemoteArchiveProcessor.Tracer.TraceDebug <RemoteArchiveProcessor, string, string>((long)this.GetHashCode(), "{0}: Was able to open target folder {1} in the archive, corresponding to source folder {2}. Will proceed to move in batches.", this, folderTupleCrossServerArchive.DisplayName, folder.DisplayName);
             this.MoveItemsInBatches(itemSet.Items, folder, folderTupleCrossServerArchive.Folder, assistant, ExpirationExecutor.Action.MoveToArchive, totalFailuresSoFar, ref allExceptionsSoFar, out foldersWithErrors, out newMoveErrorsTotal);
         }
         else
         {
             RemoteArchiveProcessor.Tracer.TraceWarning <RemoteArchiveProcessor, string>((long)this.GetHashCode(), "{0}: Unable to open target folder in the archive corresponding to source folder {1}. Will not move anything to it (obviously).", this, folder.DisplayName);
         }
     }
 }