Skip to content

Commit

Permalink
Add EnableJMSDBPersistence and EnabelJTALogDBPersistence in domainInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
jshum2479 authored and robertpatrick committed Sep 7, 2023
1 parent 18654dc commit 23c059d
Show file tree
Hide file tree
Showing 5 changed files with 90 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/src/main/python/wlsdeploy/aliases/model_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@
DOMAIN_VERSION = 'DomainVersion'
DYNAMIC_SERVERS = 'DynamicServers'
EMBEDDED_LDAP = 'EmbeddedLDAP'
ENABLE_JMS_DB_PERSISTENCE = 'EnableJMSStoreDBPersistence'
ENABLE_JTALOG_DB_PERSISTENCE = 'EnableJTATLogDBPersistence'
ERROR_DESTINATION = 'ErrorDestination'
EXECUTE_QUEUE = 'ExecuteQueue'
EXPRESSION = 'Expression'
Expand Down
46 changes: 46 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 @@ -41,6 +41,8 @@
from wlsdeploy.aliases.model_constants import DRIVER_PARAMS_TRUSTSTORETYPE_PROPERTY
from wlsdeploy.aliases.model_constants import DRIVER_PARAMS_TRUSTSTORE_PROPERTY
from wlsdeploy.aliases.model_constants import DRIVER_PARAMS_USER_PROPERTY
from wlsdeploy.aliases.model_constants import ENABLE_JMS_DB_PERSISTENCE
from wlsdeploy.aliases.model_constants import ENABLE_JTALOG_DB_PERSISTENCE
from wlsdeploy.aliases.model_constants import FRONTEND_HOST
from wlsdeploy.aliases.model_constants import JDBC_DRIVER_PARAMS_PROPERTIES
from wlsdeploy.aliases.model_constants import JDBC_SYSTEM_RESOURCE
Expand Down Expand Up @@ -78,6 +80,7 @@
from wlsdeploy.aliases.model_constants import WEB_SERVICE_SECURITY
from wlsdeploy.aliases.model_constants import XML_ENTITY_CACHE
from wlsdeploy.aliases.model_constants import XML_REGISTRY
from wlsdeploy.aliases.validation_codes import ValidationCodes
from wlsdeploy.exception import exception_helper
from wlsdeploy.exception.expection_types import ExceptionType
from wlsdeploy.tool.create import atp_helper
Expand Down Expand Up @@ -618,6 +621,10 @@ def __extend_domain_with_select_template(self, domain_home):

self.__set_core_domain_params()
self.__set_app_dir()

self.__enable_jms_db_persistence_if_set()
self.__enable_jta_tlog_db_persistence_if_set()

if len(extension_templates) > 0:
self.__configure_fmw_infra_database()
self.__configure_opss_secrets()
Expand Down Expand Up @@ -1333,6 +1340,45 @@ def __set_app_dir(self):
self.logger.exiting(class_name=self.__class_name, method_name=_method_name)
return

def __enable_jms_db_persistence_if_set(self):
"""
Enable jms db persistence if set
"""
_method_name = '__enable_jms_db_persistence_if_set'

self.logger.entering(class_name=self.__class_name, method_name=_method_name)
if ENABLE_JMS_DB_PERSISTENCE in self._domain_info:
location = self.aliases.get_model_section_attribute_location(DOMAIN_INFO)
result, __ = self.aliases.is_valid_model_attribute_name(location,
ENABLE_JMS_DB_PERSISTENCE)

if result == ValidationCodes.VALID:
enable_jms_db = self._domain_info[ENABLE_JMS_DB_PERSISTENCE]
self.wlst_helper.enable_jms_store_db_persistence(enable_jms_db)

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

def __enable_jta_tlog_db_persistence_if_set(self):
"""
Enable jta tlog db persistence if set
"""
_method_name = '__enable_jta_tlog_db_persistence_if_set'

self.logger.entering(class_name=self.__class_name, method_name=_method_name)
if ENABLE_JTALOG_DB_PERSISTENCE in self._domain_info:
location = self.aliases.get_model_section_attribute_location(DOMAIN_INFO)
result, __ = self.aliases.is_valid_model_attribute_name(location,
ENABLE_JTALOG_DB_PERSISTENCE)

