1313from wlsdeploy .aliases .location_context import LocationContext
1414from wlsdeploy .aliases .model_constants import ADMIN_PASSWORD
1515from wlsdeploy .aliases .model_constants import ADMIN_USERNAME
16- from wlsdeploy .aliases .model_constants import ATP_DEFAULT_TABLESPACE
17- from wlsdeploy .aliases .model_constants import ATP_TEMPORARY_TABLESPACE
1816from wlsdeploy .aliases .model_constants import DATABASE_TYPE
1917from wlsdeploy .aliases .model_constants import DEFAULT_REALM
2018from wlsdeploy .aliases .model_constants import DOMAIN_INFO
2119from wlsdeploy .aliases .model_constants import DOMAIN_INFO_ALIAS
20+ from wlsdeploy .aliases .model_constants import DRIVER_PARAMS_KEYSTOREPWD_PROPERTY
21+ from wlsdeploy .aliases .model_constants import DRIVER_PARAMS_KEYSTORETYPE_PROPERTY
22+ from wlsdeploy .aliases .model_constants import DRIVER_PARAMS_KEYSTORE_PROPERTY
2223from wlsdeploy .aliases .model_constants import DRIVER_PARAMS_NET_TNS_ADMIN
24+ from wlsdeploy .aliases .model_constants import DRIVER_PARAMS_TRUSTSTOREPWD_PROPERTY
25+ from wlsdeploy .aliases .model_constants import DRIVER_PARAMS_TRUSTSTORETYPE_PROPERTY
26+ from wlsdeploy .aliases .model_constants import DRIVER_PARAMS_TRUSTSTORE_PROPERTY
2327from wlsdeploy .aliases .model_constants import ORACLE_DATABASE_CONNECTION_TYPE
2428from wlsdeploy .aliases .model_constants import PASSWORD
2529from wlsdeploy .aliases .model_constants import PASSWORD_VALIDATOR
2630from wlsdeploy .aliases .model_constants import RCU_ADMIN_PASSWORD
2731from wlsdeploy .aliases .model_constants import RCU_DATABASE_TYPE
2832from wlsdeploy .aliases .model_constants import RCU_DB_CONN_STRING
2933from wlsdeploy .aliases .model_constants import RCU_DB_INFO
30- from wlsdeploy .aliases .model_constants import RCU_DEFAULT_TABLESPACE
3134from wlsdeploy .aliases .model_constants import RCU_PREFIX
3235from wlsdeploy .aliases .model_constants import RCU_SCHEMA_PASSWORD
33- from wlsdeploy .aliases .model_constants import RCU_TEMP_TBLSPACE
3436from wlsdeploy .aliases .model_constants import REALM
3537from wlsdeploy .aliases .model_constants import SECURITY
3638from wlsdeploy .aliases .model_constants import SECURITY_CONFIGURATION
39+ from wlsdeploy .aliases .model_constants import STORE_TYPE_SSO
3740from wlsdeploy .aliases .model_constants import SYSTEM_PASSWORD_VALIDATOR
3841from wlsdeploy .aliases .model_constants import TNS_ENTRY
3942from wlsdeploy .aliases .model_constants import TOPOLOGY
4346from wlsdeploy .tool .validate .content_validator import ContentValidator
4447from wlsdeploy .util import dictionary_utils
4548
46- ALL_DB_TYPES = [
47- RCURunner .ORACLE_DB_TYPE ,
48- RCURunner .EBR_DB_TYPE ,
49- RCURunner .SQLSERVER_DB_TYPE ,
50- RCURunner .DB2_DB_TYPE ,
51- RCURunner .MYSQL_DB_TYPE
52- ]
53-
5449ORACLE_DB_TYPES = [
5550 RCURunner .ORACLE_DB_TYPE ,
5651 RCURunner .EBR_DB_TYPE
5752]
5853
59- ORACLE_DB_CONNECTION_TYPES = [
54+ ORACLE_DB_SSL_CONNECTION_TYPES = [
6055 RCURunner .ORACLE_ATP_DB_TYPE ,
6156 RCURunner .ORACLE_SSL_DB_TYPE
6257]
6358
64- DEPRECATED_DB_TYPES = [
65- RCURunner .ORACLE_DB_TYPE ,
66- RCURunner .ORACLE_ATP_DB_TYPE ,
67- RCURunner .ORACLE_SSL_DB_TYPE
68- ]
6959
7060class CreateDomainContentValidator (ContentValidator ):
7161 """
@@ -114,6 +104,10 @@ def __validate_rcu_db_info_section(self, info_dict):
114104 _method_name = '__validate_rcu_db_info_section'
115105 self ._logger .entering (class_name = self ._class_name , method_name = _method_name )
116106
107+ # This method validates fields that can only be checked in a merged model.
108+ # Simple checks that apply to an unmerged model, such as deprecations and value ranges,
109+ # are done in domain_info_validator.py .
110+
117111 if not self ._model_context .get_domain_typedef ().requires_rcu ():
118112 return
119113
@@ -129,31 +123,21 @@ def __validate_rcu_db_info_section(self, info_dict):
129123
130124 self .__validate_rcu_connection_string (info_dict )
131125
132- # deprecated fields
133- self ._check_deprecated_field (DATABASE_TYPE , info_dict , RCU_DB_INFO , ORACLE_DATABASE_CONNECTION_TYPE )
134- self ._check_deprecated_field (ATP_DEFAULT_TABLESPACE , info_dict , RCU_DB_INFO , RCU_DEFAULT_TABLESPACE )
135- self ._check_deprecated_field (ATP_TEMPORARY_TABLESPACE , info_dict , RCU_DB_INFO , RCU_TEMP_TBLSPACE )
136-
137- # deprecated DATABASE_TYPE, must be ORACLE, ATP, or SSL if specified
138- old_database_type = dictionary_utils .get_element (info_dict , DATABASE_TYPE )
139- if old_database_type and old_database_type not in DEPRECATED_DB_TYPES :
140- self ._logger .severe (
141- 'WLSDPLY-05302' , old_database_type , RCU_DB_INFO , DATABASE_TYPE ,
142- ', ' .join (DEPRECATED_DB_TYPES ), class_name = self ._class_name , method_name = _method_name )
126+ # ATP and SSL connection types must have TRUSTSTORE
127+ for field in [ORACLE_DATABASE_CONNECTION_TYPE , DATABASE_TYPE ]:
128+ connection_type = dictionary_utils .get_element (info_dict , field )
129+ if connection_type and connection_type in ORACLE_DB_SSL_CONNECTION_TYPES :
130+ truststore = dictionary_utils .get_element (info_dict , DRIVER_PARAMS_TRUSTSTORE_PROPERTY )
131+ if not truststore :
132+ self ._logger .severe (
133+ 'WLSDPLY-05308' , field , connection_type , RCU_DB_INFO ,
134+ DRIVER_PARAMS_TRUSTSTORE_PROPERTY , class_name = self ._class_name , method_name = _method_name )
143135
144- # RCU_DATABASE_TYPE must be one of allowed types if specified
145- database_type = dictionary_utils .get_element (info_dict , RCU_DATABASE_TYPE )
146- if database_type and database_type not in ALL_DB_TYPES :
147- self ._logger .severe (
148- 'WLSDPLY-05302' , database_type , RCU_DB_INFO , RCU_DATABASE_TYPE ,
149- ', ' .join (ALL_DB_TYPES ), class_name = self ._class_name , method_name = _method_name )
136+ self .__validate_store_property (DRIVER_PARAMS_TRUSTSTORE_PROPERTY , DRIVER_PARAMS_TRUSTSTORETYPE_PROPERTY ,
137+ DRIVER_PARAMS_TRUSTSTOREPWD_PROPERTY , info_dict )
150138
151- # ORACLE_DATABASE_CONNECTION_TYPE must be one of allowed types if specified
152- connection_type = dictionary_utils .get_element (info_dict , ORACLE_DATABASE_CONNECTION_TYPE )
153- if connection_type and connection_type not in ORACLE_DB_CONNECTION_TYPES :
154- self ._logger .severe (
155- 'WLSDPLY-05302' , connection_type , RCU_DB_INFO , ORACLE_DATABASE_CONNECTION_TYPE ,
156- ', ' .join (ORACLE_DB_CONNECTION_TYPES ), class_name = self ._class_name , method_name = _method_name )
139+ self .__validate_store_property (DRIVER_PARAMS_KEYSTORE_PROPERTY , DRIVER_PARAMS_KEYSTORETYPE_PROPERTY ,
140+ DRIVER_PARAMS_KEYSTOREPWD_PROPERTY , info_dict )
157141
158142 if self ._model_context .is_run_rcu ():
159143 admin_password = dictionary_utils .get_element (info_dict , RCU_ADMIN_PASSWORD )
@@ -189,6 +173,22 @@ def __validate_rcu_connection_string(self, rcu_info_dict):
189173 'WLSDPLY-05301' , RCU_DB_INFO , RCU_DB_CONN_STRING , RCURunner .ORACLE_DB_TYPE ,
190174 class_name = self ._class_name , method_name = _method_name )
191175
176+ def __validate_store_property (self , store_property , type_property , pwd_property , rcu_info_dict ):
177+ _method_name = '__validate_store_property'
178+ store_value = dictionary_utils .get_element (rcu_info_dict , store_property )
179+ if store_value :
180+ type_value = dictionary_utils .get_element (rcu_info_dict , type_property )
181+ if not type_value :
182+ self ._logger .severe (
183+ 'WLSDPLY-05310' , RCU_DB_INFO , type_property , store_property ,
184+ class_name = self ._class_name , method_name = _method_name )
185+
186+ elif type_value .upper () != STORE_TYPE_SSO :
187+ # types other than store must have password
188+ if not dictionary_utils .get_element (rcu_info_dict , pwd_property ):
189+ self ._logger .severe (
190+ 'WLSDPLY-05309' , RCU_DB_INFO , pwd_property , type_property , type_value ,
191+ class_name = self ._class_name , method_name = _method_name )
192192
193193 def __has_tns_path (self , rcu_info_dict ):
194194 """
@@ -363,13 +363,6 @@ def _get_users_dictionary(self, model_dict):
363363 self ._logger .exiting (class_name = self ._class_name , method_name = _method_name )
364364 return users_folder
365365
366- def _check_deprecated_field (self , field_name , info_dict , folder_name , new_field_name ):
367- _method_name = '_check_deprecated_field'
368- if dictionary_utils .get_element (info_dict , field_name ):
369- self ._logger .deprecation (
370- 'WLSDPLY-05303' , folder_name , field_name , new_field_name ,
371- class_name = self ._class_name , method_name = _method_name )
372-
373366
374367def _get_system_password_validator_location ():
375368 location = LocationContext ()
0 commit comments