Example #1
0
 // Token: 0x06001008 RID: 4104 RVA: 0x0005D9CC File Offset: 0x0005BBCC
 protected override DirectoryProcessorBaseTaskContext DoChunkWork(DirectoryProcessorBaseTaskContext context, RecipientType recipientType)
 {
     try
     {
         if (!(context is ADCrawlerTaskContext))
         {
             ADCrawlerTaskContext adcrawlerTaskContext = new ADCrawlerTaskContext(context.MailboxData, context.Job, context.TaskQueue, context.Step, context.TaskStatus, context.RunData, context.DeferredFinalizeTasks);
             this.Initialize(recipientType);
             base.Logger.TraceDebug(this, "First time ADCrawler.DoChunkWork is called. ", new object[0]);
         }
         this.DownloadRecipients(base.RunData.RunFolderPath);
     }
     catch (Exception obj)
     {
         UmGlobals.ExEvent.LogEvent(UMEventLogConstants.Tuple_CopyADToFileFailed, null, new object[]
         {
             this.ADEntriesFileName,
             base.TenantId,
             base.RunId,
             CommonUtil.ToEventLogString(obj)
         });
         if (recipientType != RecipientType.User)
         {
             if (recipientType == RecipientType.Group)
             {
                 context.TaskStatus |= TaskStatus.DLADCrawlerFailed;
             }
             else
             {
                 ExAssert.RetailAssert(false, "Unsupported type. ");
             }
         }
         else
         {
             context.TaskStatus |= TaskStatus.UserADCrawlerFailed;
         }
         throw;
     }
     if (recipientType == RecipientType.User)
     {
         OrgMailboxScaleOutHelper orgMailboxScaleOutHelper = new OrgMailboxScaleOutHelper(base.RunData, base.Logger);
         orgMailboxScaleOutHelper.CheckScaleRequirements();
     }
     return(null);
 }
 // Token: 0x060010DC RID: 4316 RVA: 0x0006299C File Offset: 0x00060B9C
 public void CheckScaleRequirements()
 {
     this.Logger.TraceDebug(this, "Entering CheckScaleRequirements", new object[0]);
     if (VariantConfiguration.InvariantNoFlightingSnapshot.MailboxAssistants.OrgMailboxCheckScaleRequirements.Enabled)
     {
         try
         {
             IADRecipientLookup iadrecipientLookup = ADRecipientLookupFactory.CreateFromOrganizationId(this.OrgId, null, null, false);
             ADUser             aduser             = iadrecipientLookup.LookupByExchangeGuid(this.RunData.MailboxGuid) as ADUser;
             if (aduser != null && aduser.PersistedCapabilities.Contains((Capability)this.CapabilityRequiringScaling))
             {
                 if (OrgMailboxScaleOutHelper.IsFactoryDefaultMailbox(aduser.Name))
                 {
                     this.Logger.TraceDebug(this, "CheckOrgMailboxScaleRequirements - Checking tenant size, mailbox='{0}'", new object[]
                     {
                         aduser.Name
                     });
                     int mailboxCount  = 0;
                     int contactCount  = 0;
                     int mailUserCount = 0;
                     this.GetTenantRecipientCount(out mailboxCount, out contactCount, out mailUserCount);
                     int organizationMailboxCount = this.GetOrganizationMailboxCount();
                     this.Logger.TraceDebug(this, "CheckOrgMailboxScaleRequirements - Scale out threshold='{0}'", new object[]
                     {
                         OrgMailboxScaleOutHelper.scaleOutThreshold
                     });
                     bool shouldCapabilityExist = this.ShouldStampScaleOutCapability(mailboxCount, contactCount, mailUserCount, organizationMailboxCount, OrgMailboxScaleOutHelper.scaleOutThreshold);
                     this.UpdateOrganizationScaleOutCapability(aduser, shouldCapabilityExist);
                 }
                 this.UpdateOrganizationMailboxCapabilities(aduser);
             }
         }
         catch (LocalizedException obj)
         {
             UmGlobals.ExEvent.LogEvent(UMEventLogConstants.Tuple_SetScaleOutCapabilityFailed, null, new object[]
             {
                 this.RunData.TenantId,
                 this.RunData.MailboxGuid,
                 this.RunData.RunId,
                 CommonUtil.ToEventLogString(obj)
             });
         }
     }
     this.Logger.TraceDebug(this, "Exiting CheckScaleRequirements", new object[0]);
 }