19
19
import oracle .weblogic .deploy .util .ScriptRunnerException ;
20
20
import oracle .weblogic .deploy .util .StringUtils ;
21
21
22
+ import org .python .core .PyDictionary ;
23
+ import org .python .core .PyString ;
24
+
22
25
/**
23
26
* This class does all the work to drop and recreate the RCU schemas besed on the domain type definition.
24
27
*/
@@ -44,7 +47,13 @@ public class RCURunner {
44
47
private static final String DB_ROLE = "SYSDBA" ;
45
48
private static final String SCHEMA_PREFIX_SWITCH = "-schemaPrefix" ;
46
49
private static final String COMPONENT_SWITCH = "-component" ;
50
+ private static final String TABLESPACE_SWITCH = "-tablespace" ;
51
+ private static final String TEMPTABLESPACE_SWITCH = "-tempTablespace" ;
47
52
private static final String READ_STDIN_SWITCH = "-f" ;
53
+ private static final String USE_SSL_SWITCH = "-useSSL" ;
54
+ private static final String SERVER_DN_SWITCH = "-serverDN" ;
55
+ private static final String SSLARGS = "-sslArgs" ;
56
+
48
57
private static final String SERVICE_TABLE_COMPONENT = "STB" ;
49
58
private static final String WLS_COMPONENT = "WLS" ;
50
59
private static final String WLS_RUNTIME_COMPONENT = "WLS_RUNTIME" ;
@@ -61,6 +70,7 @@ public class RCURunner {
61
70
private String rcuDb ;
62
71
private String rcuPrefix ;
63
72
private List <String > rcuSchemas ;
73
+ private boolean ATP_DB = false ;
64
74
65
75
/**
66
76
* The constructor.
@@ -87,6 +97,53 @@ public RCURunner(String domainType, String oracleHome, String javaHome, String r
87
97
}
88
98
}
89
99
100
+ /**
101
+ * The constructor.
102
+ *
103
+ * @param domainType the domain type
104
+ * @param oracleHome the ORACLE_HOME location
105
+ * @param javaHome the JAVA_HOME location
106
+ * @throws CreateException if a parameter validation error occurs
107
+ */
108
+ public RCURunner (String domainType , String oracleHome , String javaHome , PyDictionary rcuProperties )
109
+ throws CreateException {
110
+
111
+
112
+ String tnsAdmin = rcuProperties .get (new PyString ("oracle.net.tns_admin" )).toString ();
113
+ String keyStorePassword = rcuProperties .get (new PyString ("javax.net.ssl.keyStorePassword" )).toString ();
114
+ String trustStorePassword = rcuProperties .get (new PyString ("javax.net.ssl.trustStorePassword" )).toString ();
115
+
116
+ StringBuffer sslArgs = new StringBuffer ();
117
+ sslArgs .append ("oracle.net.tns_admin=" );
118
+ sslArgs .append (tnsAdmin );
119
+ sslArgs .append (",oracle.net.ssl_version=1.2" );
120
+ sslArgs .append (",javax.net.ssl.trustStore=" );
121
+ sslArgs .append (tnsAdmin + "/truststore.jks" );
122
+ sslArgs .append ("javax.net.ssl.trustStoreType=JKS" );
123
+ sslArgs .append (",javax.net.ssl.trustStorePassword=" );
124
+ sslArgs .append (trustStorePassword );
125
+ sslArgs .append (",javax.net.ssl.keyStore=" );
126
+ sslArgs .append (tnsAdmin + "/keystore.jks" );
127
+ sslArgs .append (",javax.net.ssl.keyStoreType=JKS" );
128
+ sslArgs .append (",javax.net.ssl.keyStorePassword=" );
129
+ sslArgs .append (keyStorePassword );
130
+ sslArgs .append (",oracle.jdbc.fanEnabled=false" );
131
+ sslArgs .append (",oracle.net.ssl_server_dn_match=true" );
132
+
133
+ ATP_DB = true ;
134
+
135
+ this .oracleHome = validateExistingDirectory (oracleHome , "ORACLE_HOME" );
136
+ this .javaHome = validateExistingDirectory (javaHome , "JAVA_HOME" );
137
+ this .rcuDb = rcuProperties .get (new PyString ("tns.entry" )).toString ();
138
+ this .rcuPrefix = rcuProperties .get (new PyString ("rcu_prefix" )).toString ();
139
+ this .rcuSchemas = validateNonEmptyListOfStrings (rcuSchemas , "rcu_schema_list" );
140
+ if (this .rcuSchemas .contains (SERVICE_TABLE_COMPONENT )) {
141
+ LOGGER .warning ("WLSDPLY-12000" , CLASS , domainType , SERVICE_TABLE_COMPONENT );
142
+ this .rcuSchemas .remove (SERVICE_TABLE_COMPONENT );
143
+ }
144
+ }
145
+
146
+
90
147
/**
91
148
* Run RCU to drop and recreate the RCU schemas.
92
149
*
@@ -146,9 +203,19 @@ public void runRcu(String rcuSysPass, String rcuSchemaPass) throws CreateExcepti
146
203
// Private helper methods //
147
204
///////////////////////////////////////////////////////////////////////////
148
205
206
+ private void addATPEnv (Map <String , String > env ) {
207
+ if (ATP_DB ) {
208
+ env .put ("RCU_SSL_MODE" , "true" );
209
+ env .put ("SKIP_CONNECTSTRING_VALIDATION" , "true" );
210
+ env .put ("RCU_SKIP_PRE_REQS" , "ALL" );
211
+ }
212
+ }
213
+
214
+
149
215
private Map <String , String > getRcuDropEnv () {
150
216
Map <String , String > env = new HashMap <>(1 );
151
217
env .put ("JAVA_HOME" , this .javaHome .getAbsolutePath ());
218
+ addATPEnv (env );
152
219
return env ;
153
220
}
154
221
@@ -203,6 +270,12 @@ private String[] getRcuCreateArgs() {
203
270
for (String rcuSchema : rcuSchemas ) {
204
271
createArgs .add (COMPONENT_SWITCH );
205
272
createArgs .add (rcuSchema );
273
+ if (ATP_DB ) {
274
+ createArgs .add (TABLESPACE_SWITCH );
275
+ createArgs .add ("DATA" );
276
+ createArgs .add (TEMPTABLESPACE_SWITCH );
277
+ createArgs .add ("TEMP" );
278
+ }
206
279
}
207
280
createArgs .add (READ_STDIN_SWITCH );
208
281
0 commit comments