Skip to content

Commit 44eae8f

Browse files
committed
Merge branch 'wdt-773' into 'main'
Add EnableJMSDBPersistence and EnabelJTALogDBPersistence in domainInfo See merge request weblogic-cloud/weblogic-deploy-tooling!1503
2 parents 18654dc + 23c059d commit 44eae8f

File tree

5 files changed

+90
-0
lines changed

5 files changed

+90
-0
lines changed

core/src/main/python/wlsdeploy/aliases/model_constants.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@
118118
DOMAIN_VERSION = 'DomainVersion'
119119
DYNAMIC_SERVERS = 'DynamicServers'
120120
EMBEDDED_LDAP = 'EmbeddedLDAP'
121+
ENABLE_JMS_DB_PERSISTENCE = 'EnableJMSStoreDBPersistence'
122+
ENABLE_JTALOG_DB_PERSISTENCE = 'EnableJTATLogDBPersistence'
121123
ERROR_DESTINATION = 'ErrorDestination'
122124
EXECUTE_QUEUE = 'ExecuteQueue'
123125
EXPRESSION = 'Expression'

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

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141
from wlsdeploy.aliases.model_constants import DRIVER_PARAMS_TRUSTSTORETYPE_PROPERTY
4242
from wlsdeploy.aliases.model_constants import DRIVER_PARAMS_TRUSTSTORE_PROPERTY
4343
from wlsdeploy.aliases.model_constants import DRIVER_PARAMS_USER_PROPERTY
44+
from wlsdeploy.aliases.model_constants import ENABLE_JMS_DB_PERSISTENCE
45+
from wlsdeploy.aliases.model_constants import ENABLE_JTALOG_DB_PERSISTENCE
4446
from wlsdeploy.aliases.model_constants import FRONTEND_HOST
4547
from wlsdeploy.aliases.model_constants import JDBC_DRIVER_PARAMS_PROPERTIES
4648
from wlsdeploy.aliases.model_constants import JDBC_SYSTEM_RESOURCE
@@ -78,6 +80,7 @@
7880
from wlsdeploy.aliases.model_constants import WEB_SERVICE_SECURITY
7981
from wlsdeploy.aliases.model_constants import XML_ENTITY_CACHE
8082
from wlsdeploy.aliases.model_constants import XML_REGISTRY
83+
from wlsdeploy.aliases.validation_codes import ValidationCodes
8184
from wlsdeploy.exception import exception_helper
8285
from wlsdeploy.exception.expection_types import ExceptionType
8386
from wlsdeploy.tool.create import atp_helper
@@ -618,6 +621,10 @@ def __extend_domain_with_select_template(self, domain_home):
618621

619622
self.__set_core_domain_params()
620623
self.__set_app_dir()
624+
625+
self.__enable_jms_db_persistence_if_set()
626+
self.__enable_jta_tlog_db_persistence_if_set()
627+
621628
if len(extension_templates) > 0:
622629
self.__configure_fmw_infra_database()
623630
self.__configure_opss_secrets()
@@ -1333,6 +1340,45 @@ def __set_app_dir(self):
13331340
self.logger.exiting(class_name=self.__class_name, method_name=_method_name)
13341341
return
13351342

1343+
def __enable_jms_db_persistence_if_set(self):
1344+
"""
1345+
Enable jms db persistence if set
1346+
"""
1347+
_method_name = '__enable_jms_db_persistence_if_set'
1348+
1349+
self.logger.entering(class_name=self.__class_name, method_name=_method_name)
1350+
if ENABLE_JMS_DB_PERSISTENCE in self._domain_info:
1351+
location = self.aliases.get_model_section_attribute_location(DOMAIN_INFO)
1352+
result, __ = self.aliases.is_valid_model_attribute_name(location,
1353+
ENABLE_JMS_DB_PERSISTENCE)
1354+
1355+
if result == ValidationCodes.VALID:
1356+
enable_jms_db = self._domain_info[ENABLE_JMS_DB_PERSISTENCE]
1357+
self.wlst_helper.enable_jms_store_db_persistence(enable_jms_db)
1358+
1359+
self.logger.exiting(class_name=self.__class_name, method_name=_method_name)
1360+
return
1361+
1362+
def __enable_jta_tlog_db_persistence_if_set(self):
1363+
"""
1364+
Enable jta tlog db persistence if set
1365+
"""
1366+
_method_name = '__enable_jta_tlog_db_persistence_if_set'
1367+
1368+
self.logger.entering(class_name=self.__class_name, method_name=_method_name)
1369+
if ENABLE_JTALOG_DB_PERSISTENCE in self._domain_info:
1370+
location = self.aliases.get_model_section_attribute_location(DOMAIN_INFO)
1371+
result, __ = self.aliases.is_valid_model_attribute_name(location,
1372+
ENABLE_JTALOG_DB_PERSISTENCE)
1373+
1374+
if result == ValidationCodes.VALID:
1375+
enable_jta_db = self._domain_info[ENABLE_JTALOG_DB_PERSISTENCE]
1376+
self.wlst_helper.enable_jta_tlog_store_db_persistence(enable_jta_db)
1377+
1378+
1379+
self.logger.exiting(class_name=self.__class_name, method_name=_method_name)
1380+
return
1381+
13361382
def __set_domain_name(self):
13371383
_method_name = '__set_domain_name'
13381384
# Stash the default name since the SecurityConfiguration subfolder name does not change

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

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1604,6 +1604,44 @@ def get_domain_runtime_service(self):
16041604
self.__logger.exiting(class_name=self.__class_name, method_name=_method_name, result=drs)
16051605
return drs
16061606

