Esempio n. 1
0
 public AggregatedMailboxSearchGroup CreateAggregatedMailboxSearchGroup(MailboxInfo[] mailboxes, SearchCriteria searchCriteria, PagingInfo pagingInfo, CallerInfo executingUser)
 {
     return(new AggregatedMailboxSearchGroup(mailboxes, searchCriteria, pagingInfo, executingUser));
 }
 internal WebServiceMailboxSearchGroup(GroupId groupId, WebServiceMailboxSearchGroup.FindMailboxInfoHandler findMailboxInfo, SearchCriteria searchCriteria, PagingInfo pagingInfo, CallerInfo executingUser) : base(null, searchCriteria, pagingInfo, executingUser)
 {
     Util.ThrowOnNull(findMailboxInfo, "findMailboxInfo");
     this.groupId           = groupId;
     this.OnFindMailboxInfo = findMailboxInfo;
 }
Esempio n. 3
0
 public NonIndexableDiscoveryEwsClient(GroupId groupId, MailboxInfo[] mailboxes, ExTimeZone timeZone, CallerInfo caller)
 {
     Util.ThrowOnNull(groupId, "groupId");
     Util.ThrowOnNull(mailboxes, "mailboxes");
     Util.ThrowOnNull(timeZone, "timeZone");
     Util.ThrowOnNull(caller, "caller");
     this.groupId    = groupId;
     this.mailboxes  = mailboxes;
     this.callerInfo = caller;
     CertificateValidationManager.RegisterCallback(base.GetType().FullName, new RemoteCertificateValidationCallback(CertificateValidation.CertificateErrorHandler));
     this.service     = new ExchangeService(4, NonIndexableDiscoveryEwsClient.GetTimeZoneInfoFromExTimeZone(timeZone));
     this.service.Url = this.groupId.Uri;
     this.service.HttpHeaders[CertificateValidationManager.ComponentIdHeaderName] = base.GetType().FullName;
     if (this.groupId.GroupType != GroupType.CrossPremise)
     {
         this.service.UserAgent = WellKnownUserAgent.GetEwsNegoAuthUserAgent(base.GetType().FullName);
     }
     this.service.ClientRequestId = this.callerInfo.QueryCorrelationId.ToString("N");
     this.Authenticate();
 }
Esempio n. 4
0
 public INonIndexableDiscoveryEwsClient CreateNonIndexableDiscoveryEwsClient(GroupId groupId, MailboxInfo[] mailboxes, ExTimeZone timeZone, CallerInfo caller)
 {
     return(new NonIndexableDiscoveryEwsClient(groupId, mailboxes, timeZone, caller));
 }
 protected MailboxSearchGroup(MailboxInfo[] mailboxes, SearchCriteria searchCriteria, PagingInfo pagingInfo, CallerInfo executingUser)
 {
     this.mailboxes        = mailboxes;
     this.searchCriteria   = searchCriteria;
     this.pagingInfo       = pagingInfo;
     this.executingUser    = executingUser;
     this.resultAggregator = new ResultAggregator();
 }
Esempio n. 6
0
 public MultiMailboxSearchClient CreateSearchRpcClient(Guid databaseGuid, MailboxInfo[] mailboxes, SearchCriteria criteria, CallerInfo executingUserIdentity, PagingInfo pagingInfo)
 {
     return(new MultiMailboxSearchClient(databaseGuid, mailboxes, criteria, executingUserIdentity, pagingInfo));
 }
Esempio n. 7
0
 public IEwsClient CreateDiscoveryEwsClient(GroupId groupId, MailboxInfo[] mailboxes, SearchCriteria searchCriteria, PagingInfo pagingInfo, CallerInfo caller)
 {
     return(new DiscoveryEwsClient(groupId, mailboxes, searchCriteria, pagingInfo, caller));
 }
