Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
* Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
*/
package oracle.weblogic.deploy.util;
package oracle.weblogic.deploy.create;

import oracle.weblogic.deploy.aliases.TypeUtils;
import oracle.weblogic.deploy.exception.ExceptionHelper;
Expand Down
7 changes: 7 additions & 0 deletions core/src/main/python/wlsdeploy/aliases/alias_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
SEMI_COLON_DELIMITED_STRING = 'delimited_string[semicolon]'
SPACE_DELIMITED_STRING = 'delimited_string[space]'
STRING = 'string'
MASKED = '<masked>'

ALIAS_DELIMITED_TYPES = [
COMMA_DELIMITED_STRING,
Expand Down Expand Up @@ -113,6 +114,12 @@
STRING
]

ALIAS_NUMERIC_DATA_TYPES = [
DOUBLE,
INTEGER,
LONG
]

ALIAS_DATA_TYPES = list()
ALIAS_DATA_TYPES.extend(ALIAS_PRIMITIVE_DATA_TYPES)
ALIAS_DATA_TYPES.extend(ALIAS_LIST_TYPES)
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/python/wlsdeploy/tool/create/creator.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
from wlsdeploy.exception import exception_helper
from wlsdeploy.exception.expection_types import ExceptionType
from wlsdeploy.logging.platform_logger import PlatformLogger
from wlsdeploy.util import dictionary_utils
from wlsdeploy.tool.create.custom_folder_helper import CustomFolderHelper
from wlsdeploy.tool.util.alias_helper import AliasHelper
from wlsdeploy.tool.util.attribute_setter import AttributeSetter
from wlsdeploy.tool.util.custom_folder_helper import CustomFolderHelper
from wlsdeploy.util import dictionary_utils
from wlsdeploy.tool.util.wlst_helper import WlstHelper
from wlsdeploy.util.model import Model
from wlsdeploy.util.weblogic_helper import WebLogicHelper
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from java.lang import IllegalArgumentException
from java.lang import IllegalAccessException
from java.lang.reflect import InvocationTargetException
from oracle.weblogic.deploy.util import CustomBeanUtils
from oracle.weblogic.deploy.create import CustomBeanUtils

from wlsdeploy.aliases.location_context import LocationContext
from wlsdeploy.exception import exception_helper
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
"""
Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
The Universal Permissive License (UPL), Version 1.0
"""

_class_name = 'custom_discoverer'
525 changes: 525 additions & 0 deletions core/src/main/python/wlsdeploy/tool/discover/custom_folder_helper.py

Large diffs are not rendered by default.

26 changes: 16 additions & 10 deletions core/src/main/python/wlsdeploy/tool/discover/discoverer.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
from wlsdeploy.exception import exception_helper
from wlsdeploy.exception.expection_types import ExceptionType
from wlsdeploy.logging.platform_logger import PlatformLogger

from wlsdeploy.tool.util.mbean_utils import MBeanUtils
from wlsdeploy.tool.discover.custom_folder_helper import CustomFolderHelper
from wlsdeploy.tool.util.alias_helper import AliasHelper
from wlsdeploy.tool.util.wlst_helper import WlstHelper
from wlsdeploy.util import path_utils
Expand Down Expand Up @@ -49,10 +51,11 @@ def __init__(self, model_context, base_location, wlst_mode, aliases=None):
self._aliases = Aliases(self._model_context, wlst_mode=self._wlst_mode)
self._alias_helper = AliasHelper(self._aliases, _logger, ExceptionType.DISCOVER)
self._att_handler_map = OrderedDict()
self._custom_folder = CustomFolderHelper(self._aliases, _logger, self._model_context, ExceptionType.DISCOVER)
self._weblogic_helper = WebLogicHelper(_logger)
self._wls_version = self._weblogic_helper.get_actual_weblogic_version()
self._wlst_helper = WlstHelper(_logger, ExceptionType.DISCOVER)
self._mbean_utils = MBeanUtils(self._model_context, self._alias_helper, ExceptionType.DISCOVER)
self._wls_version = self._weblogic_helper.get_actual_weblogic_version()

# methods for use only by the subclasses

Expand Down Expand Up @@ -356,19 +359,19 @@ def _discover_subfolder_with_single_name(self, model_subfolder_name, location, n
_logger.exiting(class_name=_class_name, method_name=_method_name)
return result

def _discover_artificial_folder(self, model_subfolder_name, location, name_token):
def _discover_artificial_folder(self, model_subfolder_type, location, name_token):
"""
Discover the subfolder that has an artificial connection; the subfolder contains multiple different types
under one MBean. The model must contain the subfolder type, the artificial type that specifies which it is,
and the name of the subfolder. This folder is only one layer deep. No need to continue to discover
additional subfolders
:param model_subfolder_name: type of the model subfolder
:param model_subfolder_type: type of the model subfolder
:param location: context containing the current location information
:param name_token: for use in the location to contain the folder name
:return: dictionary containing the discovered folder attributes
"""
_method_name = '_discover_artifical_folder'
_logger.entering(model_subfolder_name, str(location), name_token, class_name=_class_name,
_logger.entering(model_subfolder_type, str(location), name_token, class_name=_class_name,
method_name=_method_name)
subfolder_result = OrderedDict()
names = self._find_names_in_folder(location)
Expand All @@ -378,10 +381,16 @@ def _discover_artificial_folder(self, model_subfolder_name, location, name_token
location.add_name_token(name_token, massaged)
artificial = self._get_artificial_type(location)
if artificial is None:
_logger.warning('WLSDPLY-06123', self._alias_helper.get_model_folder_path(location),
class_name=_class_name, method_name=_method_name)
if self._alias_helper.is_custom_folder_allowed(location):
_logger.fine('WLSDPLY-06148', model_subfolder_type, massaged, location.get_folder_path(),
class_name=_class_name, method_name=_method_name)
subfolder_result = self._custom_folder.discover_custom_mbean(location, model_subfolder_type,
massaged)
else:
_logger.warning('WLSDPLY-06123', self._alias_helper.get_model_folder_path(location),
class_name=_class_name, method_name=_method_name)
else:
_logger.finer('WLSDPLY-06120', artificial, massaged, model_subfolder_name, class_name=_class_name,
_logger.finer('WLSDPLY-06120', artificial, massaged, model_subfolder_type, class_name=_class_name,
method_name=_method_name)
location.append_location(artificial)
subfolder_result[massaged] = OrderedDict()
Expand Down Expand Up @@ -665,9 +674,6 @@ def _inspect_security_folder_name(self, folder_name, location):
self._alias_helper.is_security_provider_type(location) and 'Provider' == folder_name:
raise exception_helper.create_discover_exception('WLSDPLY-06201', folder_name, location.get_folder_path())

_logger.fine('version {0} mode {1} type? {2} provider {3}', not self._weblogic_helper.is_version_in_12c(),
self._wlst_mode == WlstModes.OFFLINE, self._alias_helper.is_security_provider_type(location),
'Provider' == folder_name)
return folder_name


Expand Down
13 changes: 13 additions & 0 deletions core/src/main/python/wlsdeploy/tool/util/beaninfo_constants.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
"""
Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
The Universal Permissive License (UPL), Version 1.0
"""

# Constant values representing the properties in the WebLogic Server Class java.beans.PropertyDescriptor
ATTRIBUTE_DEFAULT = 'default'
ATTRIBUTE_ENCRYPTED = 'encrypted'
ATTRIBUTE_GETTER = 'readMethod'
ATTRIBUTE_NAME = 'name'
ATTRIBUTE_SETTER = 'writeMethod'
ATTRIBUTE_TYPE = 'propertyType'

Loading