Пример #1
0
 public override bool IsMatch(BadMessageRec message, TestIntegration testIntegration)
 {
     return(message != null && message.RawFailure != null && CommonUtils.ExceptionIs(message.RawFailure, new WellKnownException[]
     {
         WellKnownException.ConflictEntryIdCorruption
     }));
 }
Пример #2
0
        public static IReservation CreateReservation(string serverFQDN, NetworkCredential credentials, Guid mailboxGuid, TenantPartitionHint partitionHint, Guid resourceId, ReservationFlags flags)
        {
            if (serverFQDN == null)
            {
                TestIntegration testIntegration = new TestIntegration(false);
                if ((flags.HasFlag(ReservationFlags.Read) && testIntegration.UseRemoteForSource) || (flags.HasFlag(ReservationFlags.Write) && testIntegration.UseRemoteForDestination))
                {
                    serverFQDN = CommonUtils.LocalComputerName;
                }
            }
            IReservation result = null;

            ExecutionContext.Create(new DataContext[]
            {
                new OperationDataContext("IReservationManager.ReserveResources", OperationType.None),
                new SimpleValueDataContext("MailboxGuid", mailboxGuid),
                new SimpleValueDataContext("ResourceId", resourceId),
                new SimpleValueDataContext("Flags", flags)
            }).Execute(delegate
            {
                if (serverFQDN == null)
                {
                    result = ReservationManager.CreateReservation(mailboxGuid, partitionHint, resourceId, flags, CommonUtils.LocalComputerName);
                    return;
                }
                result = RemoteReservation.Create(serverFQDN, credentials, mailboxGuid, partitionHint, resourceId, flags);
            });
            return(new ReservationWrapper(result));
        }
Пример #3
0
 public override bool IsMatch(BadMessageRec message, TestIntegration testIntegration)
 {
     return(message != null && message.RawFailure != null && CommonUtils.ExceptionIs(message.RawFailure, new WellKnownException[]
     {
         WellKnownException.InvalidMultivalueElement
     }));
 }
Пример #4
0
 public override bool IsMatch(BadMessageRec message, TestIntegration testIntegration)
 {
     return(message != null && message.RawFailure != null && CommonUtils.ExceptionIs(message.RawFailure, new WellKnownException[]
     {
         WellKnownException.NonCanonicalACL
     }));
 }
Пример #5
0
 public override bool IsMatch(BadMessageRec message, TestIntegration testIntegration)
 {
     return(message != null && message.RawFailure != null && message.Failure != null && message.Failure.Message != null && CommonUtils.ExceptionIs(message.RawFailure, new WellKnownException[]
     {
         WellKnownException.CorruptData
     }) && message.Failure.Message.Contains("[String]") && (message.Failure.Message.Contains("[{00062008-0000-0000-c000-000000000046}:0x853a]") || message.Failure.Message.Contains("[{00020329-0000-0000-c000-000000000046}:'Keywords']")));
 }
Пример #6
0
 public override bool IsMatch(BadMessageRec message, TestIntegration testIntegration)
 {
     return(message != null && message.RawFailure != null && CommonUtils.ExceptionIs(message.RawFailure, new WellKnownException[]
     {
         WellKnownException.CorruptRecipient
     }) && message.MessageClass == "IPM.Note.Microsoft.CDR.UM");
 }
Пример #7
0
 public void Classify(BadMessageRec item, TestIntegration testIntegration)
 {
     foreach (BadItemCategory badItemCategory in BadItemClassifier.categories)
     {
         if (badItemCategory.IsMatch(item, testIntegration))
         {
             item.Category = badItemCategory.Name;
             break;
         }
     }
 }
Пример #8
0
            public override bool IsMatch(BadMessageRec message, TestIntegration testIntegration)
            {
                if (message == null)
                {
                    return(false);
                }
                bool result = true;

                if (this.badItemKind != null && message.Kind != this.badItemKind.Value)
                {
                    result = false;
                }
                if (this.wke != null && !CommonUtils.ExceptionIs(message.RawFailure, new WellKnownException[]
                {
                    this.wke.Value
                }))
                {
                    result = false;
                }
                return(result);
            }
Пример #9
0
 public override bool IsMatch(BadMessageRec message, TestIntegration testIntegration)
 {
     return(true);
 }
Пример #10
0
 public override bool IsMatch(BadMessageRec message, TestIntegration testIntegration)
 {
     return(message != null && message.Failure != null && message.Failure.Message != null && message.Failure.Message.Contains("Lid: 37736   dwParam: 0x") && message.Failure.Message.Contains("Lid: 55288   StoreEc: 0x80040117"));
 }
Пример #11
0
 public override bool IsMatch(BadMessageRec message, TestIntegration testIntegration)
 {
     return(message != null && message.MessageClass != null && ObjectClass.IsDistributionList(message.MessageClass));
 }
