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

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions core/src/main/python/wlsdeploy/tool/create/domain_creator.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
from wlsdeploy.tool.util.rcu_helper import RCUHelper
from wlsdeploy.tool.util.target_helper import TargetHelper
from wlsdeploy.tool.util.targeting_types import TargetingType
from wlsdeploy.tool.util.topology_profiles import TopologyProfile
from wlsdeploy.tool.util.topology_helper import TopologyHelper
from wlsdeploy.util import dictionary_utils
from wlsdeploy.util import model
Expand Down Expand Up @@ -506,6 +507,12 @@ def __create_base_domain_with_select_template(self, domain_home):
:raises: CreateException: if an error occurs
"""
_method_name = '__create_base_domain_with_select_template'

topology_profile_text = self._domain_typedef.get_topology_profile()
if topology_profile_text in TopologyProfile:
self.logger.info('WLSDPLY-12569', topology_profile_text,
class_name=self.__class_name, method_name=_method_name)
self.wlst_helper.set_topology_profile(topology_profile_text)

self.logger.entering(domain_home, class_name=self.__class_name, method_name=_method_name)
base_template = self._domain_typedef.get_base_template()
Expand Down
40 changes: 39 additions & 1 deletion core/src/main/python/wlsdeploy/tool/create/domain_typedef.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from wlsdeploy.json.json_translator import JsonToPython
from wlsdeploy.logging.platform_logger import PlatformLogger
from wlsdeploy.tool.util.targeting_types import TargetingType
from wlsdeploy.tool.util.topology_profiles import TopologyProfile
from wlsdeploy.util import path_utils
from wlsdeploy.util.cla_utils import CommandLineArgUtil
from wlsdeploy.util.weblogic_helper import WebLogicHelper
Expand All @@ -29,7 +30,7 @@ class DomainTypedef(object):
__class_name = 'DomainTypedef'

__domain_typedef_extension = '.json'

JRF_TEMPLATE_REGEX = "^(.*jrf_template[0-9._]*\\.jar)|(Oracle JRF WebServices Asynchronous services)$"
RESTRICTED_JRF_TEMPLATE_REGEX = "^(Oracle Restricted JRF)$"
JRF_SERVER_GROUP = 'JRF-MAN-SVR'
Expand Down Expand Up @@ -81,6 +82,8 @@ def __init__(self, program_name, domain_type):
else:
self._system_elements = {}

self._topology_profile = self._resolve_topology_profile()

return

def set_model_context(self, model_context):
Expand All @@ -100,6 +103,12 @@ def get_domain_type(self):
:return: the name of the domain type
"""
return self._domain_type

def get_topology_profile(self):
"""
Get the topology profile of the domain type
"""
return self._topology_profile

def has_jrf_resources(self):
"""
Expand Down Expand Up @@ -474,3 +483,32 @@ def _resolve_targeting_type(self):
raise ex

return TargetingType[targeting_text]

def _resolve_topology_profile(self):
"""
Determine the topology profile based on the value in the definition.
Check for problems or incompatibilities.
:return: the matching TopologyProfile enum value
:raises: ClaException: if there are problems or incompatibilities
"""
_method_name = '_resolve_topology_profile'

if 'topologyProfile' not in self._domain_typedefs_dict:
return None

topology_profile_text = self._domain_typedefs_dict['topologyProfile']

# there are no valid topology profiles for version 12.1 and below
if not self.wls_helper.is_select_template_supported():
ex = exception_helper.create_cla_exception('WLSDPLY-12314', topology_profile_text, self._domain_typedef_filename,
self.wls_helper.get_weblogic_version())
self._logger.throwing(ex, class_name=self.__class_name, method_name=_method_name)
raise ex

# if specified, topology profile must be one of the known types
if topology_profile_text not in TopologyProfile:
ex = exception_helper.create_cla_exception('WLSDPLY-12315', topology_profile_text, self._domain_typedef_filename)
self._logger.throwing(ex, class_name=self.__class_name, method_name=_method_name)
raise ex

return topology_profile_text
10 changes: 10 additions & 0 deletions core/src/main/python/wlsdeploy/tool/util/topology_profiles.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
"""
Copyright (c) 2019, Oracle Corporation and/or its affiliates. All rights reserved.
Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
"""
from wlsdeploy.util.enum import Enum

TopologyProfile = Enum([
'Compact',
'Expanded'
])
19 changes: 19 additions & 0 deletions core/src/main/python/wlsdeploy/tool/util/wlst_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,25 @@ def close_template(self):
self.__logger.throwing(class_name=self.__class_name, method_name=_method_name, error=pwe)
raise pwe
self.__logger.exiting(class_name=self.__class_name, method_name=_method_name)

def set_topology_profile(self, profile):
"""
Set the topology profile used by domain templates. This would be
either Compact or Expanded
:param profile: Compact or Expanded
:raises: Exception for the specified tool type: if a WLST error occurs
"""
_method_name = 'set_topology_profile'
self.__logger.entering(profile, class_name=self.__class_name, method_name=_method_name)
try:
self.__load_global('setTopologyProfile')(profile)
except offlineWLSTException, e:
pwe = exception_helper.create_exception(self.__exception_type, 'WLSDPLY-00128', profile,
e.getLocalizedMessage(), error=e)
self.__logger.throwing(class_name=self.__class_name, method_name=_method_name, error=pwe)
raise pwe
self.__logger.exiting(class_name=self.__class_name, method_name=_method_name)


def select_template(self, template):
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ WLSDPLY-00124=Entering is_set({0}) method
WLSDPLY-00125=is_set({0}) in {1} mode failed: {2}
WLSDPLY-00126=Exiting is_set({0}) method
WLSDPLY-00127=Unable to load the DomainRuntimeService from the WLST globals : {0}
WLSDPLY-00128=setTopologyProfile({0}) failed : {1}


###############################################################################
Expand Down Expand Up @@ -1328,6 +1329,7 @@ WLSDPLY-12565=The archive file was not provided so there are no custom files to
WLSDPLY-12566=Installing {0} user custom files to domain home {1}
WLSDPLY-12567=The archive file {0} contains no user custom files to install
WLSDPLY-12568=Creating empty folder {0}. Folder contains no attributes or sub-folders.
WLSDPLY-12569=Setting topology profile to {0}

# domain_typedef.py
WLSDPLY-12300={0} got the domain type {1} but the domain type definition file {2} was not valid: {3}
Expand All @@ -1346,6 +1348,8 @@ WLSDPLY-12310=Version {0} returned from the domain home
WLSDPLY-12311=Targeting type "{0}" in type definition file {1} is not allowed for WebLogic version {2}
WLSDPLY-12312=Targeting type "{0}" in type definition file {1} is not valid
WLSDPLY-12313=Domain type {0} is not supported for WebLogic version {1}
WLSDPLY-12314=Topology Profile "{0}" in type definition file {1} is not allowed for WebLogic version {2}
WLSDPLY-12315=Topology Profile "{0}" in type definition file {1} is not valid

# create.py
WLSDPLY-12400={0} got the JAVA_HOME {1} from the environment variable but it was not a valid location: {2}
Expand Down