void IInjectorService.InjectSingleMove(Guid targetDatabase, string batchName, LoadEntity mailbox)
 {
     base.ForwardExceptions(delegate()
     {
         DirectoryReconnectionVisitor visitor = new DirectoryReconnectionVisitor(this.directory, this.Logger);
         mailbox.Accept(visitor);
         this.moveInjector.InjectMoves(targetDatabase, BatchName.FromString(batchName), new LoadEntity[]
         {
             mailbox
         }, false);
     });
 }
 void IInjectorService.InjectMoves(Guid targetDatabase, string batchName, IEnumerable <LoadEntity> mailboxes)
 {
     base.ForwardExceptions(delegate()
     {
         DirectoryReconnectionVisitor visitor = new DirectoryReconnectionVisitor(this.directory, this.Logger);
         IList <LoadEntity> list = (mailboxes as IList <LoadEntity>) ?? mailboxes.ToList <LoadEntity>();
         foreach (LoadEntity loadEntity in list)
         {
             loadEntity.Accept(visitor);
         }
         this.moveInjector.InjectMoves(targetDatabase, BatchName.FromString(batchName), list, false);
     });
 }
        private DirectoryMailbox GetMailboxFromMiniRecipient(LoadBalancingMiniRecipient recipient, Guid organizationId, IPhysicalDatabase physicalDatabaseConnection)
        {
            List <IPhysicalMailbox> physicalMailboxes = new List <IPhysicalMailbox>(2);
            Guid exchangeGuid = recipient.ExchangeGuid;

            if (recipient.Database != null && exchangeGuid != Guid.Empty)
            {
                Guid objectGuid = recipient.Database.ObjectGuid;
                this.AddPhysicalMailboxToList(exchangeGuid, objectGuid, physicalDatabaseConnection, physicalMailboxes, false);
            }
            if (recipient.ArchiveGuid != Guid.Empty && recipient.ArchiveDatabase != null)
            {
                this.AddPhysicalMailboxToList(recipient.ArchiveGuid, recipient.ArchiveDatabase.ObjectGuid, physicalDatabaseConnection, physicalMailboxes, true);
            }
            DirectoryMailbox directoryMailbox;

            if (recipient.RecipientType == RecipientType.MailUser)
            {
                directoryMailbox = new CloudArchive(this, DirectoryIdentity.CreateMailboxIdentity(recipient.Guid, organizationId, DirectoryObjectType.CloudArchive), physicalMailboxes);
            }
            else
            {
                directoryMailbox = new DirectoryMailbox(this, DirectoryIdentity.CreateMailboxIdentity(recipient.Guid, organizationId, DirectoryObjectType.Mailbox), physicalMailboxes, DirectoryMailboxType.Organization);
                if (recipient.propertyBag.Contains(MiniRecipientSchema.ConfigurationXML) && recipient.ConfigXML != null)
                {
                    directoryMailbox.MailboxProvisioningConstraints = recipient.ConfigXML.MailboxProvisioningConstraints;
                }
            }
            if (recipient.MailboxMoveFlags.HasFlag(RequestFlags.IntraOrg) && (recipient.MailboxMoveStatus == RequestStatus.Queued || recipient.MailboxMoveStatus == RequestStatus.InProgress))
            {
                BatchName batchName = BatchName.FromString(recipient.MailboxMoveBatchName);
                if (batchName.IsLoadBalancingBatch)
                {
                    directoryMailbox.IsBeingLoadBalanced = true;
                }
            }
            return(directoryMailbox);
        }
Beispiel #4
0
 public void InjectMoves(Guid targetDatabase, string batchName, IEnumerable <LoadEntity> mailboxes)
 {
     this.moveInjector.InjectMovesOnCompatibilityMode(this.service.GetDatabaseData(targetDatabase, false), BatchName.FromString(batchName), mailboxes, false);
 }