Ejemplo n.º 1
0
        private void ValidateSourcePublicFolderDatabase(MigrationJob job)
        {
            if (job.MigrationType != MigrationType.PublicFolder || job.JobDirection != MigrationBatchDirection.Local)
            {
                base.WriteError(new MigrationPermanentException(Strings.ErrorInvalidBatchParameter("SourcePublicFolderDatabase", job.MigrationType.ToString(), job.JobDirection.ToString())));
            }
            PublicFolderDatabase publicFolderDatabase = (PublicFolderDatabase)base.GetDataObject <PublicFolderDatabase>(this.SourcePublicFolderDatabase, this.ConfigurationSession, null, new LocalizedString?(Strings.ErrorDatabaseNotFound(this.SourcePublicFolderDatabase.ToString())), new LocalizedString?(Strings.ErrorDatabaseNotUnique(this.SourcePublicFolderDatabase.ToString())));

            using (IMailbox mailbox = PublicFolderEndpoint.ConnectToLocalSourceDatabase(publicFolderDatabase.ExchangeObjectId))
            {
                mailbox.Disconnect();
            }
        }