Skip to content

Commit 59cb390

Browse files
Merge pull request #1034 from oracle/topology-profile
Topology profile
2 parents 5c506d9 + 9c156e1 commit 59cb390

File tree

8 files changed

+253
-6
lines changed

8 files changed

+253
-6
lines changed

core/src/main/python/wlsdeploy/tool/create/domain_creator.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Copyright (c) 2017, 2021, Oracle and/or its affiliates.
2+
Copyright (c) 2017, 2022, Oracle and/or its affiliates.
33
Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
44
"""
55
import os
@@ -90,6 +90,7 @@
9090
from wlsdeploy.tool.util.rcu_helper import RCUHelper
9191
from wlsdeploy.tool.util.target_helper import TargetHelper
9292
from wlsdeploy.tool.util.targeting_types import TargetingType
93+
from wlsdeploy.tool.util.topology_profiles import TopologyProfile
9394
from wlsdeploy.tool.util.topology_helper import TopologyHelper
9495
from wlsdeploy.util import dictionary_utils
9596
from wlsdeploy.util import model
@@ -508,6 +509,12 @@ def __create_base_domain_with_select_template(self, domain_home):
508509
_method_name = '__create_base_domain_with_select_template'
509510

510511
self.logger.entering(domain_home, class_name=self.__class_name, method_name=_method_name)
512+
513+
topology_profile = self._domain_typedef.get_topology_profile()
514+
if topology_profile in TopologyProfile:
515+
self.logger.info('WLSDPLY-12569', topology_profile, class_name=self.__class_name, method_name=_method_name)
516+
self.wlst_helper.set_topology_profile(topology_profile)
517+
511518
base_template = self._domain_typedef.get_base_template()
512519
self.logger.info('WLSDPLY-12210', base_template,
513520
class_name=self.__class_name, method_name=_method_name)

core/src/main/python/wlsdeploy/tool/create/domain_typedef.py

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Copyright (c) 2017, 2020, Oracle Corporation and/or its affiliates. All rights reserved.
2+
Copyright (c) 2017, 2022, Oracle Corporation and/or its affiliates. All rights reserved.
33
Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
44
"""
55
import os
@@ -13,6 +13,7 @@
1313
from wlsdeploy.json.json_translator import JsonToPython
1414
from wlsdeploy.logging.platform_logger import PlatformLogger
1515
from wlsdeploy.tool.util.targeting_types import TargetingType
16+
from wlsdeploy.tool.util.topology_profiles import TopologyProfile
1617
from wlsdeploy.util import path_utils
1718
from wlsdeploy.util.cla_utils import CommandLineArgUtil
1819
from wlsdeploy.util.weblogic_helper import WebLogicHelper
@@ -30,7 +31,7 @@ class DomainTypedef(object):
3031

3132
__domain_typedef_extension = '.json'
3233

33-
JRF_TEMPLATE_REGEX = "^(.*jrf_template[0-9._]*\\.jar)|(Oracle JRF WebServices Asynchronous services)$"
34+
JRF_TEMPLATE_REGEX = "^(.*jrf_template[0-9._]*\\.jar)|^(Oracle JRF)$"
3435
RESTRICTED_JRF_TEMPLATE_REGEX = "^(Oracle Restricted JRF)$"
3536
JRF_SERVER_GROUP = 'JRF-MAN-SVR'
3637

@@ -81,6 +82,8 @@ def __init__(self, program_name, domain_type):
8182
else:
8283
self._system_elements = {}
8384

85+
self._topology_profile = self._resolve_topology_profile()
86+
8487
return
8588

8689
def set_model_context(self, model_context):
@@ -101,6 +104,13 @@ def get_domain_type(self):
101104
"""
102105
return self._domain_type
103106

107+
def get_topology_profile(self):
108+
"""
109+
Get the topology profile for the domain type, if any.
110+
:return: the topology profile or None if no topology profile is specified
111+
"""
112+
return self._topology_profile
113+
104114
def has_jrf_resources(self):
105115
"""
106116
Determine if the domain type has domain resources from either the JRF or Restricted JRF templates.
@@ -474,3 +484,31 @@ def _resolve_targeting_type(self):
474484
raise ex
475485

