Ejemplo n.º 1
0
        public override async Task <AccountInformation> GetAccountInformation(ExecutionContext context, [NotNull] CrawlJobData jobData, Guid organizationId, Guid userId, Guid providerDefinitionId)
        {
            if (jobData == null)
            {
                throw new ArgumentNullException(nameof(jobData));
            }

            var exchangesharedmailboxCrawlJobData = jobData as ExchangeSharedMailboxCrawlJobData;

            if (exchangesharedmailboxCrawlJobData == null)
            {
                throw new Exception("Wrong CrawlJobData type");
            }

            var client = _exchangesharedmailboxClientFactory.CreateNew(exchangesharedmailboxCrawlJobData);

            return(await Task.FromResult(client.GetAccountInformation()));
        }
Ejemplo n.º 2
0
        public IEnumerable <object> GetData(CrawlJobData jobData)
        {
            var exchangesharedmailboxcrawlJobData = jobData as ExchangeSharedMailboxCrawlJobData;

            if (exchangesharedmailboxcrawlJobData == null)
            {
                yield break;
            }

            var client = _clientFactory.CreateNew(exchangesharedmailboxcrawlJobData);

            //crawl data from provider and yield objects

            foreach (var folder in client.GetFolders())
            {
                yield return(folder);

                foreach (var file in client.GetFilesForFolder(folder.Id))
                {
                    yield return(file);
                }
            }
        }