Skip to content
Merged
Show file tree
Hide file tree
Changes from 11 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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Many organizations are using WebLogic Server, with or without other Oracle Fusio
- [JRF Trust Service Identity Asserter](site/security_providers.md#trust-service-identity-asserter)
- [Custom Security Providers](site/security_providers.md#custom-security-providers)
- [Modeling WebLogic Users, Groups, and Roles](site/security_users_groups_roles.md)
- [ODL Configuration](site/odl_configuration.md)
- [Variable Injection](site/variable_injection.md)
- [Model Filters](site/tool_filters.md)
- [Downloading and Installing](#downloading-and-installing-the-software)
Expand Down
2 changes: 2 additions & 0 deletions core/src/main/python/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,8 @@ def __deploy_offline(model, model_context, aliases):
__close_domain_on_error()
raise ex

model_deployer.deploy_model_after_update(model, model_context, aliases, wlst_mode=__wlst_mode)

try:
__wlst_helper.close_domain()
except BundleAwareException, ex:
Expand Down
2 changes: 2 additions & 0 deletions core/src/main/python/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,8 @@ def __update_offline(model, model_context, aliases):
__close_domain_on_error()
raise ex

model_deployer.deploy_model_after_update(model, model_context, aliases, wlst_mode=__wlst_mode)

try:
__wlst_helper.close_domain()
except BundleAwareException, ex:
Expand Down
88 changes: 30 additions & 58 deletions core/src/main/python/wlsdeploy/aliases/alias_entries.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
from wlsdeploy.aliases import password_utils
from wlsdeploy.aliases.alias_constants import ChildFoldersTypes
from wlsdeploy.aliases.location_context import LocationContext
from wlsdeploy.aliases.model_constants import APPLICATION
from wlsdeploy.aliases.model_constants import ODL_CONFIGURATION
from wlsdeploy.aliases.model_constants import RESOURCE_MANAGER
from wlsdeploy.aliases.validation_codes import ValidationCodes
from wlsdeploy.aliases.wlst_modes import WlstModes
from wlsdeploy.exception import exception_helper
Expand Down Expand Up @@ -71,57 +74,6 @@ class AliasEntries(object):
__category_modules_dir_name = 'oracle/weblogic/deploy/aliases/category_modules/'
__domain_category = 'Domain'

__model_categories_map = {
'AdminConsole': 'AdminConsole',
'Application': 'AppDeployment',
'Cluster': 'Cluster',
'CoherenceClusterSystemResource': 'CoherenceClusterSystemResource',
'Domain': 'Domain',
'EmbeddedLDAP': 'EmbeddedLDAP',
'FileStore': 'FileStore',
'ForeignJNDIProvider': 'ForeignJNDIProvider',
'JDBCStore': 'JDBCStore',
'JDBCSystemResource': 'JDBCSystemResource',
'JMSBridgeDestination': 'JMSBridgeDestination',
'JMSServer': 'JMSServer',
'JMSSystemResource': 'JMSSystemResource',
'JMX': 'JMX',
'JTA': 'JTA',
'Library': 'Library',
'Log': 'Log',
'LogFilter': 'LogFilter',
'Machine': 'Machine',
'MailSession': 'MailSession',
'MessagingBridge': 'MessagingBridge',
'MigratableTarget': 'MigratableTarget',
'NMProperties': 'NMProperties',
'Partition': 'Partition',
'PartitionWorkManager': 'PartitionWorkManager',
'PathService': 'PathService',
'ResourceGroup': 'ResourceGroup',
'ResourceGroupTemplate': 'ResourceGroupTemplate',
'ResourceManagement': 'ResourceManagement',
'ResourceManager': 'ResourceManager',
'RestfulManagementServices': 'RestfulManagementServices',
'SAFAgent': 'SAFAgent',
'Security': 'Security',
'SecurityConfiguration': 'SecurityConfiguration',
'SelfTuning': 'SelfTuning',
'Server': 'Server',
'ServerTemplate': 'ServerTemplate',
'ShutdownClass': 'ShutdownClass',
'SingletonService' : 'SingletonService',
'StartupClass': 'StartupClass',
'UnixMachine': 'UnixMachine',
'VirtualHost': 'VirtualHost',
'VirtualTarget': 'VirtualTarget',
'WebAppContainer': 'WebAppContainer',
'WLDFSystemResource': 'WLDFSystemResource',
'WSReliableDeliveryPolicy': 'WSReliableDeliveryPolicy',
'XMLEntityCache': 'XMLEntityCache',
'XMLRegistry': 'XMLRegistry'
}

__topology_top_level_folders = [
'AdminConsole',
'Cluster',
Expand Down Expand Up @@ -157,6 +109,7 @@ class AliasEntries(object):
'JMSSystemResource',
'MailSession',
'MessagingBridge',
ODL_CONFIGURATION,
'Partition',
'PartitionWorkManager',
'PathService',
Expand All @@ -177,6 +130,8 @@ class AliasEntries(object):
'Library'
]

__all_model_categories = []

__domain_info_attributes_and_types = {
'AdminUserName': 'string',
'AdminPassword': 'password',
Expand Down Expand Up @@ -210,6 +165,11 @@ def __init__(self, wlst_mode=WlstModes.OFFLINE, wls_version=None):
self._wls_helper = WebLogicHelper(_logger, wls_version)
self._wls_version = wls_version

self.__all_model_categories.extend(self.__topology_top_level_folders)
self.__all_model_categories.extend(self.__resources_top_level_folders)
self.__all_model_categories.extend(self.__app_deployments_top_level_folders)
self.__all_model_categories.append(RESOURCE_MANAGER)

return

def get_dictionary_for_location(self, location, resolve=True):
Expand Down Expand Up @@ -240,7 +200,7 @@ def get_model_domain_subfolder_names(self):
_method_name = 'get_model_domain_subfolder_names'

_logger.entering(class_name=_class_name, method_name=_method_name)
folder_list = list(self.__model_categories_map.keys())
folder_list = list(self.__all_model_categories)
#
# Remove all folders that do not appear at the WLST root level
#
Expand Down Expand Up @@ -898,12 +858,24 @@ def _unit_test_only_get_category_map_files(self):
:return: blob of stuff
"""
result = {}
for key, value in self.__model_categories_map.iteritems():
category_file_name = '%s.json' % value
for key in self.__all_model_categories:
category_file_name = '%s.json' % self._get_category_file_prefix(key)
category_file_path = '%s%s' % (self.__category_modules_dir_name, category_file_name)
result[key] = category_file_path
return result

def _get_category_file_prefix(self, category_name):
"""
Return the file prefix for the specified top-level category.
The file prefix should match the category name exactly.
File name for Application is different for some reason
:param category_name: the name to be checked
:return: the corressponding file name prefix
"""
if category_name == APPLICATION:
return 'AppDeployment'
return category_name

def __get_dictionary_for_location(self, location, resolve_path_tokens=True):
"""
Get the dictionary for a location with or without path tokens resolved
Expand All @@ -925,7 +897,7 @@ def __get_dictionary_for_location(self, location, resolve_path_tokens=True):
model_category_name = self.__domain_category
else:
model_category_name = location_folders[0]
if model_category_name not in self.__model_categories_map:
if model_category_name not in self.__all_model_categories:
ex = exception_helper.create_alias_exception('WLSDPLY-08116', model_category_name)
_logger.throwing(ex, class_name=_class_name, method_name=_method_name)
raise ex
Expand Down Expand Up @@ -977,7 +949,7 @@ def __load_category(self, model_category_name):
_method_name = '__load_category'

_logger.entering(model_category_name, class_name=_class_name, method_name=_method_name)
model_category_file = self.__model_categories_map[model_category_name]
model_category_file = self._get_category_file_prefix(model_category_name)
raw_category_dict = self.__load_category_file(model_category_file)
_logger.fine('WLSDPLY-08118', model_category_name, class_name=_class_name, method_name=_method_name)

Expand Down Expand Up @@ -1067,8 +1039,8 @@ def __load_contains_categories(self, model_category_name, raw_model_dict, base_p

contained_folders = raw_model_dict[CONTAINS]
for contained_folder in contained_folders:
if contained_folder in self.__model_categories_map:
folder_file = self.__model_categories_map[contained_folder]
if contained_folder in self.__all_model_categories:
folder_file = self._get_category_file_prefix(contained_folder)
else:
ex = exception_helper.create_alias_exception('WLSDPLY-08122', contained_folder, model_category_name)
_logger.throwing(ex, class_name=_class_name, method_name=_method_name)
Expand Down
1 change: 1 addition & 0 deletions core/src/main/python/wlsdeploy/aliases/model_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@
NODE_MANAGER_PW_ENCRYPTED = 'NodeManagerPasswordEncrypted'
NODE_MANAGER_USER_NAME = 'NodeManagerUsername'
NOVELL_AUTHENTICATOR = 'NovellAuthenticator'
ODL_CONFIGURATION = 'ODLConfiguration'
OPEN_LDAP_AUTHENTICATOR = 'OpenLDAPAuthenticator'
ORACLE_OID_AUTHENTICATOR = 'OracleInternetDirectoryAuthenticator'
ORACLE_OUD_AUTHENTICATOR = 'OracleUnifiedDirectoryAuthenticator'
Expand Down
3 changes: 3 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 @@ -364,6 +364,9 @@ def __deploy(self):
self._configure_security_configuration()
self.__deploy_resources_and_apps()
self.wlst_helper.update_domain()

model_deployer.deploy_model_after_update(self.model, self.model_context, self.aliases)

self.wlst_helper.close_domain()
return

Expand Down
22 changes: 22 additions & 0 deletions core/src/main/python/wlsdeploy/tool/deploy/model_deployer.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,28 @@ def deploy_model_offline(model, model_context, aliases, wlst_mode=WlstModes.OFFL
return


def deploy_model_after_update(model, model_context, aliases, wlst_mode=WlstModes.OFFLINE):
"""
Deploy the resources that must be done after WLST updateDomain.
:param model: the model
:param model_context: the model context
:param aliases: the aliases object
:param wlst_mode: the WLST mode to use
:raises DeployException: if an error occurs
"""
_method_name = 'deploy_model_offline_after_update'

try:
location = LocationContext()
resources_deployer = ResourcesDeployer(model, model_context, aliases, wlst_mode=wlst_mode)
resources_deployer.deploy_after_update(location)
except PyWLSTException, pwe:
ex = exception_helper.create_deploy_exception('WLSDPLY-09650', pwe.getLocalizedMessage(), error=pwe)
_logger.throwing(ex, class_name=_class_name, method_name=_method_name)
raise ex
return


def deploy_resources_and_apps_for_create(model, model_context, aliases):
"""
Deploy the resources and appDeployments sections after create handles the topology section of the model.
Expand Down
Loading