16
16
from wlsdeploy .exception import exception_helper
17
17
from wlsdeploy .exception .expection_types import ExceptionType
18
18
from wlsdeploy .logging .platform_logger import PlatformLogger
19
+
19
20
from wlsdeploy .tool .util .mbean_utils import MBeanUtils
21
+ from wlsdeploy .tool .discover .custom_folder_helper import CustomFolderHelper
20
22
from wlsdeploy .tool .util .alias_helper import AliasHelper
21
23
from wlsdeploy .tool .util .wlst_helper import WlstHelper
22
24
from wlsdeploy .util import path_utils
@@ -49,10 +51,11 @@ def __init__(self, model_context, base_location, wlst_mode, aliases=None):
49
51
self ._aliases = Aliases (self ._model_context , wlst_mode = self ._wlst_mode )
50
52
self ._alias_helper = AliasHelper (self ._aliases , _logger , ExceptionType .DISCOVER )
51
53
self ._att_handler_map = OrderedDict ()
54
+ self ._custom_folder = CustomFolderHelper (self ._aliases , _logger , self ._model_context , ExceptionType .DISCOVER )
52
55
self ._weblogic_helper = WebLogicHelper (_logger )
53
- self ._wls_version = self ._weblogic_helper .get_actual_weblogic_version ()
54
56
self ._wlst_helper = WlstHelper (_logger , ExceptionType .DISCOVER )
55
57
self ._mbean_utils = MBeanUtils (self ._model_context , self ._alias_helper , ExceptionType .DISCOVER )
58
+ self ._wls_version = self ._weblogic_helper .get_actual_weblogic_version ()
56
59
57
60
# methods for use only by the subclasses
58
61
@@ -356,19 +359,19 @@ def _discover_subfolder_with_single_name(self, model_subfolder_name, location, n
356
359
_logger .exiting (class_name = _class_name , method_name = _method_name )
357
360
return result
358
361
359
- def _discover_artificial_folder (self , model_subfolder_name , location , name_token ):
362
+ def _discover_artificial_folder (self , model_subfolder_type , location , name_token ):
360
363
"""
361
364
Discover the subfolder that has an artificial connection; the subfolder contains multiple different types
362
365
under one MBean. The model must contain the subfolder type, the artificial type that specifies which it is,
363
366
and the name of the subfolder. This folder is only one layer deep. No need to continue to discover
364
367
additional subfolders
365
- :param model_subfolder_name : type of the model subfolder
368
+ :param model_subfolder_type : type of the model subfolder
366
369
:param location: context containing the current location information
367
370
:param name_token: for use in the location to contain the folder name
368
371
:return: dictionary containing the discovered folder attributes
369
372
"""
370
373
_method_name = '_discover_artifical_folder'
371
- _logger .entering (model_subfolder_name , str (location ), name_token , class_name = _class_name ,
374
+ _logger .entering (model_subfolder_type , str (location ), name_token , class_name = _class_name ,
372
375
method_name = _method_name )
373
376
subfolder_result = OrderedDict ()
374
377
names = self ._find_names_in_folder (location )
@@ -378,10 +381,16 @@ def _discover_artificial_folder(self, model_subfolder_name, location, name_token
378
381
location .add_name_token (name_token , massaged )
379
382
artificial = self ._get_artificial_type (location )
380
383
if artificial is None :
381
- _logger .warning ('WLSDPLY-06123' , self ._alias_helper .get_model_folder_path (location ),
382
- class_name = _class_name , method_name = _method_name )
384
+ if self ._alias_helper .is_custom_folder_allowed (location ):
385
+ _logger .fine ('WLSDPLY-06148' , model_subfolder_type , massaged , location .get_folder_path (),
386
+ class_name = _class_name , method_name = _method_name )
387
+ subfolder_result = self ._custom_folder .discover_custom_mbean (location , model_subfolder_type ,
388
+ massaged )
389
+ else :
390
+ _logger .warning ('WLSDPLY-06123' , self ._alias_helper .get_model_folder_path (location ),
391
+ class_name = _class_name , method_name = _method_name )
383
392
else :
384
- _logger .finer ('WLSDPLY-06120' , artificial , massaged , model_subfolder_name , class_name = _class_name ,
393
+ _logger .finer ('WLSDPLY-06120' , artificial , massaged , model_subfolder_type , class_name = _class_name ,
385
394
method_name = _method_name )
386
395
location .append_location (artificial )
387
396
subfolder_result [massaged ] = OrderedDict ()
@@ -665,9 +674,6 @@ def _inspect_security_folder_name(self, folder_name, location):
665
674
self ._alias_helper .is_security_provider_type (location ) and 'Provider' == folder_name :
666
675
raise exception_helper .create_discover_exception ('WLSDPLY-06201' , folder_name , location .get_folder_path ())
667
676
668
- _logger .fine ('version {0} mode {1} type? {2} provider {3}' , not self ._weblogic_helper .is_version_in_12c (),
669
- self ._wlst_mode == WlstModes .OFFLINE , self ._alias_helper .is_security_provider_type (location ),
670
- 'Provider' == folder_name )
671
677
return folder_name
672
678
673
679
0 commit comments