Beispiel #1
0
        // Token: 0x06001589 RID: 5513 RVA: 0x00055818 File Offset: 0x00053A18
        public static DatabaseVolumeInfo GetInstance(string edbPath, string logPath, string databaseName, string autoDagVolumesRootFolderPath, string autoDagDatabasesRootFolderPath, int autoDagDatabaseCopiesPerVolume)
        {
            Exception          ex = null;
            DatabaseVolumeInfo databaseVolumeInfo = new DatabaseVolumeInfo();
            MountedFolderPath  volumePathName     = MountPointUtil.GetVolumePathName(edbPath, out ex);

            if (ex != null)
            {
                DatabaseVolumeInfo.Tracer.TraceError <string, string, Exception>(0L, "DatabaseVolumeInfo.GetInstance( {0} ): GetVolumePathName() for EDB path '{1}' failed with error: {2}", databaseName, edbPath, ex);
                databaseVolumeInfo.LastException = new DatabaseVolumeInfoInitException(databaseName, ex.Message, ex);
                return(databaseVolumeInfo);
            }
            databaseVolumeInfo.DatabaseVolumeMountPoint = volumePathName;
            MountedFolderPath volumeNameForVolumeMountPoint = MountPointUtil.GetVolumeNameForVolumeMountPoint(volumePathName, out ex);

            if (ex != null)
            {
                DatabaseVolumeInfo.Tracer.TraceError <string, MountedFolderPath, Exception>(0L, "DatabaseVolumeInfo.GetInstance( {0} ): GetVolumeNameForVolumeMountPoint() for EDB mount point '{1}' failed with error: {2}", databaseName, volumePathName, ex);
                databaseVolumeInfo.LastException = new DatabaseVolumeInfoInitException(databaseName, ex.Message, ex);
                return(databaseVolumeInfo);
            }
            databaseVolumeInfo.DatabaseVolumeName = volumeNameForVolumeMountPoint;
            bool isDatabasePathOnMountedFolder = MountPointUtil.IsDirectoryMountPoint(volumePathName.Path, out ex);

            if (ex != null)
            {
                DatabaseVolumeInfo.Tracer.TraceError <string, MountedFolderPath, Exception>(0L, "DatabaseVolumeInfo.GetInstance( {0} ): IsDirectoryMountPoint() for EDB mount point '{1}' failed with error: {2}", databaseName, volumePathName, ex);
                databaseVolumeInfo.LastException = new DatabaseVolumeInfoInitException(databaseName, ex.Message, ex);
                return(databaseVolumeInfo);
            }
            databaseVolumeInfo.IsDatabasePathOnMountedFolder = isDatabasePathOnMountedFolder;
            MountedFolderPath volumePathName2 = MountPointUtil.GetVolumePathName(logPath, out ex);

            if (ex != null)
            {
                DatabaseVolumeInfo.Tracer.TraceError <string, string, Exception>(0L, "DatabaseVolumeInfo.GetInstance( {0} ): GetVolumePathName() for LOG path '{1}' failed with error: {2}", databaseName, logPath, ex);
                databaseVolumeInfo.LastException = new DatabaseVolumeInfoInitException(databaseName, ex.Message, ex);
                return(databaseVolumeInfo);
            }
            databaseVolumeInfo.LogVolumeMountPoint = volumePathName2;
            MountedFolderPath volumeNameForVolumeMountPoint2 = MountPointUtil.GetVolumeNameForVolumeMountPoint(volumePathName2, out ex);

            if (ex != null)
            {
                DatabaseVolumeInfo.Tracer.TraceError <string, MountedFolderPath, Exception>(0L, "DatabaseVolumeInfo.GetInstance( {0} ): GetVolumeNameForVolumeMountPoint() for LOG mount point '{1}' failed with error: {2}", databaseName, volumePathName2, ex);
                databaseVolumeInfo.LastException = new DatabaseVolumeInfoInitException(databaseName, ex.Message, ex);
                return(databaseVolumeInfo);
            }
            databaseVolumeInfo.LogVolumeName = volumeNameForVolumeMountPoint2;
            bool isLogPathOnMountedFolder = MountPointUtil.IsDirectoryMountPoint(volumePathName2.Path, out ex);

            if (ex != null)
            {
                DatabaseVolumeInfo.Tracer.TraceError <string, MountedFolderPath, Exception>(0L, "DatabaseVolumeInfo.GetInstance( {0} ): IsDirectoryMountPoint() for LOG mount point '{1}' failed with error: {2}", databaseName, volumePathName2, ex);
                databaseVolumeInfo.LastException = new DatabaseVolumeInfoInitException(databaseName, ex.Message, ex);
                return(databaseVolumeInfo);
            }
            databaseVolumeInfo.IsLogPathOnMountedFolder = isLogPathOnMountedFolder;
            if (!string.IsNullOrEmpty(autoDagVolumesRootFolderPath) && !string.IsNullOrEmpty(autoDagDatabasesRootFolderPath))
            {
                ExchangeVolume instance = ExchangeVolume.GetInstance(volumeNameForVolumeMountPoint, autoDagVolumesRootFolderPath, autoDagDatabasesRootFolderPath, autoDagDatabaseCopiesPerVolume);
                if (instance.IsValid)
                {
                    databaseVolumeInfo.ExchangeVolumeMountPoint        = (instance.ExchangeVolumeMountPoint ?? MountedFolderPath.Empty);
                    databaseVolumeInfo.IsExchangeVolumeMountPointValid = !MountedFolderPath.IsNullOrEmpty(databaseVolumeInfo.ExchangeVolumeMountPoint);
                }
            }
            databaseVolumeInfo.IsValid = true;
            return(databaseVolumeInfo);
        }
Beispiel #2
0
 // Token: 0x0600158A RID: 5514 RVA: 0x00055A04 File Offset: 0x00053C04
 public static DatabaseVolumeInfo GetInstance(IReplayConfiguration config)
 {
     return(DatabaseVolumeInfo.GetInstance(config.DestinationEdbPath, config.DestinationLogPath, config.DisplayName, config.AutoDagVolumesRootFolderPath, config.AutoDagDatabasesRootFolderPath, config.AutoDagDatabaseCopiesPerVolume));
 }