1616from wlsdeploy .exception import exception_helper
1717from wlsdeploy .exception .expection_types import ExceptionType
1818from wlsdeploy .logging .platform_logger import PlatformLogger
19+
1920from wlsdeploy .tool .util .mbean_utils import MBeanUtils
21+ from wlsdeploy .tool .discover .custom_folder_helper import CustomFolderHelper
2022from wlsdeploy .tool .util .alias_helper import AliasHelper
2123from wlsdeploy .tool .util .wlst_helper import WlstHelper
2224from wlsdeploy .util import path_utils
@@ -49,10 +51,11 @@ def __init__(self, model_context, base_location, wlst_mode, aliases=None):
4951 self ._aliases = Aliases (self ._model_context , wlst_mode = self ._wlst_mode )
5052 self ._alias_helper = AliasHelper (self ._aliases , _logger , ExceptionType .DISCOVER )
5153 self ._att_handler_map = OrderedDict ()
54+ self ._custom_folder = CustomFolderHelper (self ._aliases , _logger , self ._model_context , ExceptionType .DISCOVER )
5255 self ._weblogic_helper = WebLogicHelper (_logger )
53- self ._wls_version = self ._weblogic_helper .get_actual_weblogic_version ()
5456 self ._wlst_helper = WlstHelper (_logger , ExceptionType .DISCOVER )
5557 self ._mbean_utils = MBeanUtils (self ._model_context , self ._alias_helper , ExceptionType .DISCOVER )
58+ self ._wls_version = self ._weblogic_helper .get_actual_weblogic_version ()
5659
5760 # methods for use only by the subclasses
5861
@@ -356,19 +359,19 @@ def _discover_subfolder_with_single_name(self, model_subfolder_name, location, n
356359 _logger .exiting (class_name = _class_name , method_name = _method_name )
357360 return result
358361
359- def _discover_artificial_folder (self , model_subfolder_name , location , name_token ):
362+ def _discover_artificial_folder (self , model_subfolder_type , location , name_token ):
360363 """
361364 Discover the subfolder that has an artificial connection; the subfolder contains multiple different types
362365 under one MBean. The model must contain the subfolder type, the artificial type that specifies which it is,
363366 and the name of the subfolder. This folder is only one layer deep. No need to continue to discover
364367 additional subfolders
365- :param model_subfolder_name : type of the model subfolder
368+ :param model_subfolder_type : type of the model subfolder
366369 :param location: context containing the current location information
367370 :param name_token: for use in the location to contain the folder name
368371 :return: dictionary containing the discovered folder attributes
369372 """
370373 _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 ,
372375 method_name = _method_name )
373376 subfolder_result = OrderedDict ()
374377 names = self ._find_names_in_folder (location )
@@ -378,10 +381,16 @@ def _discover_artificial_folder(self, model_subfolder_name, location, name_token
378381 location .add_name_token (name_token , massaged )
379382 artificial = self ._get_artificial_type (location )
380383 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 )
383392 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 ,
385394 method_name = _method_name )
386395 location .append_location (artificial )
387396 subfolder_result [massaged ] = OrderedDict ()
@@ -665,9 +674,6 @@ def _inspect_security_folder_name(self, folder_name, location):
665674 self ._alias_helper .is_security_provider_type (location ) and 'Provider' == folder_name :
666675 raise exception_helper .create_discover_exception ('WLSDPLY-06201' , folder_name , location .get_folder_path ())
667676
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 )
671677 return folder_name
672678
673679
0 commit comments