1607+
def enable_jta_tlog_store_db_persistence(self, jta_db_enabled):
1608+
"""
1609+
Enable jta transaction log database store persistence if set
1610+
"""
1611+
_method_name = 'enable_jta_tlog_store_db_persistence'
1612+
self.__logger.entering(class_name=self.__class_name, method_name=_method_name)
1613+
try:
1614+
if self.__load_global('isJTATLogPersistenceConfigurable')() and not \
1615+
self.__load_global('isJTATLogDBPersistenceSet')() and \
1616+
jta_db_enabled:
1617+
self.__load_global('enableJTATLogDBPersistence')(True)
1618+
1619+
except self.__load_global('WLSTException'), e:
1620+
pwe = exception_helper.create_exception(self.__exception_type, 'WLSDEPY-00132',
1621+
_format_exception(e), error=e)
1622+
self.__logger.throwing(class_name=self.__class_name, method_name=_method_name, error=pwe)
1623+
raise pwe
1624+
self.__logger.exiting(class_name=self.__class_name, method_name=_method_name)
1625+
1626+
def enable_jms_store_db_persistence(self, jms_db_enabled):
1627+
"""
1628+
Enable jms database store persistence if set
1629+
"""
1630+
_method_name = 'enable_jms_store_db_persistence'
1631+
self.__logger.entering(class_name=self.__class_name, method_name=_method_name)
1632+
try:
1633+
if self.__load_global('isJMSStorePersistenceConfigurable')() and not \
1634+
self.__load_global('isJMSStoreDBPersistenceSet')() and \
1635+
jms_db_enabled:
1636+
self.__load_global('enableJMSStoreDBPersistence')(True)
1637+
1638+
except self.__load_global('WLSTException'), e:
1639+
pwe = exception_helper.create_exception(self.__exception_type, 'WLSDEPY-00131',
1640+
_format_exception(e), error=e)
1641+
self.__logger.throwing(class_name=self.__class_name, method_name=_method_name, error=pwe)
1642+
raise pwe
1643+
self.__logger.exiting(class_name=self.__class_name, method_name=_method_name)
1644+
16071645
def __ls(self, method_name, ls_type, path=None, log_throwing=True):
16081646
"""
16091647
Private helper method shared by various API methods

core/src/main/resources/oracle/weblogic/deploy/aliases/category_modules/DomainInfo.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
"DynamicClusterServerGroupTargetingLimits": [ {"version": "[12.2.1.1,)", "wlst_mode": "both", "wlst_name": "dynamicClusterServerGroupTargetingLimits", "wlst_path": "WP001", "default_value": null, "wlst_type": "dict" } ],
1313
"ServerStartMode": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "ServerStartMode", "wlst_path": "WP001", "default_value": null, "wlst_type": "string" } ],
1414
"UseSampleDatabase": [ {"version": "[12.2.1,)", "wlst_mode": "offline", "wlst_name": "UseSampleDatabase", "wlst_path": "WP001", "default_value": null, "wlst_type": "string" } ],
15+
"EnableJMSStoreDBPersistence": [ {"version": "[12.2.1.1,)", "wlst_mode": "offline", "wlst_name": "EnableJMSStoreDBPersistence", "wlst_path": "WP001", "default_value": false, "wlst_type": "boolean" } ],
16+
"EnableJTATLogDBPersistence": [ {"version": "[12.2.1.1,)", "wlst_mode": "offline", "wlst_name": "EnableJTATLogDBPersistence", "wlst_path": "WP001", "default_value": false, "wlst_type": "boolean" } ],
1517
"domainBin": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "domainBin", "wlst_path": "WP001", "default_value": null, "wlst_type": "list", "uses_path_tokens": "true" } ],
1618
"domainLibraries": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "domainLibraries", "wlst_path": "WP001", "default_value": null, "wlst_type": "list", "uses_path_tokens": "true" } ]
1719
},

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ WLSDPLY-00127=Unable to load the DomainRuntimeService from the WLST globals : {0
113113
WLSDPLY-00128=setTopologyProfile({0}) failed: {1}
114114
WLSDPLY-00129=Error calling isSet() for attribute {0} at location {1}: {2}
115115
WLSDPLY-00130=Failed to get the current MBean tree: {0}
116+
WLSDEPY-00131=Failed to set JMS store to use database store: {0}
117+
WLSDEPY-00132=Failed to set JTA transaction log store to use database store: {0}
116118

117119
###############################################################################
118120
# Util messages (1000 - 3999) #

0 commit comments

Comments
 (0)