Example #1
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);
        }
 private void ProcessResponseMessages(int traceId, QueryList queryList, FindMessageTrackingReportResponseMessageType response)
 {
     if (response == null)
     {
         Application.ProxyWebRequestTracer.TraceError((long)traceId, "{0}: Proxy web request returned NULL FindMessageTrackingReportResponseMessageType", new object[]
         {
             TraceContext.Get()
         });
         return;
     }
     foreach (BaseQuery baseQuery in ((IEnumerable <BaseQuery>)queryList))
     {
         FindMessageTrackingBaseQuery findMessageTrackingBaseQuery = (FindMessageTrackingBaseQuery)baseQuery;
         findMessageTrackingBaseQuery.SetResultOnFirstCall(new FindMessageTrackingBaseQueryResult
         {
             Response = response
         });
     }
 }
 public override BaseQuery CreateFromIndividual(RecipientData recipientData, LocalizedException exception)
 {
     return(FindMessageTrackingBaseQuery.CreateFromIndividual(recipientData, exception));
 }
 public override BaseQuery CreateFromIndividual(RecipientData recipientData)
 {
     return(FindMessageTrackingBaseQuery.CreateFromIndividual(recipientData));
 }