1313from wlsdeploy .aliases .model_constants import CLUSTER
1414from wlsdeploy .aliases .model_constants import DEFAULT_ADMIN_SERVER_NAME
1515from wlsdeploy .aliases .model_constants import DEFAULT_WLS_DOMAIN_NAME
16- from wlsdeploy .aliases .model_constants import DOMAIN_LIBRARIES
1716from wlsdeploy .aliases .model_constants import DOMAIN_NAME
1817from wlsdeploy .aliases .model_constants import DRIVER_NAME
1918from wlsdeploy .aliases .model_constants import DRIVER_PARAMS_PROPERTY_VALUE
5049from wlsdeploy .tool .create .security_provider_creator import SecurityProviderCreator
5150from wlsdeploy .tool .deploy import model_deployer
5251from wlsdeploy .tool .util .archive_helper import ArchiveHelper
52+ from wlsdeploy .tool .util .library_helper import LibraryHelper
5353from wlsdeploy .tool .util .topology_helper import TopologyHelper
5454from wlsdeploy .util import dictionary_utils
5555from wlsdeploy .util import model as model_helper
@@ -66,10 +66,6 @@ def __init__(self, model_dictionary, model_context, aliases):
6666 _method_name = '__init__'
6767 Creator .__init__ (self , model_dictionary , model_context , aliases )
6868
69- self .topology_helper = TopologyHelper (self .aliases , ExceptionType .CREATE , self .logger )
70- self .security_provider_creator = SecurityProviderCreator (model_dictionary , model_context , aliases ,
71- ExceptionType .CREATE , self .logger )
72-
7369 # domainInfo section is required to get the admin password, everything else
7470 # is optional and will use the template defaults
7571 if model_helper .get_model_domain_info_key () not in model_dictionary :
@@ -79,6 +75,10 @@ def __init__(self, model_dictionary, model_context, aliases):
7975 self .logger .throwing (ex , class_name = self .__class_name , method_name = _method_name )
8076 raise ex
8177
78+ self .topology_helper = TopologyHelper (self .aliases , ExceptionType .CREATE , self .logger )
79+ self .security_provider_creator = SecurityProviderCreator (model_dictionary , model_context , aliases ,
80+ ExceptionType .CREATE , self .logger )
81+
8282 self ._domain_typedef = self .model_context .get_domain_typedef ()
8383 self ._topology = self .model .get_model_topology ()
8484 self ._domain_info = self .model .get_model_domain_info ()
@@ -102,6 +102,10 @@ def __init__(self, model_dictionary, model_context, aliases):
102102 if archive_file_name is not None :
103103 self .archive_helper = ArchiveHelper (archive_file_name , self ._domain_home , self .logger ,
104104 exception_helper .ExceptionType .CREATE )
105+
106+ self .library_helper = LibraryHelper (self .model , self .model_context , self .aliases , self ._domain_home ,
107+ ExceptionType .CREATE , self .logger )
108+
105109 #
106110 # Creating domains with the wls.jar template is busted for pre-12.1.2 domains with regards to the
107111 # names of the default authentication providers (both the DefaultAuthenticator and the
@@ -227,8 +231,8 @@ def __create_domain(self):
227231 for file_to_extract in self .files_to_extract_from_archive :
228232 self .archive_helper .extract_file (file_to_extract )
229233
230- self .__install_domain_libraries ( self . _domain_home )
231- self .__extract_classpath_libraries ( self . _domain_home )
234+ self .library_helper . install_domain_libraries ( )
235+ self .library_helper . extract_classpath_libraries ( )
232236 self .logger .exiting (class_name = self .__class_name , method_name = _method_name )
233237 return
234238
@@ -350,55 +354,6 @@ def __create_domain_with_select_template(self, domain_home):
350354 self .logger .exiting (class_name = self .__class_name , method_name = _method_name )
351355 return
352356
353- def __install_domain_libraries (self , domain_home ):
354- """
355- Extract the domain libraries listed in the model, if any, to the <DOMAIN_HOME>/lib directory.
356- :param domain_home: the domain home directory
357- :raises: CreateException: if an error occurs
358- """
359- _method_name = '__install_domain_libraries'
360-
361- self .logger .entering (domain_home , class_name = self .__class_name , method_name = _method_name )
362- domain_info_dict = self .model .get_model_domain_info ()
363- if DOMAIN_LIBRARIES not in domain_info_dict or len (domain_info_dict [DOMAIN_LIBRARIES ]) == 0 :
364- self .logger .info ('WLSDPLY-12213' , class_name = self .__class_name , method_name = _method_name )
365- else :
366- domain_libs = dictionary_utils .get_dictionary_element (domain_info_dict , DOMAIN_LIBRARIES )
367- if self .archive_helper is None :
368- ex = exception_helper .create_create_exception ('WLSDPLY-12214' , domain_libs )
369- self .logger .throwing (ex , class_name = self .__class_name , method_name = _method_name )
370- raise ex
371-
372- for domain_lib in domain_libs :
373- self .logger .info ('WLSDPLY-12215' , domain_lib , domain_home ,
374- class_name = self .__class_name , method_name = _method_name )
375- self .archive_helper .extract_domain_library (domain_lib )
376-
377- self .logger .exiting (class_name = self .__class_name , method_name = _method_name )
378- return
379-
380- def __extract_classpath_libraries (self , domain_home ):
381- """
382- Extract any classpath libraries in the archive to the domain home.
383- :param domain_home: the domain home directory
384- :raises: CreateException: if an error occurs
385- """
386- _method_name = '__extract_classpath_libraries'
387-
388- self .logger .entering (domain_home , class_name = self .__class_name , method_name = _method_name )
389- if self .archive_helper is None :
390- self .logger .info ('WLSDPLY-12216' , class_name = self .__class_name , method_name = _method_name )
391- else :
392- num_cp_libs = self .archive_helper .extract_classpath_libraries ()
393- if num_cp_libs > 0 :
394- self .logger .info ('WLSDPLY-12217' , num_cp_libs , domain_home ,
395- class_name = self .__class_name , method_name = _method_name )
396- else :
397- self .logger .info ('WLSDPLY-12218' , self .model_context .get_archive_file_name (),
398- class_name = self .__class_name , method_name = _method_name )
399- self .logger .exiting (class_name = self .__class_name , method_name = _method_name )
400- return
401-
402357 def __apply_base_domain_config (self , topology_folder_list ):
403358 """
404359 Apply the base domain configuration from the model topology section.
0 commit comments