Skip to content

Commit 4032e77

Browse files
committed
Merge branch 'issue-#1506-check-jrf' into 'main'
Use typedef flag isJrfInstalled instead of examining templates See merge request weblogic-cloud/weblogic-deploy-tooling!1526
2 parents 68fd2fe + d20e86f commit 4032e77

File tree

10 files changed

+69
-86
lines changed

10 files changed

+69
-86
lines changed

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

+2-22
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ def __extend_domain(self, domain_home):
574574
server_groups_to_target = self._domain_typedef.get_server_groups_to_target()
575575
self.target_helper.target_server_groups_to_servers(server_groups_to_target)
576576

577-
elif self._domain_typedef.is_jrf_domain_type() or \
577+
elif self._domain_typedef.has_jrf_with_database_store() or \
578578
(self._domain_typedef.get_targeting() == TargetingType.APPLY_JRF):
579579
# for 11g, if template list includes JRF, or if specified in domain typedef, use applyJRF
580580
self.target_helper.target_jrf_groups_to_clusters_servers()
@@ -693,26 +693,6 @@ def __extend_domain_with_select_template(self, domain_home):
693693

694694
self.logger.exiting(class_name=self.__class_name, method_name=_method_name)
695695

696-
def __set_server_groups(self):
697-
_method_name = '__set_server_groups'
698-
self.logger.entering(class_name=self.__class_name, method_name=_method_name)
699-
if self.wls_helper.is_set_server_groups_supported():
700-
# 12c versions set server groups directly
701-
server_groups_to_target = self._domain_typedef.get_server_groups_to_target()
702-
server_assigns, dynamic_assigns = \
703-
self.target_helper.target_server_groups_to_servers(server_groups_to_target)
704-
if len(server_assigns) > 0:
705-
self.target_helper.target_server_groups(server_assigns)
706-
707-
if len(dynamic_assigns) > 0:
708-
self.target_helper.target_server_groups_to_dynamic_clusters(dynamic_assigns)
709-
710-
elif self._domain_typedef.is_jrf_domain_type() or \
711-
(self._domain_typedef.get_targeting() == TargetingType.APPLY_JRF):
712-
# for 11g, if template list includes JRF, or if specified in domain typedef, use applyJRF
713-
self.target_helper.target_jrf_groups_to_clusters_servers()
714-
self.logger.exiting(class_name=self.__class_name, method_name=_method_name)
715-
716696
def __apply_base_domain_config(self, topology_folder_list, delete=True):
717697
"""
718698
Apply the base domain configuration from the model topology section.
@@ -1602,7 +1582,7 @@ def __run_post_create_domain_script(self):
16021582
def __configure_opss_secrets(self):
16031583
_method_name = '__configure_opss_secrets'
16041584

1605-
if not self._domain_typedef.is_jrf_domain_type():
1585+
if not self._domain_typedef.has_jrf_with_database_store():
16061586
return
16071587

16081588
self.logger.entering(class_name=self.__class_name, method_name=_method_name)

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

+21-21
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Copyright (c) 2017, 2023, Oracle Corporation and/or its affiliates.
2+
Copyright (c) 2017, 2023, Oracle and/or its affiliates.
33
Licensed under the Universal Permissive License v1.0 as shown at https://oss.oracle.com/licenses/upl.
44
"""
55
import os
@@ -15,6 +15,7 @@
1515
from wlsdeploy.logging.platform_logger import PlatformLogger
1616
from wlsdeploy.tool.util.targeting_types import TargetingType
1717
from wlsdeploy.tool.util.topology_profiles import TopologyProfile
18+
from wlsdeploy.util import dictionary_utils
1819
from wlsdeploy.util import path_utils
1920
from wlsdeploy.util.exit_code import ExitCode
2021
from wlsdeploy.util.weblogic_helper import WebLogicHelper
@@ -162,31 +163,30 @@ def get_topology_profile(self):
162163
"""
163164
return self._topology_profile
164165

165-
def is_jrf_domain_type(self):
166+
def is_jrf_installed(self):
166167
"""
167-
Determine if this is a JRF domain type by checking for the JRF extension template or
168-
JRF SVR GrOUP.
169-
This returns False for the Restricted JRF domain type.
170-
:return: True if the JRF template is present
168+
Determine if this is domain type has JRF installed, based on a flag in the typedef file.
169+
If this is not specified in the typedef file, the default is True.
170+
:return: the value of the "isJrfInstalled" flag, or True if not specified
171171
"""
172-
if self.is_restricted_jrf_domain_type():
173-
return False
174-
for template in self.get_extension_templates():
175-
if re.match(self.JRF_TEMPLATE_REGEX, template):
176-
return True
177-
if self.JRF_SERVER_GROUP in self.get_server_groups_to_target():
178-
return True
179-
return False
172+
jrf_installed = dictionary_utils.get_element(self._domain_typedef, 'isJrfInstalled')
173+
if jrf_installed is None:
174+
jrf_installed = True
175+
return jrf_installed
180176

181-
def is_restricted_jrf_domain_type(self):
177+
def has_jrf_with_file_store(self):
182178
"""
183-
Determine if this domain type applies the Restricted JRF template.
184-
:return: True if the Restricted JRF template is in the extension templates list
179+
Determine if this domain type has JRF installed and uses a file store.
180+
:return: True if the domain type has JRF installed and uses a file store, False otherwise
185181
"""
186-
for template in self.get_extension_templates():
187-
if re.match(self.RESTRICTED_JRF_TEMPLATE_REGEX, template):
188-
return True
189-
return False
182+
return self.is_jrf_installed() and not self.get_rcu_schemas()
183+
184+
def has_jrf_with_database_store(self):
185+
"""
186+
Determine if this domain type has JRF installed and uses a database store.
187+
:return: True if the domain type has JRF installed and uses a database store, False otherwise
188+
"""
189+
return self.is_jrf_installed() and bool(self.get_rcu_schemas())
190190

191191
def get_base_template(self):
192192
"""

