13
13
from wlsdeploy .aliases .model_constants import CLUSTER
14
14
from wlsdeploy .aliases .model_constants import DEFAULT_ADMIN_SERVER_NAME
15
15
from wlsdeploy .aliases .model_constants import DEFAULT_WLS_DOMAIN_NAME
16
- from wlsdeploy .aliases .model_constants import DOMAIN_LIBRARIES
17
16
from wlsdeploy .aliases .model_constants import DOMAIN_NAME
18
17
from wlsdeploy .aliases .model_constants import DRIVER_NAME
19
18
from wlsdeploy .aliases .model_constants import DRIVER_PARAMS_PROPERTY_VALUE
50
49
from wlsdeploy .tool .create .security_provider_creator import SecurityProviderCreator
51
50
from wlsdeploy .tool .deploy import model_deployer
52
51
from wlsdeploy .tool .util .archive_helper import ArchiveHelper
52
+ from wlsdeploy .tool .util .library_helper import LibraryHelper
53
53
from wlsdeploy .tool .util .topology_helper import TopologyHelper
54
54
from wlsdeploy .util import dictionary_utils
55
55
from wlsdeploy .util import model as model_helper
@@ -66,10 +66,6 @@ def __init__(self, model_dictionary, model_context, aliases):
66
66
_method_name = '__init__'
67
67
Creator .__init__ (self , model_dictionary , model_context , aliases )
68
68
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
-
73
69
# domainInfo section is required to get the admin password, everything else
74
70
# is optional and will use the template defaults
75
71
if model_helper .get_model_domain_info_key () not in model_dictionary :
@@ -79,6 +75,10 @@ def __init__(self, model_dictionary, model_context, aliases):
79
75
self .logger .throwing (ex , class_name = self .__class_name , method_name = _method_name )
80
76
raise ex
81
77
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
+
82
82
self ._domain_typedef = self .model_context .get_domain_typedef ()
83
83
self ._topology = self .model .get_model_topology ()
84
84
self ._domain_info = self .model .get_model_domain_info ()
@@ -102,6 +102,10 @@ def __init__(self, model_dictionary, model_context, aliases):
102
102
if archive_file_name is not None :
103
103
self .archive_helper = ArchiveHelper (archive_file_name , self ._domain_home , self .logger ,
104
104
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
+
105
109
#
106
110
# Creating domains with the wls.jar template is busted for pre-12.1.2 domains with regards to the
107
111
# names of the default authentication providers (both the DefaultAuthenticator and the
@@ -227,8 +231,8 @@ def __create_domain(self):
227
231
for file_to_extract in self .files_to_extract_from_archive :
228
232
self .archive_helper .extract_file (file_to_extract )
229
233
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 ( )
232
236
self .logger .exiting (class_name = self .__class_name , method_name = _method_name )
233
237
return
234
238
@@ -350,55 +354,6 @@ def __create_domain_with_select_template(self, domain_home):
350
354
self .logger .exiting (class_name = self .__class_name , method_name = _method_name )
351
355
return
352
356
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
-
402
357
def __apply_base_domain_config (self , topology_folder_list ):
403
358
"""
404
359
Apply the base domain configuration from the model topology section.
0 commit comments