4
4
package com .oracle .cloud .spring .adb ;
5
5
6
6
import com .oracle .bmc .database .DatabaseClient ;
7
+ import com .oracle .bmc .database .model .*;
8
+ import com .oracle .bmc .database .responses .*;
9
+ import com .oracle .bmc .database .requests .*;
7
10
8
11
/**
9
12
* Implementation for the OCI Autonomous Database module.
@@ -16,4 +19,78 @@ public AutonomousDatabaseImpl(DatabaseClient client) {
16
19
this .client = client ;
17
20
}
18
21
22
+ /**
23
+ * Direct instance of OCI Java SDK DatabaseClient.
24
+ * @return DatabaseClient
25
+ */
26
+ public DatabaseClient getDatatbaseClient () {
27
+ return client ;
28
+ }
29
+
30
+ /**
31
+ * Create an Autonomous Database.
32
+ *
33
+ * @param databaseName Name of the Autonomous Database to be created
34
+ * @param compartmentId Compartment OCID where the Autonomous Database needs to be created
35
+ * @return CreateAutonomousDatabaseResponse
36
+ */
37
+ public CreateAutonomousDatabaseResponse createAutonomousDatabase (String databaseName , String compartmentId ) {
38
+ return null ;
39
+ }
40
+
41
+ /**
42
+ * Get details of an Autonomous Database.
43
+ *
44
+ * @param databaseId OCID of the Autonomous Database to get details of
45
+ * @return GetAutonomousDatabaseResponse
46
+ */
47
+ public GetAutonomousDatabaseResponse getAutonomousDatabase (String databaseId ) {
48
+ GetAutonomousDatabaseRequest getAutonomousDatabaseRequest = GetAutonomousDatabaseRequest .builder ()
49
+ .autonomousDatabaseId (databaseId )
50
+ .build ();
51
+
52
+ GetAutonomousDatabaseResponse response = client .getAutonomousDatabase (getAutonomousDatabaseRequest );
53
+
54
+ return response ;
55
+ }
56
+
57
+ /**
58
+ * Generate a wallet for an Autonomous Database.
59
+ *
60
+ * @param databaseId OCID of the Autonomous Database to get generate a wallet for
61
+ * @param password Password for the wallet
62
+ * @return GenerateAutonomousDatabaseWalletResponse
63
+ */
64
+ public GenerateAutonomousDatabaseWalletResponse generateAutonomousDatabaseWallet (String databaseId , String password ) {
65
+ GenerateAutonomousDatabaseWalletDetails generateAutonomousDatabaseWalletDetails = GenerateAutonomousDatabaseWalletDetails .builder ()
66
+ .generateType (GenerateAutonomousDatabaseWalletDetails .GenerateType .All )
67
+ .password (password )
68
+ .isRegional (true ).build ();
69
+
70
+ GenerateAutonomousDatabaseWalletRequest generateAutonomousDatabaseWalletRequest = GenerateAutonomousDatabaseWalletRequest .builder ()
71
+ .autonomousDatabaseId (databaseId )
72
+ .generateAutonomousDatabaseWalletDetails (generateAutonomousDatabaseWalletDetails )
73
+ .build ();
74
+
75
+ GenerateAutonomousDatabaseWalletResponse response = client .generateAutonomousDatabaseWallet (generateAutonomousDatabaseWalletRequest );
76
+
77
+ return response ;
78
+ }
79
+
80
+ /**
81
+ * Delete an Autonomous Database.
82
+ *
83
+ * @param databaseId OCID of the Autonomous Database to be deleted
84
+ * @return DeleteAutonomousDatabaseResponse
85
+ */
86
+ public DeleteAutonomousDatabaseResponse deleteAutonomousDatabase (String databaseId ) {
87
+ DeleteAutonomousDatabaseRequest deleteAutonomousDatabaseRequest = DeleteAutonomousDatabaseRequest .builder ()
88
+ .autonomousDatabaseId (databaseId )
89
+ .build ();
90
+
91
+ DeleteAutonomousDatabaseResponse response = client .deleteAutonomousDatabase (deleteAutonomousDatabaseRequest );
92
+
93
+ return response ;
94
+ }
95
+
19
96
}
0 commit comments