@@ -1070,7 +1070,6 @@ def __validate_and_get_atp_rcudbinfo(self, rcu_db_info, check_admin_pwd=False):
10701070 keystore_type = rcu_db_info .get_keystore_type ()
10711071 truststore = rcu_db_info .get_truststore ()
10721072 keystore = rcu_db_info .get_keystore ()
1073-
10741073 if keystore_pwd is None and keystore_type != 'SSO' :
10751074 ex = exception_helper .create_create_exception ('WLSDPLY-12413' ,'javax.net.ssl.keyStorePassword' ,
10761075 "['tns.alias','javax.net.ssl.keyStorePassword',"
@@ -1092,7 +1091,8 @@ def __validate_and_get_atp_rcudbinfo(self, rcu_db_info, check_admin_pwd=False):
10921091 "'rcu_admin_password']" )
10931092 raise ex
10941093
1095- return tns_admin , rcu_database , truststore_pwd , truststore_type , truststore , keystore_pwd , keystore_type , keystore
1094+ return tns_admin , rcu_database , truststore_pwd , truststore_type , truststore , keystore_pwd , keystore_type , \
1095+ keystore
10961096
10971097 def __validate_and_get_ssl_rcudbinfo (self , rcu_db_info , check_admin_pwd = False ):
10981098 """
@@ -1175,45 +1175,8 @@ def __set_rcu_datasource_parameters_without_shadow_table(self, rcu_db_info):
11751175 """
11761176 _method_name = 'set_rcu_datasource_parameters'
11771177
1178- rcu_prefix = rcu_db_info .get_preferred_prefix ()
1179- rcu_schema_pwd = rcu_db_info .get_preferred_schema_pass ()
1180-
1181- if rcu_prefix is None :
1182- ex = exception_helper .create_create_exception ('WLSDPLY-12413' ,'rcu_prefix' ,
1183- "['rcu_prefix','rcu_schema_password']" )
1184- self .logger .throwing (ex , class_name = self .__class_name , method_name = _method_name )
1185- raise ex
1186-
1187- if rcu_schema_pwd is None :
1188- ex = exception_helper .create_create_exception ('WLSDPLY-12413' ,'rcu_schema_password' ,
1189- "['rcu_prefix','rcu_schema_password']" )
1190- self .logger .throwing (ex , class_name = self .__class_name , method_name = _method_name )
1191- raise ex
1192-
1193-
1194- # For ATP databases : we need to set all the property for each datasource
1195- # load atp connection properties from properties file
1196- # HANDLE ATP case
1197- is_atp_ds = rcu_db_info .is_use_atp ()
1198- is_ssl_ds = rcu_db_info .is_use_ssl ()
1199-
1200- if is_atp_ds :
1201- tns_admin , rcu_database , truststore_pwd , truststore_type , \
1202- truststore , keystore_pwd , keystore_type , keystore = self .__validate_and_get_atp_rcudbinfo (rcu_db_info )
1203- elif is_ssl_ds :
1204- tns_admin , rcu_database , truststore_pwd , truststore_type , \
1205- truststore , keystore_pwd , keystore_type , keystore = self .__validate_and_get_ssl_rcudbinfo (rcu_db_info )
1206- else :
1207- rcu_database = rcu_db_info .get_preferred_db ()
1208-
1209- if rcu_database is None :
1210- ex = exception_helper .create_create_exception ('WLSDPLY-12564' )
1211- raise ex
1212-
1213- # Need to set for the connection property for each datasource
1214-
1215- fmw_database = self .wls_helper .get_jdbc_url_from_rcu_connect_string (rcu_database )
1216- self .logger .fine ('WLSDPLY-12221' , fmw_database , class_name = self .__class_name , method_name = _method_name )
1178+ fmw_database , is_atp_ds , is_ssl_ds , keystore , keystore_pwd , keystore_type , rcu_prefix , rcu_schema_pwd , \
1179+ tns_admin , truststore , truststore_pwd , truststore_type = self .get_rcu_basic_connection_info (rcu_db_info )
12171180
12181181 location = LocationContext ()
12191182 location .append_location (JDBC_SYSTEM_RESOURCE )
@@ -1566,3 +1529,110 @@ def __configure_opss_secrets(self):
15661529 self .wlst_helper .set_shared_secret_store_with_password (opss_wallet , opss_secret_password )
15671530
15681531 self .logger .exiting (class_name = self .__class_name , method_name = _method_name )
1532+
1533+ def get_rcu_basic_connection_info (self , rcu_db_info ):
1534+
1535+ _method_name = 'get_rcu_basic_connection_info'
1536+
1537+ keystore = None
1538+ keystore_pwd = None
1539+ keystore_type = None
1540+ tns_admin = None
1541+ truststore = None
1542+ truststore_pwd = None
1543+ truststore_type = None
1544+
1545+ rcu_prefix = rcu_db_info .get_preferred_prefix ()
1546+ rcu_schema_pwd = rcu_db_info .get_preferred_schema_pass ()
1547+ if rcu_prefix is None :
1548+ ex = exception_helper .create_create_exception ('WLSDPLY-12413' , 'rcu_prefix' ,
1549+ "['rcu_prefix','rcu_schema_password']" )
1550+ self .logger .throwing (ex , class_name = self .__class_name , method_name = _method_name )
1551+ raise ex
1552+ if rcu_schema_pwd is None :
1553+ ex = exception_helper .create_create_exception ('WLSDPLY-12413' , 'rcu_schema_password' ,
1554+ "['rcu_prefix','rcu_schema_password']" )
1555+ self .logger .throwing (ex , class_name = self .__class_name , method_name = _method_name )
1556+ raise ex
1557+
1558+ # For ATP databases : we need to set all the property for each datasource
1559+ # load atp connection properties from properties file
1560+ # HANDLE ATP case
1561+
1562+ is_atp_ds = rcu_db_info .is_use_atp ()
1563+ is_ssl_ds = rcu_db_info .is_use_ssl ()
1564+ if is_atp_ds :
1565+ tns_admin , rcu_database , truststore_pwd , truststore_type , \
1566+ truststore , keystore_pwd , keystore_type , keystore = self .__validate_and_get_atp_rcudbinfo (rcu_db_info )
1567+ elif is_ssl_ds :
1568+ tns_admin , rcu_database , truststore_pwd , truststore_type , \
1569+ truststore , keystore_pwd , keystore_type , keystore = self .__validate_and_get_ssl_rcudbinfo (rcu_db_info )
1570+ else :
1571+ rcu_database = rcu_db_info .get_preferred_db ()
1572+ if rcu_database is None :
1573+ ex = exception_helper .create_create_exception ('WLSDPLY-12564' )
1574+ raise ex
1575+
1576+ # Need to set for the connection property for each datasource
1577+ fmw_database = self .wls_helper .get_jdbc_url_from_rcu_connect_string (rcu_database )
1578+ self .logger .fine ('WLSDPLY-12221' , fmw_database , class_name = self .__class_name , method_name = _method_name )
1579+
1580+ return fmw_database , is_atp_ds , is_ssl_ds , keystore , keystore_pwd , keystore_type , rcu_prefix , rcu_schema_pwd , \
1581+ tns_admin , truststore , truststore_pwd , truststore_type
1582+
1583+ def get_ssl_standard_conn_properties (self , tns_admin , truststore , truststore_pwd ,
1584+ truststore_type , keystore_pwd , keystore_type , keystore ):
1585+ properties_set = []
1586+
1587+ # Should always have trust store
1588+ properties_set .append ({DRIVER_PARAMS_TRUSTSTORE_PROPERTY : self .__get_store_path (tns_admin , truststore )})
1589+
1590+ properties_set .append ({DRIVER_PARAMS_TRUSTSTORETYPE_PROPERTY : truststore_type })
1591+
1592+ # if not sso type then user must provide pwd
1593+ if truststore_pwd is not None and truststore_pwd != 'None' :
1594+ properties_set .append ({DRIVER_PARAMS_TRUSTSTOREPWD_PROPERTY : truststore_pwd })
1595+
1596+ if keystore_pwd is not None and keystore_pwd != 'None' :
1597+ properties_set .append ({DRIVER_PARAMS_KEYSTOREPWD_PROPERTY : keystore_pwd })
1598+
1599+ # if it is 2 ways SSL
1600+ if keystore is not None and keystore != 'None' :
1601+ properties_set .append ({DRIVER_PARAMS_KEYSTORE_PROPERTY : self .__get_store_path (tns_admin , keystore )})
1602+
1603+ if keystore_type is not None and keystore_type != 'None' :
1604+ properties_set .append ({DRIVER_PARAMS_KEYSTORETYPE_PROPERTY : keystore_type })
1605+
1606+ return properties_set
1607+
1608+ def get_atp_standard_conn_properties (self , tns_admin , truststore , truststore_pwd ,
1609+ truststore_type , keystore_pwd , keystore_type , keystore ):
1610+
1611+ keystore , keystore_type , truststore , truststore_type = atp_helper .fix_store_type_and_default_value (keystore ,
1612+ keystore_type , truststore , truststore_type )
1613+
1614+ properties_set = []
1615+
1616+ properties_set .append ({DRIVER_PARAMS_KEYSTORE_PROPERTY : self .__get_store_path (tns_admin ,
1617+ keystore )})
1618+
1619+ properties_set .append ({DRIVER_PARAMS_KEYSTORETYPE_PROPERTY : keystore_type })
1620+
1621+ if keystore_pwd :
1622+ properties_set .append ({DRIVER_PARAMS_KEYSTOREPWD_PROPERTY : keystore_pwd })
1623+
1624+ properties_set .append ({DRIVER_PARAMS_TRUSTSTORE_PROPERTY : self .__get_store_path (tns_admin ,
1625+ truststore )})
1626+
1627+ properties_set .append ({DRIVER_PARAMS_TRUSTSTORETYPE_PROPERTY : truststore_type })
1628+
1629+ if truststore_pwd :
1630+ properties_set .append ({DRIVER_PARAMS_TRUSTSTOREPWD_PROPERTY : truststore_pwd })
1631+
1632+ properties_set .append ({DRIVER_PARAMS_NET_SSL_VERSION : DRIVER_PARAMS_NET_SSL_VERSION_VALUE })
1633+
1634+ properties_set .append ({DRIVER_PARAMS_NET_SERVER_DN_MATCH_PROPERTY : 'true' })
1635+ properties_set .append ({DRIVER_PARAMS_NET_TNS_ADMIN : tns_admin })
1636+ properties_set .append ({DRIVER_PARAMS_NET_FAN_ENABLED : 'false' })
1637+
1638+ return properties_set
0 commit comments