private AssistantTaskContext ProcessMailboxUnderPoisonControl(AssistantTaskContext context, EmergencyKit kit)
        {
            AIException          exception   = null;
            AssistantTaskContext nextContext = null;

            try
            {
                base.CatchMeIfYouCan(delegate
                {
                    AdminRpcMailboxData adminRpcMailboxData = context.MailboxData as AdminRpcMailboxData;
                    if (adminRpcMailboxData != null)
                    {
                        nextContext = this.ProcessAdminRpcMailboxUnderPoisonControl(context, kit);
                        return;
                    }
                    StoreMailboxData storeMailboxData = context.MailboxData as StoreMailboxData;
                    if (storeMailboxData != null)
                    {
                        nextContext = this.ProcessStoreMailboxUnderPoisonControl(context, kit);
                    }
                }, this.Assistant.NonLocalizedName);
            }
            catch (AIException ex)
            {
                this.LogAIException(context.MailboxData, ex);
                exception = ex;
            }
            this.PostProcessMailbox(exception, nextContext, context.MailboxData);
            return(nextContext);
        }
Пример #2
0
        internal static void LogErrorProcessingMailboxEvent(string assistantName, MailboxData mailbox, Exception e, string databaseName = "", string jobId = "", MailboxSlaRequestType requestType = MailboxSlaRequestType.Unknown)
        {
            string value             = string.Empty;
            string value2            = "unknown";
            string value3            = "unknown";
            Guid   guid              = Guid.Empty;
            string value4            = string.Empty;
            string value5            = (e.InnerException != null) ? e.InnerException.GetType().ToString() : "null";
            string diagnosticContext = AssistantsLog.GetDiagnosticContext(e);
            Guid   activityId        = (ActivityContext.ActivityId != null) ? ActivityContext.ActivityId.Value : Guid.Empty;

            if (mailbox != null)
            {
                value3 = mailbox.DatabaseGuid.ToString();
                StoreMailboxData storeMailboxData = mailbox as StoreMailboxData;
                if (storeMailboxData != null)
                {
                    value2 = "Store";
                    guid   = storeMailboxData.Guid;
                    if (storeMailboxData.OrganizationId != null)
                    {
                        value = storeMailboxData.OrganizationId.ToString();
                    }
                }
                else
                {
                    AdminRpcMailboxData adminRpcMailboxData = mailbox as AdminRpcMailboxData;
                    if (adminRpcMailboxData != null)
                    {
                        value2 = "AdminRpc";
                        value4 = adminRpcMailboxData.MailboxNumber.ToString(CultureInfo.InvariantCulture);
                    }
                }
            }
            List <KeyValuePair <string, object> > customData = new List <KeyValuePair <string, object> >
            {
                new KeyValuePair <string, object>("MailboxType", value2),
                new KeyValuePair <string, object>("MailboxGuid", guid),
                new KeyValuePair <string, object>("MailboxId", value4),
                new KeyValuePair <string, object>("TenantId", value),
                new KeyValuePair <string, object>("Database", value3),
                new KeyValuePair <string, object>("ExceptionType", e.GetType().ToString()),
                new KeyValuePair <string, object>("InnerExceptionType", value5),
                new KeyValuePair <string, object>("DiagnosticContext", diagnosticContext)
            };

            AssistantsLog.InternalLogRow(activityId, assistantName, null, AssistantsEventType.ErrorProcessingMailbox, customData, guid);
            if (!string.IsNullOrEmpty(assistantName))
            {
                MailboxAssistantsSlaReportLogFactory.MailboxAssistantsSlaReportLog logInstance = MailboxAssistantsSlaReportLogFactory.GetLogInstance(assistantName, SlaLogType.MailboxSlaLog);
                if (logInstance != null)
                {
                    logInstance.LogMailboxEvent(assistantName, databaseName, jobId, requestType, guid, (mailbox == null) ? string.Empty : mailbox.DisplayName, MailboxSlaEventType.ErrorProcessingMailbox, MailboxSlaFilterReasonType.None, e);
                }
            }
        }
        // Token: 0x06000055 RID: 85 RVA: 0x00003FA4 File Offset: 0x000021A4
        public override bool Equals(object other)
        {
            if (other == null)
            {
                return(false);
            }
            AdminRpcMailboxData adminRpcMailboxData = other as AdminRpcMailboxData;

            return(adminRpcMailboxData != null && this.Equals(adminRpcMailboxData));
        }
 // Token: 0x06000056 RID: 86 RVA: 0x00003FC9 File Offset: 0x000021C9
 public bool Equals(AdminRpcMailboxData other)
 {
     return(other != null && this.mailboxNumber == other.MailboxNumber && base.Equals(other));
 }