if result == ValidationCodes.VALID:
enable_jta_db = self._domain_info[ENABLE_JTALOG_DB_PERSISTENCE]
self.wlst_helper.enable_jta_tlog_store_db_persistence(enable_jta_db)


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

def __set_domain_name(self):
_method_name = '__set_domain_name'
# Stash the default name since the SecurityConfiguration subfolder name does not change
Expand Down
38 changes: 38 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 @@ -1604,6 +1604,44 @@ def get_domain_runtime_service(self):
self.__logger.exiting(class_name=self.__class_name, method_name=_method_name, result=drs)
return drs

def enable_jta_tlog_store_db_persistence(self, jta_db_enabled):
"""
Enable jta transaction log database store persistence if set
"""
_method_name = 'enable_jta_tlog_store_db_persistence'
self.__logger.entering(class_name=self.__class_name, method_name=_method_name)
try:
if self.__load_global('isJTATLogPersistenceConfigurable')() and not \
self.__load_global('isJTATLogDBPersistenceSet')() and \
jta_db_enabled:
self.__load_global('enableJTATLogDBPersistence')(True)

except self.__load_global('WLSTException'), e:
pwe = exception_helper.create_exception(self.__exception_type, 'WLSDEPY-00132',
_format_exception(e), 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 enable_jms_store_db_persistence(self, jms_db_enabled):
"""
Enable jms database store persistence if set
"""
_method_name = 'enable_jms_store_db_persistence'
self.__logger.entering(class_name=self.__class_name, method_name=_method_name)
try:
if self.__load_global('isJMSStorePersistenceConfigurable')() and not \
self.__load_global('isJMSStoreDBPersistenceSet')() and \
jms_db_enabled:
self.__load_global('enableJMSStoreDBPersistence')(True)

except self.__load_global('WLSTException'), e:
pwe = exception_helper.create_exception(self.__exception_type, 'WLSDEPY-00131',
_format_exception(e), 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 __ls(self, method_name, ls_type, path=None, log_throwing=True):
"""
Private helper method shared by various API methods
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
"DynamicClusterServerGroupTargetingLimits": [ {"version": "[12.2.1.1,)", "wlst_mode": "both", "wlst_name": "dynamicClusterServerGroupTargetingLimits", "wlst_path": "WP001", "default_value": null, "wlst_type": "dict" } ],
"ServerStartMode": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "ServerStartMode", "wlst_path": "WP001", "default_value": null, "wlst_type": "string" } ],
"UseSampleDatabase": [ {"version": "[12.2.1,)", "wlst_mode": "offline", "wlst_name": "UseSampleDatabase", "wlst_path": "WP001", "default_value": null, "wlst_type": "string" } ],
"EnableJMSStoreDBPersistence": [ {"version": "[12.2.1.1,)", "wlst_mode": "offline", "wlst_name": "EnableJMSStoreDBPersistence", "wlst_path": "WP001", "default_value": false, "wlst_type": "boolean" } ],
"EnableJTATLogDBPersistence": [ {"version": "[12.2.1.1,)", "wlst_mode": "offline", "wlst_name": "EnableJTATLogDBPersistence", "wlst_path": "WP001", "default_value": false, "wlst_type": "boolean" } ],
"domainBin": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "domainBin", "wlst_path": "WP001", "default_value": null, "wlst_type": "list", "uses_path_tokens": "true" } ],
"domainLibraries": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "domainLibraries", "wlst_path": "WP001", "default_value": null, "wlst_type": "list", "uses_path_tokens": "true" } ]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ WLSDPLY-00127=Unable to load the DomainRuntimeService from the WLST globals : {0
WLSDPLY-00128=setTopologyProfile({0}) failed: {1}
WLSDPLY-00129=Error calling isSet() for attribute {0} at location {1}: {2}
WLSDPLY-00130=Failed to get the current MBean tree: {0}
WLSDEPY-00131=Failed to set JMS store to use database store: {0}
WLSDEPY-00132=Failed to set JTA transaction log store to use database store: {0}

###############################################################################
# Util messages (1000 - 3999) #
Expand Down

0 comments on commit 23c059d

Please sign in to comment.