Skip to content

Commit 4f4aecc

Browse files
continued changes for alias definitions
1 parent 8b8a703 commit 4f4aecc

File tree

14 files changed

+357
-58
lines changed

14 files changed

+357
-58
lines changed

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,10 @@ class AliasEntries(object):
111111
'UnixMachine': 'UnixMachine',
112112
'VirtualHost': 'VirtualHost',
113113
'VirtualTarget': 'VirtualTarget',
114-
'WLDFSystemResource': 'WLDFSystemResource'
114+
'WLDFSystemResource': 'WLDFSystemResource',
115+
'WSReliableDeliveryPolicy': 'WSReliableDeliveryPolicy',
116+
'XMLEntityCache': 'XMLEntityCache',
117+
'XMLRegistry': 'XMLRegistry'
115118
}
116119

117120
__topology_top_level_folders = [
@@ -130,7 +133,10 @@ class AliasEntries(object):
130133
'ServerTemplate',
131134
'UnixMachine',
132135
'VirtualHost',
133-
'VirtualTarget'
136+
'VirtualTarget',
137+
'WSReliableDeliveryPolicy',
138+
'XMLEntityCache',
139+
'XMLRegistry'
134140
]
135141

136142
__resources_top_level_folders = [

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,11 @@
252252
WLDF_INSTRUMENTATION_MONITOR = "WLDFInstrumentationMonitor"
253253
WLDF_RESOURCE = "WLDFResource"
254254
WLDF_SYSTEM_RESOURCE = "WLDFSystemResource"
255+
WS_RELIABLE_DELIVERY_POLICY = 'WSReliableDeliveryPolicy'
255256
XACML_AUTHORIZER = 'XACMLAuthorizer'
256257
XACML_ROLE_MAPPER = 'XACMLRoleMapper'
258+
XML_ENTITY_CACHE = 'XMLEntityCache'
259+
XML_REGISTRY = 'XMLRegistry'
257260

258261
# names of attributes, alphabetically
259262

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

Lines changed: 67 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@
4343
from wlsdeploy.aliases.model_constants import URL
4444
from wlsdeploy.aliases.model_constants import USER
4545
from wlsdeploy.aliases.model_constants import VIRTUAL_TARGET
46+
from wlsdeploy.aliases.model_constants import WS_RELIABLE_DELIVERY_POLICY
47+
from wlsdeploy.aliases.model_constants import XML_ENTITY_CACHE
48+
from wlsdeploy.aliases.model_constants import XML_REGISTRY
4649
from wlsdeploy.exception import exception_helper
4750
from wlsdeploy.exception.expection_types import ExceptionType
4851
from wlsdeploy.tool.create.creator import Creator
@@ -383,8 +386,7 @@ def __apply_base_domain_config(self, topology_folder_list):
383386
self.security_provider_creator.create_security_configuration(security_config_location)
384387
topology_folder_list.remove(SECURITY_CONFIGURATION)
385388

386-
self.__create_log_filters(location)
387-
topology_folder_list.remove(LOG_FILTER)
389+
self.__create_mbeans_used_by_topology_mbeans(location, topology_folder_list)
388390

389391
self.__create_machines(location)
390392
topology_folder_list.remove(MACHINE)
@@ -427,6 +429,21 @@ def __set_core_domain_params(self):
427429
self.logger.exiting(class_name=self.__class_name, method_name=_method_name)
428430
return
429431

432+
def __create_mbeans_used_by_topology_mbeans(self, location, topology_folder_list):
433+
"""
434+
Create the entities that are referenced by domain, machine, server and server template attributes.
435+
:param location: current location
436+
:raises: CreateException: if an error occurs
437+
"""
438+
self.__create_log_filters(location)
439+
topology_folder_list.remove(LOG_FILTER)
440+
self.__create_reliable_delivery_policy(location)
441+
topology_folder_list.remove(WS_RELIABLE_DELIVERY_POLICY)
442+
self.__create_xml_entity_cache(location)
443+
topology_folder_list.remove(XML_ENTITY_CACHE)
444+
self.__create_xml_registry(location)
445+
topology_folder_list.remove(XML_REGISTRY)
446+
430447
def __create_security_folder(self, location):
431448
"""
432449
Create the /Security folder objects, if any.
@@ -458,6 +475,54 @@ def __create_log_filters(self, location):
458475
self.logger.exiting(class_name=self.__class_name, method_name=_method_name)
459476
return
460477

478+
def __create_reliable_delivery_policy(self, location):
479+
"""
480+
Create the /WSReliableDeliverPolicy objects if any for use by the server and server templates.
481+
:param location: the location to use
482+
:raises: CreateException: if an error occurs
483+
"""
484+
_method_name = '__create_reliable_delivery_policy'
485+
486+
self.logger.entering(str(location), class_name=self.__class_name, method_name=_method_name)
487+
policy_nodes = dictionary_utils.get_dictionary_element(self._topology, WS_RELIABLE_DELIVERY_POLICY)
488+
489+
if len(policy_nodes) > 0:
490+
self._create_named_mbeans(WS_RELIABLE_DELIVERY_POLICY, policy_nodes, location, log_created=True)
491+
self.logger.exiting(class_name=self.__class_name, method_name=_method_name)
492+
return
493+
494+
def __create_xml_entity_cache(self, location):
495+
"""
496+
Create the /XMLEntityCache objects if any for use by the server and server templates.
497+
:param location: the location to use
498+
:raises: CreateException: if an error occurs
499+
"""
500+
_method_name = '__create_xml_entity_cache'
501+
502+
self.logger.entering(str(location), class_name=self.__class_name, method_name=_method_name)
503+
cache_nodes = dictionary_utils.get_dictionary_element(self._topology, XML_ENTITY_CACHE)
504+
505+
if len(cache_nodes) > 0:
506+
self._create_named_mbeans(XML_ENTITY_CACHE, cache_nodes, location, log_created=True)
507+
self.logger.exiting(class_name=self.__class_name, method_name=_method_name)
508+
return
509+
510+
def __create_xml_registry(self, location):
511+
"""
512+
Create the /XMLRegistry objects if any for use by the server and server templates.
513+
:param location: the location to use
514+
:raises: CreateException: if an error occurs
515+
"""
516+
_method_name = '__create_xml_registry'
517+
518+
self.logger.entering(str(location), class_name=self.__class_name, method_name=_method_name)
519+
registry_nodes = dictionary_utils.get_dictionary_element(self._topology, XML_REGISTRY)
520+
521+
if len(registry_nodes) > 0:
522+
self._create_named_mbeans(XML_REGISTRY, registry_nodes, location, log_created=True)
523+
self.logger.exiting(class_name=self.__class_name, method_name=_method_name)
524+
return
525+
461526
def __create_machines(self, location):
462527
"""
463528
Create the /Machine and /UnixMachine folder objects, if any.

core/src/main/python/wlsdeploy/tool/discover/topology_discoverer.py

Lines changed: 85 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,12 @@ def discover_domain_parameters(self):
261261
discoverer.add_to_model_if_not_empty(self._dictionary, model_folder_name, folder_result)
262262
model_folder_name, folder_result = self._get_log_filters()
263263
discoverer.add_to_model_if_not_empty(self._dictionary, model_folder_name, folder_result)
264+
model_folder_name, folder_result = self._get_reliable_delivery_policies()
265+
discoverer.add_to_model_if_not_empty(self._dictionary, model_folder_name, folder_result)
266+
model_folder_name, folder_result = self._get_xml_entity_caches()
267+
discoverer.add_to_model_if_not_empty(self._dictionary, model_folder_name, folder_result)
268+
model_folder_name, folder_result = self._get_xml_registries()
269+
discoverer.add_to_model_if_not_empty(self._dictionary, model_folder_name, folder_result)
264270
model_folder_name, folder_result = self._get_domain_log()
265271
discoverer.add_to_model_if_not_empty(self._dictionary, model_folder_name, folder_result)
266272
model_folder_name, folder_result = self._get_nm_properties()
@@ -370,6 +376,81 @@ def _get_log_filters(self):
370376
_logger.exiting(class_name=_class_name, method_name=_method_name, result=model_top_folder_name)
371377
return model_top_folder_name, result
372378

379+
def _get_reliable_delivery_policies(self):
380+
"""
381+
Discover the reliable delivery policies that are used for soap message delivery in the servers.
382+
:return: model name for the folder: dictionary containing the discovered ws reliable delivery policies
383+
"""
384+
_method_name = '_get_reliable_delivery_policies'
385+
_logger.entering(class_name=_class_name, method_name=_method_name)
386+
model_top_folder_name = model_constants.WS_RELIABLE_DELIVERY_POLICY
387+
result = OrderedDict()
388+
location = LocationContext(self._base_location)
389+
location.append_location(model_top_folder_name)
390+
policies = self._find_names_in_folder(location)
391+
if policies is not None:
392+
_logger.info('WLSDPLY-06630', len(policies), class_name=_class_name, method_name=_method_name)
393+
name_token = self._alias_helper.get_name_token(location)
394+
for policy in policies:
395+
_logger.info('WLSDPLY-06631', policy, class_name=_class_name, method_name=_method_name)
396+
location.add_name_token(name_token, policy)
397+
result[policy] = OrderedDict()
398+
self._populate_model_parameters(result[policy], location)
399+
location.remove_name_token(name_token)
400+
401+
_logger.exiting(class_name=_class_name, method_name=_method_name, result=model_top_folder_name)
402+
return model_top_folder_name, result
403+
404+
def _get_xml_entity_caches(self):
405+
"""
406+
Discover the XML entity caches that are used by the servers in the domain.
407+
:return: model name for the folder: dictionary containing the discovered xml entity caches
408+
"""
409+
_method_name = '_get_xml_entity_caches'
410+
_logger.entering(class_name=_class_name, method_name=_method_name)
411+
model_top_folder_name = model_constants.XML_ENTITY_CACHE
412+
result = OrderedDict()
413+
location = LocationContext(self._base_location)
414+
location.append_location(model_top_folder_name)
415+
caches = self._find_names_in_folder(location)
416+
if caches is not None:
417+
_logger.info('WLSDPLY-06632', len(caches), class_name=_class_name, method_name=_method_name)
418+
name_token = self._alias_helper.get_name_token(location)
419+
for cache in caches:
420+
_logger.info('WLSDPLY-06633', cache, class_name=_class_name, method_name=_method_name)
421+
location.add_name_token(name_token, cache)
422+
result[cache] = OrderedDict()
423+
self._populate_model_parameters(result[cache], location)
424+
location.remove_name_token(name_token)
425+
426+
_logger.exiting(class_name=_class_name, method_name=_method_name, result=model_top_folder_name)
427+
return model_top_folder_name, result
428+
429+
def _get_xml_registries(self):
430+
"""
431+
Discover the XML registries that are used by the servers.
432+
:return: model name for the folder: dictionary containing the discovered log xml registries
433+
"""
434+
_method_name = '_get_xml_registries'
435+
_logger.entering(class_name=_class_name, method_name=_method_name)
436+
model_top_folder_name = model_constants.XML_REGISTRY
437+
result = OrderedDict()
438+
location = LocationContext(self._base_location)
439+
location.append_location(model_top_folder_name)
440+
registries = self._find_names_in_folder(location)
441+
if registries is not None:
442+
_logger.info('WLSDPLY-06634', len(registries), class_name=_class_name, method_name=_method_name)
443+
name_token = self._alias_helper.get_name_token(location)
444+
for registry in registries:
445+
_logger.info('WLSDPLY-06635', registry, class_name=_class_name, method_name=_method_name)
446+
location.add_name_token(name_token, registry)
447+
result[registry] = OrderedDict()
448+
self._populate_model_parameters(result[registry], location)
449+
location.remove_name_token(name_token)
450+
451+
_logger.exiting(class_name=_class_name, method_name=_method_name, result=model_top_folder_name)
452+
return model_top_folder_name, result
453+
373454
def _get_nm_properties(self):
374455
"""
375456
Discover the NMProperties attributes.
@@ -505,11 +586,12 @@ def _add_keystore_file_to_archive(self, model_name, model_value, location):
505586
_method_name = '_add_keystore_file_to_archive'
506587
_logger.entering(model_name, str(location), class_name=_class_name, method_name=_method_name)
507588
server_name = self._get_server_name_from_location(location)
508-
archive_file = self._model_context.get_archive_file()
509589
_logger.finer('WLSDPLY-06223', model_value, server_name, class_name=_class_name, method_name=_method_name)
590+
archive_file = self._model_context.get_archive_file()
510591
file_path = self._convert_path(model_value)
511592
new_name = None
512-
try:6
593+
try:
594+
archive_file.addServerKeyStoreFile(server_name, File(file_path))
513595
except IllegalArgumentException, iae:
514596
_logger.warning('WLSDPLY-06624', server_name, file_path, iae.getLocalizedMessage(),
515597
class_name=_class_name, method_name=_method_name)
@@ -529,4 +611,4 @@ def _get_server_name_from_location(self, location):
529611
"""
530612
temp = LocationContext()
531613
temp.append_location(model_constants.SERVER)
532-
return location.get_name_for_token(self._alias_helper.get_name_token(temp))
614+
return location.get_name_for_token(self._alias_helper.get_name_token(temp))

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

Lines changed: 56 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@
7070
from wlsdeploy.aliases.model_constants import UNIFORM_DISTRIBUTED_TOPIC
7171
from wlsdeploy.aliases.model_constants import VIRTUAL_TARGET
7272
from wlsdeploy.aliases.model_constants import WATCH_NOTIFICATION
73+
from wlsdeploy.aliases.model_constants import WS_RELIABLE_DELIVERY_POLICY
74+
from wlsdeploy.aliases.model_constants import XML_ENTITY_CACHE
75+
from wlsdeploy.aliases.model_constants import XML_REGISTRY
7376

7477

7578
class AttributeSetter(object):
@@ -395,7 +398,59 @@ def set_log_filter_mbean(self, location, key, value, wlst_value):
395398
:param wlst_value: the existing value of the attribute from WLST
396399
:raises BundleAwareException of the specified type: if store is not found
397400
"""
398-
mbean = self.__find_log_filter_mbean(location, value)
401+
mbean = self.__find_in_location(LocationContext(), LOG_FILTER, value, required=True)
402+
self.set_attribute(location, key, mbean, wlst_merge_value=wlst_value, use_raw_value=True)
403+
return
404+
405+
def set_jms_server_mbean(self, location, key, value, wlst_value):
406+
"""
407+
For those entities, such as WLSReliableDeliveryPolicy, that take a single JMS Server mbean.
408+
:param location: location to look for jms server
409+
:param key: the attribute name
410+
:param value: the string value
411+
:param wlst_value: the existing value of the attribute from WLST
412+
:raises BundleAwareException of the specified type: if jms server mbean is not found.
413+
"""
414+
mbean = self.__find_in_location(LocationContext(), JMS_SERVER, value, required=True)
415+
self.set_attribute(location, key, mbean, wlst_merge_value=wlst_value, use_raw_value=True)
416+
return
417+
418+
def set_reliable_delivery_policy_mbean(self, location, key, value, wlst_value):
419+
"""
420+
Sets the ws soap reliable delivery policy mbean used by mbeans like Server and Server Template.
421+
:param location: location to look for reliable delivery policy
422+
:param key: the attribute name
423+
:param value: the string value
424+
:param wlst_value: the existing value of the attribute from WLST
425+
:raises BundleAwareException of the specified type: if reliable delivery policy mbean is not found.
426+
"""
427+
mbean = self.__find_in_location(LocationContext(), WS_RELIABLE_DELIVERY_POLICY, value, required=True)
428+
self.set_attribute(location, key, mbean, wlst_merge_value=wlst_value, use_raw_value=True)
429+
return
430+
431+
def set_xml_entity_cache_mbean(self, location, key, value, wlst_value):
432+
"""
433+
Sets the XML cache mbean used by topology entities such as Server.
434+
:param location: location to look for reliable delivery policy
435+
:param key: the attribute name
436+
:param value: the string value
437+
:param wlst_value: the existing value of the attribute from WLST
438+
:raises BundleAwareException of the specified type: if xml entity cache mbean is not found.
439+
"""
440+
mbean = self.__find_in_location(LocationContext(), XML_ENTITY_CACHE, value, required=True)
441+
self.set_attribute(location, key, mbean, wlst_merge_value=wlst_value, use_raw_value=True)
442+
return
443+
444+
def set_xml_registry_mbean(self, location, key, value, wlst_value):
445+
"""
446+
Sets the XML registry mbean used by topology entities such as Server.
447+
:param location: location to look for reliable delivery policy
448+
:param key: the attribute name
449+
:param value: the string value
450+
:param wlst_value: the existing value of the attribute from WLST
451+
:raises BundleAwareException of the specified type: if xml registry mbean is not found.
452+
"""
453+
mbean = self.__find_in_location(LocationContext(), XML_REGISTRY, value, required=True)
399454
self.set_attribute(location, key, mbean, wlst_merge_value=wlst_value, use_raw_value=True)
400455
return
401456

@@ -668,25 +723,6 @@ def __find_persistent_store(self, location, store_name):
668723
self.__logger.throwing(class_name=self._class_name, method_name=method_name, error=ex)
669724
raise ex
670725

671-
def __find_log_filter_mbean(self, location, filter_name):
672-
"""
673-
Find the domain level log filter with the specified name and return its WLST mbean.
674-
:param location: the WLST location of the attribute
675-
:param filter_name: the name of the log filter to find
676-
:return: the mbean for the log filter
677-
:raises BundleAwareException of the specified type: if log filter is not found
678-
"""
679-
method_name = '__find_log_filter_mbean'
680-
domain_location = self.__get_domain_location(location)
681-
mbean = self.__find_in_location(domain_location, LOG_FILTER, filter_name)
682-
if mbean is not None:
683-
return mbean
684-
685-
ex = exception_helper.create_exception(self.__exception_type, 'WLSDPLY-19208', filter_name,
686-
location.get_folder_path())
687-
self.__logger.throwing(class_name=self._class_name, method_name=method_name, error=ex)
688-
raise ex
689-
690726
def __find_saf_destination_mbean(self, location, destination_name):
691727
"""
692728
Find the SAF destination with the specified name and return its WLST mbean.
@@ -851,7 +887,6 @@ def __get_existing_object_list(self, location):
851887
def __merge_existing_items(self, items, existing_value):
852888
"""
853889
Merge the specified items with the items represented by existing value, and return the result.
854-
:param location: the location
855890
:param items: the attribute name
856891
:param existing_value: the value representing the existing items (may be a string or list)
857892
:return: the merged list of items

0 commit comments

Comments
 (0)