public ADObjectId GetDatabaseForNewConsumerMailbox()
        {
            MailboxProvisioningResult provisioningResult = null;

            this.CallClientFunction <MailboxProvisioningResult>((ILoadBalanceService svc) => provisioningResult = svc.GetLocalDatabaseForProvisioning(new MailboxProvisioningData(ByteQuantifiedSize.Zero, null, null)));
            if (provisioningResult == null)
            {
                return(null);
            }
            provisioningResult.ValidateSelection();
            return(provisioningResult.Database.ADObjectId);
        }
Beispiel #2
0
        public virtual void InjectMoveForMailbox(DirectoryMailbox mailbox, BatchName batchName)
        {
            if (LoadBalanceADSettings.Instance.Value.UseDatabaseSelectorForMoveInjection)
            {
                LoadEntity loadEntity = this.serviceContext.GetTopologyExtractorFactoryContext().GetEntitySelectorFactory().GetExtractor(mailbox).ExtractEntity();
                MailboxProvisioningResult database = this.databaseSelector.GetDatabase(new MailboxProvisioningData(mailbox.PhysicalSize, mailbox.MailboxProvisioningConstraints, loadEntity.ConsumedLoad));
                database.ValidateSelection();
                DirectoryIdentity database2 = database.Database;
                DirectoryDatabase database3 = (DirectoryDatabase)this.directoryProvider.GetDirectoryObject(database2);
                using (IInjectorService injectorClientForDatabase = this.clientFactory.GetInjectorClientForDatabase(database3))
                {
                    injectorClientForDatabase.InjectSingleMove(database2.Guid, batchName.ToString(), new LoadEntity(mailbox));
                    return;
                }
            }
            IRequest request = mailbox.CreateRequestToMove(null, batchName.ToString(), this.logger);

            this.queueManager.MainProcessingQueue.EnqueueRequest(request);
        }