Exemplo n.º 1
0
        private void AddPhysicalMailboxToList(Guid mailboxGuid, Guid databaseGuid, IPhysicalDatabase physicalDatabaseConnection, List <IPhysicalMailbox> physicalMailboxes, bool isArchive)
        {
            IPhysicalMailbox physicalMailbox = null;

            if (physicalDatabaseConnection == null)
            {
                physicalMailbox = new VirtualPhysicalMailbox(this.clientFactory, this.GetDatabase(databaseGuid), mailboxGuid, this.logger, isArchive);
            }
            else if (physicalDatabaseConnection.DatabaseGuid == databaseGuid)
            {
                physicalMailbox = physicalDatabaseConnection.GetMailbox(mailboxGuid);
            }
            if (physicalMailbox != null)
            {
                physicalMailboxes.Add(physicalMailbox);
            }
        }
        private IPhysicalMailbox LoadMailboxData()
        {
            IPhysicalMailbox result;

            using (OperationTracker.Create(this.logger, "Retrieving single mailbox {0} data from database {1}", new object[]
            {
                this.Guid,
                this.database.Identity
            }))
            {
                using (IPhysicalDatabase physicalDatabaseConnection = this.clientFactory.GetPhysicalDatabaseConnection(this.database))
                {
                    result = (physicalDatabaseConnection.GetMailbox(this.Guid) ?? EmptyPhysicalMailbox.Instance);
                }
            }
            return(result);
        }