Esempio n. 8
0
        public DiscoveryEwsClient(GroupId groupId, MailboxInfo[] mailboxes, SearchCriteria searchCriteria, PagingInfo pagingInfo, CallerInfo caller)
        {
            this.groupId        = groupId;
            this.mailboxes      = mailboxes;
            this.searchCriteria = searchCriteria;
            this.pagingInfo     = pagingInfo;
            this.callerInfo     = caller;
            CertificateValidationManager.RegisterCallback(base.GetType().FullName, new RemoteCertificateValidationCallback(CertificateValidation.CertificateErrorHandler));
            this.service     = new ExchangeService(4, DiscoveryEwsClient.GetTimeZoneInfoFromExTimeZone(this.pagingInfo.TimeZone));
            this.service.Url = this.groupId.Uri;
            this.service.HttpHeaders[CertificateValidationManager.ComponentIdHeaderName] = base.GetType().FullName;
            string text = string.Format("{0}&FOUT=true", caller.UserAgent);

            if (this.groupId.GroupType != GroupType.CrossPremise)
            {
                this.service.UserAgent = WellKnownUserAgent.GetEwsNegoAuthUserAgent(string.Format("{0}-{1}", DiscoveryEwsClient.CrossServerUserAgent, text));
            }
            else
            {
                this.service.UserAgent = text;
            }
            this.service.ClientRequestId = this.callerInfo.QueryCorrelationId.ToString("N");
            this.Authenticate();
        }
Esempio n. 9
0
 public AggregatedMailboxSearchTask(Guid databaseGuid, MailboxInfoList mailboxesToSearch, SearchCriteria criteria, PagingInfo pagingInfo, List <string> keywordList, CallerInfo executingUser) : this(databaseGuid, mailboxesToSearch, SearchType.Statistics, criteria, pagingInfo, executingUser)
 {
     Util.ThrowOnNull(keywordList, "keywordList");
     if (keywordList.Count == 0)
     {
         throw new ArgumentException("AggregatedMailboxSearchTask: The keyword list for Stats search cannot be an empty list.");
     }
     this.keywordList = keywordList;
 }
Esempio n. 10
0
        public AggregatedMailboxSearchGroup(MailboxInfo[] mailboxes, SearchCriteria searchCriteria, PagingInfo pagingInfo, CallerInfo executingUser) : base(mailboxes, searchCriteria, pagingInfo, executingUser)
        {
            Util.ThrowOnNull(mailboxes, "mailboxes");
            Util.ThrowOnNull(searchCriteria, "searchCriteria");
            Util.ThrowOnNull(pagingInfo, "pagingInfo");
            Util.ThrowOnNull(executingUser, "executingUser");
            this.totalTasks = 0;
            Factory.Current.LocalTaskTracer.TraceInformation <int, string>(this.GetHashCode(), 0L, "Grouping the mailboxes:{0} by database for the query:{1}.", base.Mailboxes.Length, base.SearchCriteria.QueryString);
            Dictionary <Guid, List <MailboxInfo> > dictionary = Util.GroupMailboxByDatabase(base.Mailboxes);

            base.ResultAggregator.ProtocolLog.Add("NumberOfLocalSearch", dictionary.Count);
            PerformanceCounters.AverageDatabaseSearchedPerServer.IncrementBy((long)dictionary.Count);
            PerformanceCounters.AverageDatabaseSearchedPerServerBase.Increment();
            IEnumerable <List <string> > keywordStatsEnumerator = base.SearchCriteria.IsStatisticsSearch ? this.GenerateKeywordStatsQueryBatches(dictionary) : null;

            Factory.Current.LocalTaskTracer.TraceInformation(this.GetHashCode(), 0L, "Correlation Id:{0}. Creating Search task for query:{1} on mailboxes:{2} on databases:{3}", new object[]
            {
                base.ExecutingUser.QueryCorrelationId,
                base.SearchCriteria.QueryString,
                base.Mailboxes.Length,
                dictionary.Count
            });
            this.totalTasks = this.CreateSearchTasks(dictionary, keywordStatsEnumerator);
            Factory.Current.LocalTaskTracer.TraceInformation(this.GetHashCode(), 0L, "Correlation Id:{0}. Queued {1} tasks for query:{2} on mailboxes:{3} spanning on databases:{4}", new object[]
            {
                base.ExecutingUser.QueryCorrelationId,
                this.totalTasks,
                base.SearchCriteria.QueryString,
                base.Mailboxes.Length,
                dictionary.Count
            });
            this.maxNumberOfTasks = Factory.Current.GetMaximumThreadsForLocalSearch(this.totalTasks, base.SearchCriteria.RecipientSession);
            PerformanceCounters.TotalLocalSearchesInProgress.Increment();
        }