476486
return TargetingType[targeting_text]
487+
488+
def _resolve_topology_profile(self):
489+
"""
490+
Determine the topology profile based on the value in the typedef file.
491+
492+
:return: the matching topology profile enum value
493+
:raises: ClaException: if there are problems or incompatibilities
494+
"""
495+
_method_name = '_resolve_topology_profile'
496+
497+
if 'topologyProfile' not in self._domain_typedefs_dict:
498+
return None
499+
topology_profile = self._domain_typedefs_dict['topologyProfile'];
500+
501+
# there are no valid topology profiles for versions 12.1.x and below
502+
if not self.wls_helper.is_topology_profile_supported():
503+
ex = exception_helper.create_cla_exception('WLSDPLY-12314', topology_profile, self._domain_typedef_filename,
504+
self.wls_helper.get_weblogic_version())
505+
self._logger.throwing(ex, class_name=self.__class_name, method_name=_method_name)
506+
raise ex
507+
508+
# if specified, toppology profile must be one of the known types
509+
if topology_profile not in TopologyProfile:
510+
ex = exception_helper.create_cla_exception('WLSDPLY-12315', topology_profile, self._domain_typedef_filename)
511+
self._logger.throwing(ex, class_name=self.__class_name, method_name=_method_name)
512+
raise ex
513+
514+
return topology_profile
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
"""
2+
Copyright (c) 2022, Oracle Corporation and/or its affiliates.
3+
Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
4+
"""
5+
from wlsdeploy.util.enum import Enum
6+
7+
TopologyProfile = Enum([
8+
'Compact',
9+
'Expanded'
10+
])

core/src/main/python/wlsdeploy/tool/util/wlst_helper.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Copyright (c) 2019, 2021, Oracle Corporation and/or its affiliates.
2+
Copyright (c) 2019, 2022, Oracle Corporation and/or its affiliates.
33
Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
44
"""
55

@@ -692,6 +692,24 @@ def load_templates(self):
692692
raise pwe
693693
self.__logger.exiting(class_name=self.__class_name, method_name=_method_name)
694694

695+
def set_topology_profile(self, profile):
696+
"""
697+
Set the desired topology profile defined in the domain extension template.
698+
:param profile: the profile to use
699+
:raises: Exception for the specified tool type: if a WLST error occurs
700+
"""
701+
_method_name = 'set-topology_profile'
702+
703+
self.__logger.entering(profile, class_name=self.__class_name, method_name=_method_name)
704+
try:
705+
self.__load_global('setTopologyProfile')(profile)
706+
except offlineWLSTException, e:
707+
pwe = exception_helper.create_exception(self.__exception_type, 'WLSDPLY-00128', profile,
708+
e.getLocalizedMessage(), error=e)
709+
self.__logger.throwing(class_name=self.__class_name, method_name=_method_name, error=pwe)
710+
raise pwe
711+
self.__logger.exiting(class_name=self.__class_name, method_name=_method_name)
712+
695713
def read_domain(self, domain_home):
696714
"""
697715
Read the domain indicated by the domain_home name in offline mode.

core/src/main/python/wlsdeploy/util/weblogic_helper.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,13 @@ def is_dynamic_cluster_server_groups_supported(self):
117117
"""
118118
return self.is_weblogic_version_or_above('12.2.1.4')
119119

120+
def is_topology_profile_supported(self):
121+
"""
122+
Is topology profile supported in domain extension templates?
123+
:return: true if version is within the range supporting topology profiles, false otherwise
124+
"""
125+
return self.is_weblogic_version_or_above('12.2.1')
126+
120127
def get_jdbc_url_from_rcu_connect_string(self, rcu_connect_string):
121128
"""
122129
Get the JDBC URL from the RCU connect string.

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ WLSDPLY-00124=Entering is_set({0}) method
110110
WLSDPLY-00125=is_set({0}) in {1} mode failed: {2}
111111
WLSDPLY-00126=Exiting is_set({0}) method
112112
WLSDPLY-00127=Unable to load the DomainRuntimeService from the WLST globals : {0}
113-
113+
WLSDPLY-00128=setTopologyProfile({0}) failed: {1}
114114

115115
###############################################################################
116116
# Util messages (1000 - 3999) #
@@ -1329,6 +1329,7 @@ WLSDPLY-12565=The archive file was not provided so there are no custom files to
13291329
WLSDPLY-12566=Installing {0} user custom files to domain home {1}
13301330
WLSDPLY-12567=The archive file {0} contains no user custom files to install
13311331
WLSDPLY-12568=Creating empty folder {0}. Folder contains no attributes or sub-folders.
1332+
WLSDPLY-12569=Setting the topology profile to {0}
13321333

13331334
# domain_typedef.py
13341335
WLSDPLY-12300={0} got the domain type {1} but the domain type definition file {2} was not valid: {3}
@@ -1347,6 +1348,8 @@ WLSDPLY-12310=Version {0} returned from the domain home
13471348
WLSDPLY-12311=Targeting type "{0}" in type definition file {1} is not allowed for WebLogic version {2}
13481349
WLSDPLY-12312=Targeting type "{0}" in type definition file {1} is not valid
13491350
WLSDPLY-12313=Domain type {0} is not supported for WebLogic version {1}
1351+
WLSDDPL-12314=Topology profile "{0}" is typedef file {1} is not allowed for WebLogic version {2}
1352+
WLSDPLY-12315=Topology profile "{0}" in type definition file {1} is not a known topology profile value
13501353

