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); }
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)); } }
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; }
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"); } }
internal Builder WithBackupStorage(BackupStorage value) { tempObject.Storage = value; return(this); }
public AzureBlobRecoveryPointStoreBase(Model.BackupStorage backupStorage) { this._storeInformation = backupStorage; }