Esempio n. 11
0
 public NonIndexableItemDetailsProvider(IRecipientSession recipientSession, ExTimeZone timeZone, CallerInfo callerInfo, OrganizationId orgId, string[] mailboxes, bool searchArchiveOnly, NonIndexableItemPagingInfo pagingInfo) : base(recipientSession, timeZone, callerInfo, orgId, mailboxes, searchArchiveOnly)
 {
     this.pagingInfo = pagingInfo;
     if (this.pagingInfo == null)
     {
         this.pagingInfo = new NonIndexableItemPagingInfo(int.MaxValue, null);
     }
     if (this.pagingInfo.PageSize == 0)
     {
         throw new ArgumentException("Page size cannot be 0");
     }
     this.Results = new List <NonIndexableItem>();
 }
 public NonIndexableItemProvider(IRecipientSession recipientSession, ExTimeZone timeZone, CallerInfo callerInfo, OrganizationId orgId, string[] mailboxes, bool searchArchiveOnly)
 {
     Util.ThrowOnNull(recipientSession, "recipientSession");
     Util.ThrowOnNull(timeZone, "timeZone");
     Util.ThrowOnNull(callerInfo, "callerInfo");
     Util.ThrowOnNull(orgId, "orgId");
     Util.ThrowOnNull(mailboxes, "mailboxes");
     this.recipientSession  = recipientSession;
     this.timeZone          = timeZone;
     this.callerInfo        = callerInfo;
     this.orgId             = orgId;
     this.mailboxes         = mailboxes;
     this.searchArchiveOnly = searchArchiveOnly;
     this.failedMailboxes   = new Dictionary <string, string>(1);
     this.alreadyProxy      = false;
 }
Esempio n. 13
0
 public UserSettingAutodiscovery(List <MailboxInfo> mailboxes, Uri autodiscoverEndpoint, ICredentials credentials, CallerInfo callerInfo)
 {
     this.mailboxes             = mailboxes;
     this.autodiscoveryEndpoint = autodiscoverEndpoint;
     this.client           = new DefaultBinding_Autodiscover(base.GetType().FullName, new RemoteCertificateValidationCallback(CertificateValidation.CertificateErrorHandler));
     this.client.Url       = autodiscoverEndpoint.ToString();
     this.client.UserAgent = base.GetType().ToString();
     this.client.RequestedServerVersionValue = UserSettingAutodiscovery.Exchange2013RequestedServerVersion;
     this.client.PreAuthenticate             = true;
     this.client.Credentials = credentials;
     this.callerInfo         = callerInfo;
 }
Esempio n. 14
0
 public MultiMailboxSearch(SearchCriteria criteria, List <MailboxInfo> users, PagingInfo pagingInfo, CallerInfo callerInfo, OrganizationId orgId)
 {
     Util.ThrowOnNull(criteria, "criteria");
     Util.ThrowOnNull(users, "users");
     Util.ThrowOnNull(pagingInfo, "pagingInfo");
     Util.ThrowOnNull(callerInfo, "callerInfo");
     this.mailboxes        = users;
     this.criteria         = criteria;
     this.pagingInfo       = pagingInfo;
     this.callerInfo       = callerInfo;
     this.orgId            = orgId;
     this.resultAggregator = new ResultAggregator(Factory.Current.GetMaxRefinerResults(this.criteria.RecipientSession));
 }
Esempio n. 15
0
 public ISearchMailboxTask CreateAggregatedMailboxSearchTask(Guid databaseGuid, MailboxInfoList mailbox, SearchType type, SearchCriteria searchCriteria, PagingInfo pagingInfo, CallerInfo executingUser)
 {
     return(new AggregatedMailboxSearchTask(databaseGuid, mailbox, type, searchCriteria, pagingInfo, executingUser));
 }
Esempio n. 16
0
 public AggregatedMailboxSearchTask(Guid databaseGuid, MailboxInfoList mailboxesToSearch, SearchType type, SearchCriteria criteria, PagingInfo pagingInfo, CallerInfo executingUser)
 {
     Util.ThrowOnNull(databaseGuid, "databaseGuid");
     if (databaseGuid.Equals(Guid.Empty))
     {
         throw new ArgumentNullException("databaseGuid");
     }
     Util.ThrowOnNull(mailboxesToSearch, "mailboxesToSearch");
     Util.ThrowOnNull(criteria, "criteria");
     Util.ThrowOnNull(pagingInfo, "pagingInfo");
     Util.ThrowOnNull(executingUser, "executingUser");
     if ((type & (SearchType)(-4)) != (SearchType)0 || (type & SearchType.ExpandSources) == SearchType.ExpandSources)
     {
         throw new ArgumentException("AggregatedMailboxSearchTask: the task can either be a preview task or a statistics task");
     }
     if ((type & SearchType.ExpandSources) == SearchType.ExpandSources)
     {
         throw new ArgumentException("AggregatedMailboxSearchTask: the task can either be a preview task or a statistics task");
     }
     this.mailboxesToSearch = mailboxesToSearch;
     this.mailboxDatabaseId = databaseGuid;
     this.type          = type;
     this.criteria      = criteria;
     this.pagingInfo    = pagingInfo;
     this.executingUser = executingUser;
 }
