示例#1
0
        protected internal static BackupStorage FromBackupStorageView(BackupRestoreView.BackupStorage backupStorageView)
        {
            BackupStorage backupStorage = null;

            if (backupStorageView == null)
            {
                throw new ArgumentException("backupStorageView is null, it must be valid instance of BackupStorage.");
            }
            else if (backupStorageView.StorageKind == BackupStorageType.FileShare)
            {
                backupStorage = FileShareBackupStorageInfo.FromfileShareBackupStorageInfoView((BackupRestoreView.FileShareBackupStorageInfo)backupStorageView);
            }
            else if (backupStorageView.StorageKind == BackupStorageType.AzureBlobStore)
            {
                backupStorage = AzureBlobBackupStorageInfo.FromAzureBlobBackupStorageInfoView((BackupRestoreView.AzureBlobBackupStorageInfo)backupStorageView);
            }
            else if (backupStorageView.StorageKind == BackupStorageType.DsmsAzureBlobStore)
            {
                backupStorage = DsmsAzureBlobBackupStorageInfo.FromDsmsAzureBlobBackupStorageInfoView((BackupRestoreView.DsmsAzureBlobBackupStorageInfo)backupStorageView);
            }
            if (backupStorage != null)
            {
                backupStorage.FriendlyName = string.IsNullOrEmpty(backupStorageView.FriendlyName)
                    ? string.Empty
                    : backupStorageView.FriendlyName;
            }
            return(backupStorage);
        }
示例#2
0
 internal bool CompareStorage(BackupStorage backupStorage)
 {
     if (this.BackupStorageType != backupStorage.BackupStorageType)
     {
         return(false);
     }
     else if (this.BackupStorageType == BackupStorageType.FileShare)
     {
         var fileStoreInfo  = (FileShareBackupStorageInfo)this;
         var fileStoreInfo1 = (FileShareBackupStorageInfo)backupStorage;
         return(FileShareBackupStorageInfo.CompareStorage(fileStoreInfo, fileStoreInfo1));
     }
     else if (this.BackupStorageType == BackupStorageType.AzureBlobStore)
     {
         // it means AzureBlobShare
         var azureStoreInfo  = (AzureBlobBackupStorageInfo)this;
         var azureStoreInfo1 = (AzureBlobBackupStorageInfo)backupStorage;
         return(AzureBlobBackupStorageInfo.CompareStorage(azureStoreInfo, azureStoreInfo1));
     }
     else
     {
         // it means AzureBlobShare
         var dsmsazureStoreInfo  = (DsmsAzureBlobBackupStorageInfo)this;
         var dsmsazureStoreInfo1 = (DsmsAzureBlobBackupStorageInfo)backupStorage;
         return(DsmsAzureBlobBackupStorageInfo.CompareStorage(dsmsazureStoreInfo, dsmsazureStoreInfo1));
     }
 }
示例#3
0
 internal RestoreStatus(string fabricUri, BackupStorage backupStorage, Guid restoreRequestGuid, Guid dataLossGuid, List <string> backupLocations, BackupRestoreView.RestorePoint restoreDetails)
 {
     this.FabricUri               = fabricUri;
     this.RestoreRequestGuid      = restoreRequestGuid;
     this.BackupStorage           = backupStorage;
     this.backupLocations         = backupLocations;
     this.DataLossGuid            = dataLossGuid;
     this.RestorePartitionDetails = restoreDetails;
     this.RestoreStatusState      = RestoreState.Accepted;
     this.RestoreDetailsMessage   = string.Empty;
 }
示例#4
0
        internal static BackupPolicy FromBackupPolicyView(BackupRestoreView.BackupPolicy backupPolicyView)
        {
            backupPolicyView.ThrowIfNull("BackupPolicy");
            BackupPolicy backupPolicy = new BackupPolicy
            {
                Name                 = backupPolicyView.Name,
                AutoRestore          = backupPolicyView.AutoRestoreOnDataLoss,
                MaxIncrementalBackup = backupPolicyView.MaxIncrementalBackups,
                BackupSchedule       = BackupSchedule.FromBackupScheduleView(backupPolicyView.Schedule),
                Storage              = BackupStorage.FromBackupStorageView(backupPolicyView.Storage),
                RetentionPolicy      = RetentionPolicy.FromRetentionPolicyView(backupPolicyView.RetentionPolicy)
            };

            return(backupPolicy);
        }
        /// <summary>
        /// Gets the store manager as per the policy
        /// </summary>
        /// <param name="storeInformation">Store information from the backup schedule policy</param>
        /// <returns>Returns IRecoveryPointManager instance</returns>
        public static IRecoveryPointManager GetRecoveryPointManager(Model.BackupStorage storeInformation)
        {
            switch (storeInformation.BackupStorageType)
            {
            case BackupStorageType.AzureBlobStore:
                return(new AzureBlobStoreRecoveryPointManager(storeInformation as Model.AzureBlobBackupStorageInfo));

            case BackupStorageType.DsmsAzureBlobStore:
                return(new DsmsAzureBlobStoreRecoveryPointManager(storeInformation as Model.DsmsAzureBlobBackupStorageInfo));

            case BackupStorageType.FileShare:
                return(new FileShareRecoveryPointManager(storeInformation as Model.FileShareBackupStorageInfo));

            default:
                throw new ArgumentException("StoreType");
            }
        }
示例#6
0
 internal Builder WithBackupStorage(BackupStorage value)
 {
     tempObject.Storage = value;
     return(this);
 }
示例#7
0
 public AzureBlobRecoveryPointStoreBase(Model.BackupStorage backupStorage)
 {
     this._storeInformation = backupStorage;
 }