core/src/main/python/wlsdeploy/tool/deploy/odl_deployer.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Copyright (c) 2019, 2022, Oracle Corporation and/or its affiliates. All rights reserved.
2+
Copyright (c) 2019, 2023, 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
from java.io import File
@@ -66,7 +66,7 @@ def configure_odl(self, parent_dict, parent_location):
6666
odl_info = dictionary_utils.get_dictionary_element(parent_dict, ODL_CONFIGURATION)
6767
if len(odl_info):
6868
typedef = self.model_context.get_domain_typedef()
69-
if not (typedef.is_jrf_domain_type() or typedef.is_restricted_jrf_domain_type()):
69+
if not typedef.is_jrf_installed():
7070
self.logger.info('WLSDPLY-19709', class_name=self.__class_name, method_name=_method_name)
7171
elif self.wlst_mode == WlstModes.ONLINE:
7272
self.logger.info('WLSDPLY-19700', class_name=self.__class_name, method_name=_method_name)

core/src/main/python/wlsdeploy/tool/deploy/topology_updater.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ def set_server_groups(self):
194194
self.target_helper.target_server_groups(server_assigns)
195195
if len(dynamic_assigns) > 0:
196196
self.target_helper.target_dynamic_server_groups(dynamic_assigns)
197-
elif self._domain_typedef.is_jrf_domain_type():
197+
elif self._domain_typedef.has_jrf_with_database_store():
198198
self.target_helper.target_jrf_groups_to_clusters_servers()
199199

200200
def _process_section(self, folder_dict, folder_list, key, location, delete_now=True):

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

+2-17
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Copyright (c) 2017, 2022, Oracle Corporation and/or its affiliates.
2+
Copyright (c) 2017, 2023, 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

@@ -288,29 +288,14 @@ def target_dynamic_clusters(self, server_assigns):
288288
ex = exception_helper.create_exception(self.exception_type, 'WLSDPLY-12256',
289289
cluster, server_groups)
290290
self.logger.throwing(ex, class_name=self.__class_name, method_name=_method_name)
291-
raise ex
291+
raise ex
292292
elif len(server_groups) > 0:
293293
self.logger.info('WLSDPLY-12255', server_groups[0], cluster_name,
294294
class_name=self.__class_name, method_name=_method_name)
295295
self.wlst_helper.set_server_group_dynamic_cluster(cluster_name, server_groups[0])
296296

297297
self.logger.exiting(class_name=self.__class_name, method_name=_method_name)
298298

