forked from oracle/oci-java-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBackupDestinationHelper.java
More file actions
52 lines (48 loc) · 2.32 KB
/
BackupDestinationHelper.java
File metadata and controls
52 lines (48 loc) · 2.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/**
* Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
* This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
*/
import com.oracle.bmc.database.model.BackupDestinationDetails;
public class BackupDestinationHelper {
public static BackupDestinationDetails backupDestinationDetailsCreater(
String type, String backupdestinationOcid, String vpcUser, String vpcPassword)
throws Exception {
BackupDestinationDetails backupDestinationDetails = null;
switch (type) {
case "ZDLRA":
backupDestinationDetails =
BackupDestinationDetails.builder()
.id(backupdestinationOcid)
.type(BackupDestinationDetails.Type.RecoveryAppliance)
.vpcUser(vpcUser)
.vpcPassword(vpcPassword)
.build();
break;
case "NFS":
backupDestinationDetails =
BackupDestinationDetails.builder()
.id(backupdestinationOcid)
.type(BackupDestinationDetails.Type.Nfs)
.build();
break;
case "ObjectStorage":
backupDestinationDetails =
BackupDestinationDetails.builder()
.id(backupdestinationOcid)
.type(BackupDestinationDetails.Type.ObjectStore)
.build();
break;
case "Local":
backupDestinationDetails =
BackupDestinationDetails.builder()
.id(backupdestinationOcid)
.type(BackupDestinationDetails.Type.Local)
.build();
break;
default:
throw new Exception(
"Enter a valid type value from NFS, ZDLRA, Local, ObjectStorage");
}
return backupDestinationDetails;
}
}