Beispiel #1
0
 // Token: 0x060015AB RID: 5547 RVA: 0x00056414 File Offset: 0x00054614
 public MountedFolderPath GetMostAppropriateMountPoint()
 {
     if (this.IsExchangeVolume && !MountedFolderPath.IsNullOrEmpty(this.ExchangeVolumeMountPoint))
     {
         return(this.ExchangeVolumeMountPoint);
     }
     if (this.MountPoints == null || this.MountPoints.Length == 0)
     {
         return(MountedFolderPath.Empty);
     }
     return(this.MountPoints[0]);
 }
 // Token: 0x0600158D RID: 5517 RVA: 0x00055A40 File Offset: 0x00053C40
 public override int Compare(ExchangeVolume x, ExchangeVolume y)
 {
     if (!x.IsExchangeVolume && !y.IsExchangeVolume)
     {
         MountedFolderPath mostAppropriateMountPoint  = x.GetMostAppropriateMountPoint();
         MountedFolderPath mostAppropriateMountPoint2 = y.GetMostAppropriateMountPoint();
         if (MountedFolderPath.IsNullOrEmpty(mostAppropriateMountPoint) && !MountedFolderPath.IsNullOrEmpty(mostAppropriateMountPoint2))
         {
             return(-1);
         }
         if (!MountedFolderPath.IsNullOrEmpty(mostAppropriateMountPoint) && MountedFolderPath.IsNullOrEmpty(mostAppropriateMountPoint2))
         {
             return(1);
         }
         if (MountedFolderPath.IsNullOrEmpty(mostAppropriateMountPoint) && MountedFolderPath.IsNullOrEmpty(mostAppropriateMountPoint2))
         {
             return(x.VolumeName.CompareTo(y.VolumeName));
         }
         return(mostAppropriateMountPoint.CompareTo(mostAppropriateMountPoint2));
     }
     else if (x.IsExchangeVolume && y.IsExchangeVolume)
     {
         if (x.IsDatabaseMountPointsNullOrEmpty() && !y.IsDatabaseMountPointsNullOrEmpty())
         {
             return(-1);
         }
         if (!x.IsDatabaseMountPointsNullOrEmpty() && y.IsDatabaseMountPointsNullOrEmpty())
         {
             return(1);
         }
         if (x.IsDatabaseMountPointsNullOrEmpty() && y.IsDatabaseMountPointsNullOrEmpty())
         {
             return(x.ExchangeVolumeMountPoint.CompareTo(y.ExchangeVolumeMountPoint));
         }
         return(x.DatabaseMountPoints[0].CompareTo(y.DatabaseMountPoints[0]));
     }
     else
     {
         if (!x.IsExchangeVolume && y.IsExchangeVolume)
         {
             return(-1);
         }
         return(1);
     }
 }
Beispiel #3
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);
        }