299-
def _target_jrf_resources(self, dynamic_cluster_assigns):
300-
# Target the JRF resources directly using the applyJRF method.
301-
_method_name = '_target_jrf_resources'
302-
names_only = list()
303-
for name in dynamic_cluster_assigns:
304-
names_only.append(name)
305-
if self.model_context.is_wlst_online() and \
306-
self.model_context.get_domain_typedef().is_restricted_jrf_domain_type():
307-
self.logger.warning('WLSDPLY-12244', str_helper.to_string(names_only), class_name=self.__class_name,
308-
_method_name=_method_name)
309-
else:
310-
self.logger.info('WLSDPLY-12236', str_helper.to_string(names_only),
311-
class_name=self.__class_name, method_name=_method_name)
312-
self.wlst_helper.apply_jrf_with_context(names_only, self.model_context)
313-
314299
def _get_existing_server_names(self):
315300
"""
316301
Get the list of server names from WLST.

core/src/main/typedefs/JRF-Compact.json

+9-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"copyright": "Copyright (c) 2022, 2023, Oracle Corporation and/or its affiliates. All rights reserved.",
2+
"copyright": "Copyright (c) 2022, 2023, Oracle and/or its affiliates.",
33
"license": "Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl",
44
"name": "JRF-Compact",
55
"description": "JRF type domain with a compact profile definitions",
@@ -27,7 +27,8 @@
2727
],
2828
"customExtensionTemplates": [ ],
2929
"serverGroupsToTarget": [ ],
30-
"rcuSchemas": [ "MDS", "IAU", "IAU_VIEWER", "IAU_APPEND", "OPSS", "STB", "WLS" ]
30+
"rcuSchemas": [ "MDS", "IAU", "IAU_VIEWER", "IAU_APPEND", "OPSS", "STB", "WLS" ],
31+
"isJrfInstalled": true
3132
},
3233
"JRF_12CR2": {
3334
"baseTemplate": "Basic WebLogic Server Domain",
@@ -39,7 +40,8 @@
3940
],
4041
"customExtensionTemplates": [ ],
4142
"serverGroupsToTarget": [ ],
42-
"rcuSchemas": [ "MDS", "IAU", "IAU_VIEWER", "IAU_APPEND", "OPSS", "STB", "WLS" ]
43+
"rcuSchemas": [ "MDS", "IAU", "IAU_VIEWER", "IAU_APPEND", "OPSS", "STB", "WLS" ],
44+
"isJrfInstalled": true
4345
},
4446
"JRF_12CR2_LAST": {
4547
"baseTemplate": "Basic WebLogic Server Domain",
@@ -51,7 +53,8 @@
5153
],
5254
"customExtensionTemplates": [ ],
5355
"serverGroupsToTarget": [ ],
54-
"rcuSchemas": [ "MDS", "IAU", "IAU_VIEWER", "IAU_APPEND", "OPSS", "STB", "WLS" ]
56+
"rcuSchemas": [ "MDS", "IAU", "IAU_VIEWER", "IAU_APPEND", "OPSS", "STB", "WLS" ],
57+
"isJrfInstalled": true
5558
},
5659
"JRF_14": {
5760
"baseTemplate": "Basic WebLogic Server Domain",
@@ -63,7 +66,8 @@
6366
],
6467
"customExtensionTemplates": [ ],
6568
"serverGroupsToTarget": [ ],
66-
"rcuSchemas": [ "MDS", "IAU", "IAU_VIEWER", "IAU_APPEND", "OPSS", "STB", "WLS" ]
69+
"rcuSchemas": [ "MDS", "IAU", "IAU_VIEWER", "IAU_APPEND", "OPSS", "STB", "WLS" ],
70+
"isJrfInstalled": true
6771
}
6872
},
6973
"discover-filters": {

core/src/main/typedefs/JRF.json

+15-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"copyright": "Copyright (c) 2017, 2023, Oracle Corporation and/or its affiliates. All rights reserved.",
2+
"copyright": "Copyright (c) 2017, 2023, Oracle and/or its affiliates.",
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",
@@ -26,7 +26,8 @@
2626
],
2727
"serverGroupsToTarget" : [ "JRF-MAN-SVR", "WSMPM-MAN-SVR" ],
2828
"customExtensionTemplates": [ ],
29-
"rcuSchemas": [ "MDS", "IAU", "IAU_VIEWER", "IAU_APPEND", "OPSS" ]
29+
"rcuSchemas": [ "MDS", "IAU", "IAU_VIEWER", "IAU_APPEND", "OPSS" ],
30+
"isJrfInstalled": true
3031
},
3132
"JRF_1212" : {
3233
"baseTemplate": "@@WL_HOME@@/common/templates/wls/wls.jar",
@@ -38,7 +39,8 @@
3839
],
3940
"customExtensionTemplates": [ ],
4041
"serverGroupsToTarget" : [ "JRF-MAN-SVR", "WSMPM-MAN-SVR" ],
41-
"rcuSchemas": [ "MDS", "IAU", "IAU_VIEWER", "IAU_APPEND", "OPSS", "STB" ]
42+
"rcuSchemas": [ "MDS", "IAU", "IAU_VIEWER", "IAU_APPEND", "OPSS", "STB" ],
43+
"isJrfInstalled": true
4244
},
4345
"JRF_1213" : {
4446
"baseTemplate": "@@WL_HOME@@/common/templates/wls/wls.jar",
@@ -50,7 +52,8 @@
5052
],
5153
"customExtensionTemplates": [ ],
5254
"serverGroupsToTarget" : [ "JRF-MAN-SVR", "WSMPM-MAN-SVR" ],
53-
"rcuSchemas": [ "MDS", "IAU", "IAU_VIEWER", "IAU_APPEND", "OPSS", "STB" ]
55+
"rcuSchemas": [ "MDS", "IAU", "IAU_VIEWER", "IAU_APPEND", "OPSS", "STB" ],
56+
"isJrfInstalled": true
5457
},
5558
"JRF_12CR2_FIRST": {
5659
"baseTemplate": "Basic WebLogic Server Domain",
@@ -62,7 +65,8 @@
6265
],
6366
"customExtensionTemplates": [ ],
6467
"serverGroupsToTarget": [ "JRF-MAN-SVR", "WSMPM-MAN-SVR" ],
65-
"rcuSchemas": [ "MDS", "IAU", "IAU_VIEWER", "IAU_APPEND", "OPSS", "STB", "WLS" ]
68+
"rcuSchemas": [ "MDS", "IAU", "IAU_VIEWER", "IAU_APPEND", "OPSS", "STB", "WLS" ],
69+
"isJrfInstalled": true
6670
},
6771
"JRF_12CR2": {
6872
"baseTemplate": "Basic WebLogic Server Domain",
@@ -75,7 +79,8 @@
7579
"customExtensionTemplates": [ ],
7680
"serverGroupsToTarget": [ "JRF-MAN-SVR", "WSMPM-MAN-SVR" ],
7781
"dynamicClusterServerGroupsToTarget" : [ "WSMPM-DYN-CLUSTER" ],
78-
"rcuSchemas": [ "MDS", "IAU", "IAU_VIEWER", "IAU_APPEND", "OPSS", "STB", "WLS" ]
82+
"rcuSchemas": [ "MDS", "IAU", "IAU_VIEWER", "IAU_APPEND", "OPSS", "STB", "WLS" ],
83+
"isJrfInstalled": true
7984
},
8085
"JRF_12CR2_LAST": {
8186
"baseTemplate": "Basic WebLogic Server Domain",
@@ -88,7 +93,8 @@
8893
"customExtensionTemplates": [ ],
8994
"serverGroupsToTarget": [ "JRF-MAN-SVR", "WSMPM-MAN-SVR" ],
9095
"dynamicClusterServerGroupsToTarget" : [ "WSMPM-DYN-CLUSTER", "WSM-CACHE-DYN-CLUSTER" ],
91-
"rcuSchemas": [ "MDS", "IAU", "IAU_VIEWER", "IAU_APPEND", "OPSS", "STB", "WLS" ]
96+
"rcuSchemas": [ "MDS", "IAU", "IAU_VIEWER", "IAU_APPEND", "OPSS", "STB", "WLS" ],
97+
"isJrfInstalled": true
9298
},
9399
"JRF_14": {
94100
"baseTemplate": "Basic WebLogic Server Domain",
@@ -101,7 +107,8 @@
101107
"customExtensionTemplates": [ ],
102108
"serverGroupsToTarget": [ "JRF-MAN-SVR", "WSMPM-MAN-SVR" ],
103109
"dynamicClusterServerGroupsToTarget" : [ "WSMPM-DYN-CLUSTER", "WSM-CACHE-DYN-CLUSTER" ],
104-
"rcuSchemas": [ "MDS", "IAU", "IAU_VIEWER", "IAU_APPEND", "OPSS", "STB", "WLS" ]
110+
"rcuSchemas": [ "MDS", "IAU", "IAU_VIEWER", "IAU_APPEND", "OPSS", "STB", "WLS" ],
111+
"isJrfInstalled": true
105112
}
106113
},
107114
"discover-filters": {

core/src/main/typedefs/RestrictedJRF.json

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"copyright": "Copyright (c) 2017, 2023, Oracle Corporation and/or its affiliates. All rights reserved.",
2+
"copyright": "Copyright (c) 2017, 2023, Oracle and/or its affiliates.",
33
"license": "Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl",
44
"name": "RestrictedJRF",
55
"description": "Restricted JRF type domain definitions",
@@ -19,23 +19,26 @@
1919
"extensionTemplates": [ "Oracle Restricted JRF", "Oracle Enterprise Manager-Restricted JRF" ],
2020
"customExtensionTemplates": [ ],
2121
"serverGroupsToTarget": [ "JRF-MAN-SVR", "WSM-CACHE-SVR", "JRF-WS-CORE-MAN-SVR" ],
22-
"rcuSchemas": [ ]
22+
"rcuSchemas": [ ],
23+
"isJrfInstalled": true
2324
},
2425
"RJRF_12CR2": {
2526
"baseTemplate": "Basic WebLogic Server Domain",
2627
"extensionTemplates": [ "Oracle Restricted JRF", "Oracle Enterprise Manager-Restricted JRF" ],
2728
"customExtensionTemplates": [ ],
2829
"serverGroupsToTarget": [ "JRF-MAN-SVR", "WSM-CACHE-SVR", "JRF-WS-CORE-MAN-SVR"] ,
2930
"dynamicClusterServerGroupsToTarget" : [ "WSM-CACHE-DYN-CLUSTER" ],
30-
"rcuSchemas": [ ]
31+
"rcuSchemas": [ ],
32+
"isJrfInstalled": true
3133
},
3234
"RJRF_14": {
3335
"baseTemplate": "Basic WebLogic Server Domain",
3436
"extensionTemplates": [ "Oracle Restricted JRF", "Oracle Enterprise Manager-Restricted JRF" ],
3537
"customExtensionTemplates": [ ],
3638
"serverGroupsToTarget": [ "JRF-MAN-SVR", "WSM-CACHE-SVR", "JRF-WS-CORE-MAN-SVR" ],
3739
"dynamicClusterServerGroupsToTarget" : [ "WSM-CACHE-DYN-CLUSTER" ],
38-
"rcuSchemas": [ ]
40+
"rcuSchemas": [ ],
41+
"isJrfInstalled": true
3942
}
4043

4144
},

core/src/main/typedefs/WLS.json

+9-5
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, 2023, Oracle and/or its affiliates.",
33
"license": "Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl",
44
"name": "WLS",
55
"description": "WLS type domain definitions",
@@ -19,28 +19,32 @@
1919
"extensionTemplates": [ ],
2020
"customExtensionTemplates": [ ],
2121
"serverGroupsToTarget": [ ],
22-
"rcuSchemas": [ ]
22+
"rcuSchemas": [ ],
23+
"isJrfInstalled": false
2324
},
2425
"WLS_12CR1": {
2526
"baseTemplate": "@@WL_HOME@@/common/templates/wls/wls.jar",
2627
"extensionTemplates": [ ],
2728
"customExtensionTemplates": [ ],
2829
"serverGroupsToTarget": [ ],
29-
"rcuSchemas": [ ]
30+
"rcuSchemas": [ ],
31+
"isJrfInstalled": false
3032
},
3133
"WLS_12CR2": {
3234
"baseTemplate": "Basic WebLogic Server Domain",
3335
"extensionTemplates": [ ],
3436
"customExtensionTemplates": [ ],
3537
"serverGroupsToTarget": [ ],
36-
"rcuSchemas": [ ]
38+
"rcuSchemas": [ ],
39+
"isJrfInstalled": false
3740
},
3841
"WLS_14": {
3942
"baseTemplate": "Basic WebLogic Server Domain",
4043
"extensionTemplates": [ ],
4144
"customExtensionTemplates": [ ],
4245
"serverGroupsToTarget": [ ],
43-
"rcuSchemas": [ ]
46+
"rcuSchemas": [ ],
47+
"isJrfInstalled": false
4448
}
4549
}
4650
}

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
<dependency>
115115
<groupId>commons-io</groupId>
116116
<artifactId>commons-io</artifactId>
117-
<version>2.14.0</version>
117+
<version>2.15.0</version>
118118
</dependency>
119119
<dependency>
120120
<groupId>info.picocli</groupId>

0 commit comments

Comments
 (0)