Skip to content

Commit 3c2a4ad

Browse files
Wdt refactor domain mbeans (#646)
* Fix java.lang.Boolean issues for ActiveDirectoryAuthenticator * refactor the code to a more generic format for domain mbeans
1 parent 22df701 commit 3c2a4ad

File tree

3 files changed

+35
-144
lines changed

3 files changed

+35
-144
lines changed

core/src/main/python/wlsdeploy/tool/discover/discoverer.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ def discover_domain_mbean(self, model_top_folder_name):
7979
_logger.info('WLSDPLY-06644', model_top_folder_name, class_name=_class_name, method_name=_method_name)
8080
location.add_name_token(self._alias_helper.get_name_token(location), name)
8181
self._populate_model_parameters(result, location)
82+
# if any subfolders exist, discover
83+
self._discover_subfolders(result, location)
8284
_logger.exiting(class_name=_class_name, method_name=_method_name)
8385
return model_top_folder_name, result
8486

core/src/main/python/wlsdeploy/tool/discover/topology_discoverer.py

Lines changed: 27 additions & 138 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,18 @@ def discover(self):
8989
model_top_folder_name, embedded_ldap_configuration = self.get_embedded_ldap_configuration()
9090
discoverer.add_to_model_if_not_empty(self._dictionary, model_top_folder_name, embedded_ldap_configuration)
9191

92+
model_folder_name, folder_result = self._get_log_filters()
93+
discoverer.add_to_model_if_not_empty(self._dictionary, model_folder_name, folder_result)
94+
95+
model_folder_name, folder_result = self._get_reliable_delivery_policies()
96+
discoverer.add_to_model_if_not_empty(self._dictionary, model_folder_name, folder_result)
97+
98+
model_folder_name, folder_result = self._get_xml_entity_caches()
99+
discoverer.add_to_model_if_not_empty(self._dictionary, model_folder_name, folder_result)
100+
101+
model_folder_name, folder_result = self._get_xml_registries()
102+
discoverer.add_to_model_if_not_empty(self._dictionary, model_folder_name, folder_result)
103+
92104
_logger.exiting(class_name=_class_name, method_name=_method_name)
93105
return self._dictionary
94106

@@ -269,29 +281,21 @@ def discover_domain_parameters(self):
269281

270282
self._populate_model_parameters(self._dictionary, location)
271283

272-
model_folder_name, folder_result = self._get_admin_console()
273-
discoverer.add_to_model_if_not_empty(self._dictionary, model_folder_name, folder_result)
274-
model_folder_name, folder_result = self._get_cdi_container()
284+
model_folder_name, folder_result = self.discover_domain_mbean(model_constants.ADMIN_CONSOLE)
275285
discoverer.add_to_model_if_not_empty(self._dictionary, model_folder_name, folder_result)
276-
model_folder_name, folder_result = self._get_jta()
286+
model_folder_name, folder_result = self.discover_domain_mbean(model_constants.CDI_CONTAINER)
277287
discoverer.add_to_model_if_not_empty(self._dictionary, model_folder_name, folder_result)
278-
model_folder_name, folder_result = self._get_jmx()
288+
model_folder_name, folder_result = self.discover_domain_mbean(model_constants.JMX)
279289
discoverer.add_to_model_if_not_empty(self._dictionary, model_folder_name, folder_result)
280-
model_folder_name, folder_result = self._get_restful_management_services()
281-
discoverer.add_to_model_if_not_empty(self._dictionary, model_folder_name, folder_result)
282-
model_folder_name, folder_result = self._get_log_filters()
283-
discoverer.add_to_model_if_not_empty(self._dictionary, model_folder_name, folder_result)
284-
model_folder_name, folder_result = self._get_reliable_delivery_policies()
285-
discoverer.add_to_model_if_not_empty(self._dictionary, model_folder_name, folder_result)
286-
model_folder_name, folder_result = self._get_xml_entity_caches()
290+
model_folder_name, folder_result = self.discover_domain_mbean(model_constants.JPA)
287291
discoverer.add_to_model_if_not_empty(self._dictionary, model_folder_name, folder_result)
288-
model_folder_name, folder_result = self._get_xml_registries()
292+
model_folder_name, folder_result = self.discover_domain_mbean(model_constants.JTA)
289293
discoverer.add_to_model_if_not_empty(self._dictionary, model_folder_name, folder_result)
290-
model_folder_name, folder_result = self._get_domain_log()
294+
model_folder_name, folder_result = self.discover_domain_mbean(model_constants.LOG)
291295
discoverer.add_to_model_if_not_empty(self._dictionary, model_folder_name, folder_result)
292296
model_folder_name, folder_result = self._get_nm_properties()
293297
discoverer.add_to_model_if_not_empty(self._dictionary, model_folder_name, folder_result)
294-
model_folder_name, folder_result = self.discover_domain_mbean(model_constants.JPA)
298+
model_folder_name, folder_result = self.discover_domain_mbean(model_constants.RESTFUL_MANAGEMENT_SERVICES)
295299
discoverer.add_to_model_if_not_empty(self._dictionary, model_folder_name, folder_result)
296300

297301
_logger.exiting(class_name=_class_name, method_name=_method_name)
@@ -351,102 +355,23 @@ def get_embedded_ldap_configuration(self):
351355

352356
# Private methods
353357

354-
def _get_admin_console(self):
355-
"""
356-
Discover the domain level admin console configuration attributes.
357-
:return: model name for JTA:dictionary containing the discovered JTA attributes
358-
"""
359-
_method_name = '_get_admin_console'
360-
_logger.entering(class_name=_class_name, method_name=_method_name)
361-
model_top_folder_name = model_constants.ADMIN_CONSOLE
362-
result = OrderedDict()
363-
location = LocationContext(self._base_location)
364-
location.append_location(model_top_folder_name)
365-
name = self._find_singleton_name_in_folder(location)
366-
if name is not None:
367-
_logger.info('WLSDPLY-06613', class_name=_class_name, method_name=_method_name)
368-
location.add_name_token(self._alias_helper.get_name_token(location), name)
369-
self._populate_model_parameters(result, location)
370-
_logger.exiting(class_name=_class_name, method_name=_method_name)
371-
return model_top_folder_name, result
372-
373-
def _get_cdi_container(self):
374-
"""
375-
Discover the domain level CdiContainer configuration attributes.
376-
:return: model name for CdiContainer: dictionary containing the discovered CdiContainer attributes
377-
"""
378-
_method_name = '_get_cdi_container'
379-
_logger.entering(class_name=_class_name, method_name=_method_name)
380-
model_top_folder_name = model_constants.CDI_CONTAINER
381-
result = OrderedDict()
382-
location = LocationContext(self._base_location)
383-
location.append_location(model_top_folder_name)
384-
name = self._find_singleton_name_in_folder(location)
385-
if name is not None:
386-
_logger.info('WLSDPLY-06643', class_name=_class_name, method_name=_method_name)
387-
location.add_name_token(self._alias_helper.get_name_token(location), name)
388-
self._populate_model_parameters(result, location)
389-
_logger.exiting(class_name=_class_name, method_name=_method_name)
390-
return model_top_folder_name, result
391-
392-
def _get_jta(self):
393-
"""
394-
Discover the domain level JTA configuration attributes.
395-
:return: model name for JTA:dictionary containing the discovered JTA attributes
396-
"""
397-
_method_name = '_get_jta'
398-
_logger.entering(class_name=_class_name, method_name=_method_name)
399-
model_top_folder_name = model_constants.JTA
400-
result = OrderedDict()
401-
location = LocationContext(self._base_location)
402-
location.append_location(model_top_folder_name)
403-
name = self._find_singleton_name_in_folder(location)
404-
if name is not None:
405-
_logger.info('WLSDPLY-06614', class_name=_class_name, method_name=_method_name)
406-
location.add_name_token(self._alias_helper.get_name_token(location), name)
407-
self._populate_model_parameters(result, location)
408-
_logger.exiting(class_name=_class_name, method_name=_method_name)
409-
return model_top_folder_name, result
410-
411-
def _get_jmx(self):
358+
def _get_nm_properties(self):
412359
"""
413-
Discover the JMX agents configured in the domain.
414-
:return: model name for JMX:dictionary containing the discovered JMX attributes
360+
Discover the NMProperties attributes.
361+
:return: model name for the Log:dictionary containing the discovered NMProperties attributes
415362
"""
416-
_method_name = '_get_jmx'
363+
_method_name = '_get_nm_properties'
417364
_logger.entering(class_name=_class_name, method_name=_method_name)
418-
model_top_folder_name = model_constants.JMX
365+
model_top_folder_name = model_constants.NM_PROPERTIES
419366
result = OrderedDict()
420367
location = LocationContext(self._base_location)
421-
location.append_location(model_top_folder_name)
422-
name = self._find_singleton_name_in_folder(location)
423-
if name is not None:
424-
_logger.info('WLSDPLY-06615', class_name=_class_name, method_name=_method_name)
425-
location.add_name_token(self._alias_helper.get_name_token(location), name)
368+
if self._topfolder_exists(model_top_folder_name):
369+
_logger.info('WLSDPLY-06627', class_name=_class_name, method_name=_method_name)
370+
location.append_location(model_top_folder_name)
426371
self._populate_model_parameters(result, location)
427372
_logger.exiting(class_name=_class_name, method_name=_method_name)
428373
return model_top_folder_name, result
429374

430-
def _get_domain_log(self):
431-
"""
432-
Discover the domain log attributes.
433-
:return: model name for the Log:dictionary containing the discovered Log attributes
434-
"""
435-
_method_name = '_get_domain_log'
436-
_logger.entering(class_name=_class_name, method_name=_method_name)
437-
model_top_folder_name = model_constants.LOG
438-
result = OrderedDict()
439-
location = LocationContext(self._base_location)
440-
location.append_location(model_top_folder_name)
441-
name = self._find_singleton_name_in_folder(location)
442-
if name is not None:
443-
_logger.info('WLSDPLY-06626', class_name=_class_name, method_name=_method_name)
444-
location.add_name_token(self._alias_helper.get_name_token(location), name)
445-
self._populate_model_parameters(result, location)
446-
self._discover_subfolders(result, location)
447-
448-
return model_top_folder_name, result
449-
450375
def _get_log_filters(self):
451376
"""
452377
Discover the log filters that are used in the different types of Logs in the domain.
@@ -547,42 +472,6 @@ def _get_xml_registries(self):
547472
_logger.exiting(class_name=_class_name, method_name=_method_name, result=model_top_folder_name)
548473
return model_top_folder_name, result
549474

550-
def _get_nm_properties(self):
551-
"""
552-
Discover the NMProperties attributes.
553-
:return: model name for the Log:dictionary containing the discovered NMProperties attributes
554-
"""
555-
_method_name = '_get_nm_properties'
556-
_logger.entering(class_name=_class_name, method_name=_method_name)
557-
model_top_folder_name = model_constants.NM_PROPERTIES
558-
result = OrderedDict()
559-
location = LocationContext(self._base_location)
560-
if self._topfolder_exists(model_top_folder_name):
561-
_logger.info('WLSDPLY-06627', class_name=_class_name, method_name=_method_name)
562-
location.append_location(model_top_folder_name)
563-
self._populate_model_parameters(result, location)
564-
_logger.exiting(class_name=_class_name, method_name=_method_name)
565-
return model_top_folder_name, result
566-
567-
def _get_restful_management_services(self):
568-
"""
569-
Discover the wlst restful management services enablement for the domain.
570-
:return: model name for the mbean:dictionary containing the discovered restful management services mbean
571-
"""
572-
_method_name = '_get_restful_management_services'
573-
_logger.entering(class_name=_class_name, method_name=_method_name)
574-
model_top_folder_name = model_constants.RESTFUL_MANAGEMENT_SERVICES
575-
result = OrderedDict()
576-
location = LocationContext(self._base_location)
577-
location.append_location(model_top_folder_name)
578-
name = self._find_singleton_name_in_folder(location)
579-
if name is not None:
580-
_logger.info('WLSDPLY-06616', class_name=_class_name, method_name=_method_name)
581-
location.add_name_token(self._alias_helper.get_name_token(location), name)
582-
self._populate_model_parameters(result, location)
583-
_logger.exiting(class_name=_class_name, method_name=_method_name)
584-
return model_top_folder_name, result
585-
586475
def _has_machines_folder(self, base_folder):
587476
"""
588477
This is a private method.

core/src/main/resources/oracle/weblogic/deploy/messages/wlsdeploy_rb.properties

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -695,10 +695,10 @@ WLSDPLY-06609=Discovering {0} Unix machines
695695
WLSDPLY-06610=Adding Unix Machine {0}
696696
WLSDPLY-06611=Discovering {0} machines
697697
WLSDPLY-06612=Adding Machine {0}
698-
WLSDPLY-06613=Adding Domain AdminConsole
699-
WLSDPLY-06614=Adding Domain JTA
700-
WLSDPLY-06615=Adding Domain JMX
701-
WLSDPLY-06616=Adding Domain RestfulManagementServices
698+
699+
700+
701+
702702
WLSDPLY-06617=Adding Server {0} Classpath {1}
703703
WLSDPLY-06618=Remove Classpath entry {0} for server {1}. This entry references an oracle home location
704704
WLSDPLY-06619=Add Classpath file or directory {0} for Server {1} to the archive file
@@ -708,7 +708,7 @@ WLSDPLY-06622=Adding Security Configuration
708708
WLSDPLY-06623=Adding keystore file {0} for server {1} to archive file
709709
WLSDPLY-06624=Unable to locate and add Server {0} keystore file {1} to the archive file : {2}
710710
WLSDPLY-06625=Unexpected exception attempting to add Server {0} keystore file {1} to the archive : {2}
711-
WLSDPLY-06626=Discovering Domain Log
711+
712712
WLSDPLY-06627=Discovering NM Properties
713713
WLSDPLY-06628=Discovering {0} Log Filters
714714
WLSDPLY-06629=Adding Log Filter {0}
@@ -727,7 +727,7 @@ WLSDPLY-06641=Custom Keystore file name at location {0} is {1}
727727
WLSDPLY-06642=Custom Keystore file {0} at location {1} is a kss type which is not currently supported. \
728728
The Custom Keystore file will not be added to the archive file. Use export / import to \
729729
add the file to the target domain
730-
WLSDPLY-06643=Adding Domain CdiContainer
730+
731731
WLSDPLY-06644=Adding Domain {0}
732732

733733

0 commit comments

Comments
 (0)