13511354
# create.py
13521355
WLSDPLY-12400={0} got the JAVA_HOME {1} from the environment variable but it was not a valid location: {2}
Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
{
2+
"copyright": "Copyright (c) 2022, Oracle Corporation and/or its affiliates. All rights reserved.",
3+
"license": "Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl",
4+
"name": "JRF-Compact",
5+
"description": "JRF type domain with a compact profile definitions",
6+
"topologyProfile": "Compact",
7+
"versions": {
8+
"10.3.6": "NOT_SUPPORTED",
9+
"12.1.2": "NOT_SUPPORTED",
10+
"12.1.3": "NOT_SUPPORTED",
11+
"12.2.1": "JRF_12CR2_FIRST",
12+
"12.2.1.1": "JRF_12CR2",
13+
"12.2.1.3": "JRF_12CR2",
14+
"12.2.1.4": "JRF_12CR2_LAST",
15+
"12.2.1.5": "JRF_12CR2_LAST",
16+
"14.1": "NOT_SUPPORTED"
17+
},
18+
"definitions": {
19+
"JRF_12CR2_FIRST": {
20+
"baseTemplate": "Basic WebLogic Server Domain",
21+
"extensionTemplates": [
22+
"Oracle JRF",
23+
"Oracle JRF WebServices Asynchronous services",
24+
"Oracle WSM Policy Manager",
25+
"Oracle Enterprise Manager"
26+
],
27+
"customExtensionTemplates": [ ],
28+
"serverGroupsToTarget": [ ],
29+
"rcuSchemas": [ "MDS", "IAU", "IAU_VIEWER", "IAU_APPEND", "OPSS", "STB" ]
30+
},
31+
"JRF_12CR2": {
32+
"baseTemplate": "Basic WebLogic Server Domain",
33+
"extensionTemplates": [
34+
"Oracle JRF",
35+
"Oracle JRF WebServices Asynchronous services",
36+
"Oracle WSM Policy Manager",
37+
"Oracle Enterprise Manager"
38+
],
39+
"customExtensionTemplates": [ ],
40+
"serverGroupsToTarget": [ ],
41+
"rcuSchemas": [ "MDS", "IAU", "IAU_VIEWER", "IAU_APPEND", "OPSS", "STB" ]
42+
},
43+
"JRF_12CR2_LAST": {
44+
"baseTemplate": "Basic WebLogic Server Domain",
45+
"extensionTemplates": [
46+
"Oracle JRF",
47+
"Oracle JRF WebServices Asynchronous services",
48+
"Oracle WSM Policy Manager",
49+
"Oracle Enterprise Manager"
50+
],
51+
"customExtensionTemplates": [ ],
52+
"serverGroupsToTarget": [ ],
53+
"rcuSchemas": [ "MDS", "IAU", "IAU_VIEWER", "IAU_APPEND", "OPSS", "STB" ]
54+
}
55+
},
56+
"system-elements": {
57+
"apps": [
58+
"^coherence-transaction-rar$",
59+
"^DMS Application.*",
60+
"^em$",
61+
"^FMW Welcome Page Application.*",
62+
"^opss-rest$",
63+
"^state-management-provider-memory-rar.*",
64+
"^wsil-wls.*",
65+
"^wsm-pm$"
66+
],
67+
"coherence-clusters": [
68+
"^defaultCoherenceCluster$"
69+
],
70+
"datasources": [
71+
".*LocalSvcTblDataSource$",
72+
".*mds-owsm$",
73+
".*opss-audit-DBDS$",
74+
".*opss-audit-viewDS$",
75+
".*opss-data-source$",
76+
".*opss-ds$",
77+
".*WLSSchemaDataSource$"
78+
],
79+
"file-stores": [
80+
"^JRFWSAsyncFileStore$",
81+
"^mds-owsm$"
82+
],
83+
"jms": [
84+
"^JRFWSAsyncJmsModule$"
85+
],
86+
"jms-servers": [
87+
"^JRFWSAsyncJmsServer$"
88+
],
89+
"shared-libraries": [
90+
"^adf\\.oracle\\.businesseditor.*",
91+
"^adf\\.oracle\\.domain.*",
92+
"^adf\\.oracle\\.domain\\.webapp.*",
93+
"^em_common.*",
94+
"^em_core_ppc_pojo_jar$",
95+
"^em_error.*",
96+
"^em_sdkcore_ppc_public_pojo_jar$",
97+
"^emagentsdk_jar.*",
98+
"^emagentsdkimpl_jar.*",
99+
"^emagentsdkimplpriv_jar.*",
100+
"^emas$",
101+
"^emcore$",
102+
"^emcore_jar$",
103+
"^emcoreclient_jar$",
104+
"^emcorecommon_jar$",
105+
"^emcoreconsole_jar$",
106+
"^emcoreintsdk_jar.*",
107+
"^emcorepbs_jar$",
108+
"^emcoresdk_jar.*",
109+
"^emcoresdkimpl_jar.*",
110+
"^jsf.*",
111+
"^jstl.*",
112+
"^log4j_jar.*",
113+
"^odl\\.clickhistory.*",
114+
"^odl\\.clickhistory\\.webapp.*",
115+
"^ohw-rcf.*",
116+
"^ohw-uix.*",
117+
"^oracle\\.adf\\.dconfigbeans.*",
118+
"^oracle\\.adf\\.desktopintegration.*",
119+
"^oracle\\.adf\\.desktopintegration\\.model.*",
120+
"^oracle\\.adf\\.management.*",
121+
"^oracle\\.bi\\.adf\\.model\\.slib.*",
122+
"^oracle\\.bi\\.adf\\.view\\.slib.*",
123+
"^oracle\\.bi\\.adf\\.webcenter\\.slib.*",
124+
"^oracle\\.bi\\.composer.*",
125+
"^oracle\\.bi\\.jbips.*",
126+
"^oracle\\.dconfig-infra.*",
127+
"^oracle\\.jrf\\.system\\.filter$",
128+
"^oracle\\.jsp\\.next.*",
129+
"^oracle\\.pwdgen.*",
130+
"^oracle\\.sdp\\.client.*",
131+
"^oracle\\.sdp\\.messaging.*",
132+
"^oracle\\.webcenter\\.composer.*",
133+
"^oracle\\.webcenter\\.skin.*",
134+
"^oracle\\.wsm\\.console.*",
135+
"^oracle\\.wsm\\.idmrest.*",
136+
"^oracle\\.wsm\\.seedpolicies.*",
137+
"^orai18n-adf.*",
138+
"^owasp\\.esapi.*",
139+
"^UIX.*"
140+
],
141+
"shutdown-classes": [
142+
"^DMSShutdown$",
143+
"^JOC-Shutdown$"
144+
],
145+
"startup-classes": [
146+
"^JMX Framework Startup Class$",
147+
"^JOC-Startup$",
148+
"^JPS Startup Class$",
149+
"^JPS Startup Post-Activation Class$",
150+
"^WSM Startup Class$",
151+
"^Web Services Startup Class$",
152+
"^JRF Startup Class$",
153+
"^ODL-Startup$",
154+
"^DMS-Startup$",
155+
"^AWT Application Context Startup Class$"
156+
],
157+
"wldf": [
158+
"^Module-FMWDFW$"
159+
]
160+
}
161+
}

