Exemple #1
0
 public FindMessageTrackingQuery(SmtpAddress proxyRecipient, string domain, DirectoryContext directoryContext, FindMessageTrackingReportRequestTypeWrapper request, ExchangeVersion minVersionRequested, TimeSpan timeout) : base(directoryContext.ClientContext, null, CasTraceEventType.MessageTracking, FindMessageTrackingApplication.MessageTrackingIOCompletion, InfoWorkerMessageTrackingPerformanceCounters.CurrentRequestDispatcherRequests)
 {
     if (SmtpAddress.Empty.Equals(proxyRecipient))
     {
         string address = ServerCache.Instance.GetOrgMailboxForDomain(domain).ToString();
         this.fakeRecipientQueryResults = MessageTrackingApplication.CreateFakeRecipientQueryResult(address);
     }
     else
     {
         this.proxyRecipient = proxyRecipient;
     }
     this.directoryContext    = directoryContext;
     this.request             = request;
     this.minVersionRequested = minVersionRequested;
     base.Timeout             = timeout;
 }
Exemple #2
0
        protected override FindMessageTrackingQueryResult ExecuteInternal()
        {
            base.RequestLogger.AppendToLog <string>("MessageTrackingRequest", "Start");
            FindMessageTrackingApplication findMessageTrackingApplication = new FindMessageTrackingApplication(this.request, this.minVersionRequested);
            FindMessageTrackingQueryResult result;

            using (RequestDispatcher requestDispatcher = new RequestDispatcher(base.RequestLogger))
            {
                IList <RecipientData> recipientQueryResults;
                if (this.fakeRecipientQueryResults != null)
                {
                    recipientQueryResults = this.fakeRecipientQueryResults;
                }
                else
                {
                    recipientQueryResults = MessageTrackingApplication.CreateRecipientQueryResult(this.directoryContext, this.queryPrepareDeadline, this.proxyRecipient.ToString());
                }
                QueryGenerator queryGenerator = new QueryGenerator(findMessageTrackingApplication, base.ClientContext, base.RequestLogger, requestDispatcher, this.queryPrepareDeadline, this.requestProcessingDeadline, recipientQueryResults);
                try
                {
                    BaseQuery[] queries = queryGenerator.GetQueries();
                    requestDispatcher.Execute(this.requestProcessingDeadline, base.HttpResponse);
                    FindMessageTrackingBaseQuery findMessageTrackingBaseQuery = (FindMessageTrackingBaseQuery)queries[0];
                    if (findMessageTrackingBaseQuery.Result == null)
                    {
                        result = null;
                    }
                    else
                    {
                        if (findMessageTrackingBaseQuery.Result.ExceptionInfo != null)
                        {
                            throw findMessageTrackingBaseQuery.Result.ExceptionInfo;
                        }
                        FindMessageTrackingQueryResult findMessageTrackingQueryResult = new FindMessageTrackingQueryResult();
                        findMessageTrackingQueryResult.Response = findMessageTrackingBaseQuery.Result.Response;
                        base.RequestLogger.AppendToLog <string>("MessageTrackingRequest", "Exit");
                        result = findMessageTrackingQueryResult;
                    }
                }
                finally
                {
                    requestDispatcher.LogStatistics(base.RequestLogger);
                    findMessageTrackingApplication.LogThreadsUsage(base.RequestLogger);
                }
            }
            return(result);
        }
        public GetMessageTrackingQuery(SmtpAddress proxyRecipient, DirectoryContext directoryContext, GetMessageTrackingReportRequestTypeWrapper request, ExchangeVersion minVersionRequested, TimeSpan timeout) : base(directoryContext.ClientContext, null, CasTraceEventType.MessageTracking, GetMessageTrackingApplication.MessageTrackingIOCompletion, InfoWorkerMessageTrackingPerformanceCounters.CurrentRequestDispatcherRequests)
        {
            MessageTrackingReportId messageTrackingReportId = null;

            if (!MessageTrackingReportId.TryParse(request.WrappedRequest.MessageTrackingReportId, out messageTrackingReportId))
            {
                throw new ArgumentException("MessageTrackingReportId invalid");
            }
            this.directoryContext = directoryContext;
            string address = ServerCache.Instance.GetOrgMailboxForDomain(messageTrackingReportId.Domain).ToString();

            this.fakeRecipientQueryResults = MessageTrackingApplication.CreateFakeRecipientQueryResult(address);
            this.proxyRecipient            = proxyRecipient;
            this.request             = request;
            this.minVersionRequested = minVersionRequested;
            base.Timeout             = timeout;
        }
Exemple #4
0
        internal static IList <RecipientData> CreateRecipientQueryResult(DirectoryContext directoryContext, DateTime queryPrepareDeadline, string proxyRecipient)
        {
            RecipientQuery recipientQuery = new RecipientQuery(directoryContext.ClientContext, directoryContext.TenantGalSession, queryPrepareDeadline, FindMessageTrackingQuery.RecipientProperties);

            Microsoft.Exchange.InfoWorker.Common.Availability.EmailAddress   emailAddress      = new Microsoft.Exchange.InfoWorker.Common.Availability.EmailAddress(string.Empty, proxyRecipient);
            Microsoft.Exchange.InfoWorker.Common.Availability.EmailAddress[] emailAddressArray = new Microsoft.Exchange.InfoWorker.Common.Availability.EmailAddress[]
            {
                emailAddress
            };
            IList <RecipientData> list = recipientQuery.Query(emailAddressArray);

            if (list[0].IsEmpty)
            {
                list = MessageTrackingApplication.CreateFakeRecipientQueryResult(ServerCache.Instance.GetOrgMailboxForDomain(emailAddress.Domain).ToString());
            }
            return(list);
        }