internal static void ValidateOrganizationAddition(ITopologyConfigurationSession configSession, OrganizationId organizationId, ExchangeUpgradeBucket exchangeUpgradeBucket, Task.ErrorLoggerDelegate errorLogger)
 {
     if (!exchangeUpgradeBucket.MaxMailboxes.IsUnlimited && !exchangeUpgradeBucket.Organizations.Contains(organizationId.ConfigurationUnit))
     {
         int mailboxCount  = UpgradeBucketTaskHelper.MailboxCountCache.GetMailboxCount(organizationId, configSession);
         int mailboxCount2 = UpgradeBucketTaskHelper.GetMailboxCount(exchangeUpgradeBucket);
         int num           = exchangeUpgradeBucket.MaxMailboxes.Value - mailboxCount2;
         if (mailboxCount > num)
         {
             errorLogger(new RecipientTaskException(Strings.ExchangeUpgradeBucketNotEnoughCapacity(exchangeUpgradeBucket.ToString(), num.ToString(), mailboxCount.ToString())), ExchangeErrorCategory.Client, organizationId);
         }
     }
 }
Example #2
0
 protected override void InternalValidate()
 {
     TaskLogger.LogEnter();
     base.InternalValidate();
     if (this.DataObject.IsChanged(ExchangeUpgradeBucketSchema.MaxMailboxes) && !this.DataObject.MaxMailboxes.IsUnlimited && this.DataObject.Organizations.Count > 0)
     {
         int mailboxCount = UpgradeBucketTaskHelper.GetMailboxCount(this.DataObject);
         if (this.DataObject.MaxMailboxes.Value < mailboxCount)
         {
             base.WriteError(new RecipientTaskException(Strings.ExchangeUpgradeBucketInvalidCapacityValue), ExchangeErrorCategory.Client, this.DataObject);
         }
     }
     TaskLogger.LogExit();
 }
Example #3
0
 protected override void WriteResult(IConfigurable dataObject)
 {
     TaskLogger.LogEnter(new object[]
     {
         dataObject.Identity,
         dataObject
     });
     if (this.EnableMailboxCounting)
     {
         ExchangeUpgradeBucket exchangeUpgradeBucket = (ExchangeUpgradeBucket)dataObject;
         exchangeUpgradeBucket.MailboxCount = UpgradeBucketTaskHelper.GetMailboxCount(exchangeUpgradeBucket);
     }
     base.WriteResult(dataObject);
     TaskLogger.LogExit();
 }