Esempio n. 17
0
 public ISearchMailboxTask CreateAggregatedMailboxSearchTask(Guid databaseGuid, MailboxInfoList mailbox, SearchCriteria searchCriteria, PagingInfo pagingInfo, List <string> keywordList, CallerInfo executingUser)
 {
     return(new AggregatedMailboxSearchTask(databaseGuid, mailbox, searchCriteria, pagingInfo, keywordList, executingUser));
 }
Esempio n. 18
0
 public EwsEndpointDiscovery(List <MailboxInfo> mailboxes, OrganizationId orgId, CallerInfo callerInfo)
 {
     this.mailboxes     = mailboxes;
     this.orgId         = orgId;
     this.mailboxGroups = new Dictionary <GroupId, List <MailboxInfo> >(5);
     this.callerInfo    = callerInfo;
 }
Esempio n. 19
0
 public IEwsEndpointDiscovery GetEwsEndpointDiscovery(List <MailboxInfo> mailboxes, OrganizationId orgId, CallerInfo callerInfo)
 {
     return(new EwsEndpointDiscovery(mailboxes, orgId, callerInfo));
 }
 public NonIndexableItemStatisticsProvider(IRecipientSession recipientSession, ExTimeZone timeZone, CallerInfo callerInfo, OrganizationId orgId, string[] mailboxes, bool searchArchiveOnly) : base(recipientSession, timeZone, callerInfo, orgId, mailboxes, searchArchiveOnly)
 {
     this.Results = new List <NonIndexableItemStatisticsInfo>(mailboxes.Length);
 }
Esempio n. 21
0
 public IAutodiscoveryClient CreateUserSettingAutoDiscoveryClient(List <MailboxInfo> crossPremiseMailboxes, Uri autoDiscoveryEndpoint, ICredentials credentials, CallerInfo callerInfo)
 {
     return(new UserSettingAutodiscovery(crossPremiseMailboxes, autoDiscoveryEndpoint, credentials, callerInfo));
 }
 public WebServiceMailboxSearchGroup(GroupId groupId, MailboxInfo[] mailboxes, SearchCriteria searchCriteria, PagingInfo pagingInfo, CallerInfo executingUser) : base(mailboxes, searchCriteria, pagingInfo, executingUser)
 {
     Util.ThrowOnNull(groupId.Uri, "uri");
     Util.ThrowOnNull(mailboxes, "mailboxes");
     Util.ThrowOnNull(searchCriteria, "searchCriteria");
     Util.ThrowOnNull(pagingInfo, "pagingInfo");
     Util.ThrowOnNull(executingUser, "executingUser");
     this.groupId = groupId;
     this.client  = Factory.Current.CreateDiscoveryEwsClient(groupId, base.Mailboxes, base.SearchCriteria, base.PagingInfo, executingUser);
     PerformanceCounters.TotalFanOutSearchesInProgress.Increment();
 }
Esempio n. 23
0
        public MailboxSearchGroup CreateMailboxSearchGroup(GroupId groupId, List <MailboxInfo> mailboxes, SearchCriteria searchCriteria, PagingInfo pagingInfo, CallerInfo executingUser)
        {
            switch (groupId.GroupType)
            {
            case GroupType.Local:
                return(this.CreateAggregatedMailboxSearchGroup(mailboxes.ToArray(), searchCriteria, pagingInfo, executingUser));

            case GroupType.CrossServer:
            case GroupType.CrossPremise:
                return(new WebServiceMailboxSearchGroup(groupId, mailboxes.ToArray(), searchCriteria, pagingInfo, executingUser));

            default:
                return(null);
            }
        }
Esempio n. 24
0
 public static bool IsNestedFanoutCall(CallerInfo callerInfo)
 {
     return(callerInfo != null && !string.IsNullOrEmpty(callerInfo.UserAgent) && callerInfo.UserAgent.StartsWith(DiscoveryEwsClient.CrossServerUserAgent, StringComparison.OrdinalIgnoreCase));
 }