core/src/main/typedefs/JRF.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"copyright": "Copyright (c) 2017, 2019, Oracle Corporation and/or its affiliates. All rights reserved.",
2+
"copyright": "Copyright (c) 2017, 2022, Oracle Corporation and/or its affiliates. All rights reserved.",
33
"license": "Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl",
44
"name": "JRF",
55
"description": "JRF type domain definitions",
@@ -54,6 +54,7 @@
5454
"JRF_12CR2_FIRST": {
5555
"baseTemplate": "Basic WebLogic Server Domain",
5656
"extensionTemplates": [
57+
"Oracle JRF",
5758
"Oracle JRF WebServices Asynchronous services",
5859
"Oracle WSM Policy Manager",
5960
"Oracle Enterprise Manager"
@@ -65,6 +66,7 @@
6566
"JRF_12CR2": {
6667
"baseTemplate": "Basic WebLogic Server Domain",
6768
"extensionTemplates": [
69+
"Oracle JRF",
6870
"Oracle JRF WebServices Asynchronous services",
6971
"Oracle WSM Policy Manager",
7072
"Oracle Enterprise Manager"
@@ -77,6 +79,7 @@
7779
"JRF_12CR2_LAST": {
7880
"baseTemplate": "Basic WebLogic Server Domain",
7981
"extensionTemplates": [
82+
"Oracle JRF",
8083
"Oracle JRF WebServices Asynchronous services",
8184
"Oracle WSM Policy Manager",
8285
"Oracle Enterprise Manager"

0 commit comments

Comments
 (0)