Пример #12
0
 private static bool ExportMessageBatch(ISourceMailbox mailbox, List <MessageRec> messages, Func <IFxProxyPool> getProxyPool, ExportMessagesFlags flags, PropTag[] propsToCopyExplicitly, PropTag[] excludeProps, TestIntegration testIntegration, out Exception failure)
 {
     failure = null;
     try
     {
         using (IFxProxyPool fxProxyPool = getProxyPool())
         {
             mailbox.ExportMessages(messages, fxProxyPool, flags, propsToCopyExplicitly, excludeProps);
         }
         return(true);
     }
     catch (Exception ex)
     {
         if (!MapiUtils.IsBadItemIndicator(ex, out failure))
         {
             if (failure != ex)
             {
                 failure.PreserveExceptionStack();
                 throw failure;
             }
             throw;
         }
     }
     return(false);
 }
Пример #13
0
 public override bool IsMatch(BadMessageRec message, TestIntegration testIntegration)
 {
     return(testIntegration.ClassifyBadItemFaults && (message != null && message.Failure != null && message.Failure.Message != null) && message.Failure.Message.Contains("Lid: 48184   StoreEc: 0x8000400"));
 }
Пример #14
0
 public override bool IsMatch(BadMessageRec message, TestIntegration testIntegration)
 {
     return(message.Failure != null && message.Failure.DataContext != null && message.Failure.Message != null && message.Failure.FailureSideInt == 2 && !(message.Failure.FailureType != "ObjectValidationException") && message.Failure.DataContext.Contains("ISourceMailbox.ExportMessages") && message.Failure.Message.Contains(this.failureSignature));
 }
Пример #15
0
 public override bool IsMatch(BadMessageRec message, TestIntegration testIntegration)
 {
     return(message != null && message.Failure != null && message.Failure.DataContext != null && message.Failure.Message != null && message.Failure.FailureSideInt == 2 && !(message.Failure.FailureType != "ObjectValidationException") && message.Failure.DataContext.Contains("ISourceMailbox.ExportMessages") && message.Failure.Message.Contains("Microsoft.Exchange.Data.Storage.RecurrenceBlobConstraint"));
 }
Пример #16
0
 public override bool IsMatch(BadMessageRec message, TestIntegration testIntegration)
 {
     return(message != null && FolderFilterParser.IsDumpster(message.WellKnownFolderType));
 }
Пример #17
0
 public override bool IsMatch(BadMessageRec message, TestIntegration testIntegration)
 {
     return(message != null && (message.MessageClass == null || !ObjectClass.IsContact(message.MessageClass)) && message.DateSent != null && message.DateSent.Value < DateTime.UtcNow - this.ageLimit);
 }
Пример #18
0
 public abstract bool IsMatch(BadMessageRec message, TestIntegration testIntegration);
Пример #19
0
        public static void ExportMessagesWithBadItemDetection(ISourceMailbox mailbox, List <MessageRec> messages, Func <IFxProxyPool> getProxyPool, ExportMessagesFlags flags, PropTag[] propsToCopyExplicitly, PropTag[] excludeProps, TestIntegration testIntegration, ref List <BadMessageRec> badMessages)
        {
            MrsTracer.Common.Debug("ExportMessagesWithBadItemDetection: Exporting {0} messages", new object[]
            {
                messages.Count
            });
            Exception ex;

            if (MapiUtils.ExportMessageBatch(mailbox, messages, getProxyPool, flags, propsToCopyExplicitly, excludeProps, testIntegration, out ex))
            {
                return;
            }
            MrsTracer.Common.Warning("ExportMessages failed with a bad item error. Current batch count {0}. Will retry copying messages in smaller batches. {1}", new object[]
            {
                messages.Count,
                CommonUtils.FullExceptionMessage(ex)
            });
            if (messages.Count != 1)
            {
                int num = messages.Count / 2;
                List <MessageRec> list  = new List <MessageRec>(num);
                List <MessageRec> list2 = new List <MessageRec>(messages.Count - num);
                for (int i = 0; i < messages.Count; i++)
                {
                    if (i < num)
                    {
                        list.Add(messages[i]);
                    }
                    else
                    {
                        list2.Add(messages[i]);
                    }
                }
                MapiUtils.ExportMessagesWithBadItemDetection(mailbox, list, getProxyPool, flags, propsToCopyExplicitly, excludeProps, testIntegration, ref badMessages);
                MapiUtils.ExportMessagesWithBadItemDetection(mailbox, list2, getProxyPool, flags, propsToCopyExplicitly, excludeProps, testIntegration, ref badMessages);
                return;
            }
            MessageRec messageRec = messages[0];

            MrsTracer.Common.Warning("Single message {0} copy failed. Error {1}", new object[]
            {
                TraceUtils.DumpEntryId(messageRec.EntryId),
                CommonUtils.FullExceptionMessage(ex)
            });
            EntryIdMap <MessageRec> entryIdMap;
            EntryIdMap <FolderRec>  entryIdMap2;

            MapiUtils.LookupBadMessagesInMailbox(mailbox, messages, out entryIdMap, out entryIdMap2);
            MessageRec msgData;

            if (!entryIdMap.TryGetValue(messageRec.EntryId, out msgData))
            {
                badMessages.Add(BadMessageRec.MissingItem(messageRec));
                return;
            }
            DownlevelBadItemsPermanentException ex2 = ex as DownlevelBadItemsPermanentException;

            if (ex2 != null)
            {
                badMessages.Add(ex2.BadItems[0]);
                return;
            }
            FolderRec folderRec = entryIdMap2[messageRec.FolderId];

            badMessages.Add(BadMessageRec.Item(msgData, folderRec, ex));
        }