Beispiel #1
0
 public void SetResult(AutoDiscoverResult result)
 {
     if (Interlocked.CompareExchange <AutoDiscoverResult>(ref this.result, result, null) == null && result.Exception != null)
     {
         Globals.AvailabilityLogger.LogEvent(InfoWorkerEventLogConstants.Tuple_AutoDiscoverFailed, this.EmailAddress.Domain, new object[]
         {
             Globals.ProcessId,
             this.EmailAddress,
             this.applicationName,
             result.Exception.ToString()
         });
     }
 }
Beispiel #2
0
        protected override void SetResult(AutoDiscoverQueryItem queryItem, WebServiceUri webServiceUri)
        {
            WebServiceUri webServiceUri2 = new WebServiceUri(webServiceUri, null, queryItem.EmailAddress);

            base.AddWebServiceUriToCache(queryItem, webServiceUri2);
            AutoDiscoverResult result;

            if (!base.Application.IsVersionSupportedForExternalUser(webServiceUri.ServerVersion))
            {
                AutoDiscoverQuery.AutoDiscoverTracer.TraceError <object, int, Type>((long)this.GetHashCode(), "{0}: Remote server version {1} is considered a legacy server by {2} application for external user.", TraceContext.Get(), webServiceUri.ServerVersion, base.Application.GetType());
                result = new AutoDiscoverResult(base.Application.CreateExceptionForUnsupportedVersion(queryItem.RecipientData, webServiceUri.ServerVersion));
            }
            else
            {
                result = new AutoDiscoverResult(webServiceUri2, base.Authenticator.ProxyAuthenticator);
            }
            queryItem.SetResult(result);
        }
 public DispatcherWithAutoDiscoverResults(Application application, QueryList queryList, IList <AutoDiscoverQueryItem> autoDiscoverQueryItems, ProxyAuthenticator proxyAuthenticator, RequestType requestType, DispatcherWithAutoDiscoverResults.CreateRequestWithQueryListDelegate createRequestDelegate)
 {
     DispatcherWithAutoDiscoverResults < > 4__this = this;
     this.createRequestDelegate = createRequestDelegate;
     for (int i = 0; i < queryList.Count; i++)
     {
         BaseQuery          baseQuery          = queryList[i];
         AutoDiscoverResult autoDiscoverResult = autoDiscoverQueryItems[i].Result;
         if (autoDiscoverResult.Exception != null)
         {
             DispatcherWithAutoDiscoverResults.RequestRoutingTracer.TraceError <object, EmailAddress>((long)this.GetHashCode(), "{0}: autodiscover for {1} failed and it will not be dispatched for query", TraceContext.Get(), baseQuery.Email);
             baseQuery.SetResultOnFirstCall(application.CreateQueryResult(autoDiscoverResult.Exception));
         }
         else
         {
             string key = autoDiscoverResult.WebServiceUri.Uri.ToString();
             if (autoDiscoverResult.WebServiceUri.EmailAddress != null)
             {
                 baseQuery.RecipientData.EmailAddress = autoDiscoverResult.WebServiceUri.EmailAddress;
             }
             base.Add(key, baseQuery, requestType, (QueryList perRequestQueryList) => < > 4__this.createRequestDelegate(perRequestQueryList, proxyAuthenticator ?? autoDiscoverResult.ProxyAuthenticator, autoDiscoverResult.WebServiceUri, UriSource.EmailDomain));
         }
     }
 }