Skip to content

Commit 2f761ff

Browse files
committed
adding virtual host discovery
1 parent d462e5a commit 2f761ff

File tree

3 files changed

+32
-1
lines changed

3 files changed

+32
-1
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,7 @@
299299
UPDATE_MODE = 'UpdateMode'
300300
USER = 'User'
301301
USER_ATTRIBUTES = 'UserAttribute'
302+
VIRTUAL_HOST = 'VirtualHost'
302303
VIRTUAL_TARGET = 'VirtualTarget'
303304
VIRTUAL_USER_AUTHENTICATOR = 'VirtualUserAuthenticator'
304305
WATCH = 'Watch'

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

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@ def discover(self):
102102
model_folder_name, folder_result = self._get_reliable_delivery_policies()
103103
discoverer.add_to_model_if_not_empty(self._dictionary, model_folder_name, folder_result)
104104

105+
model_folder_name, folder_result = self._get_virtual_hosts()
106+
discoverer.add_to_model_if_not_empty(self._dictionary, model_folder_name, folder_result)
107+
105108
model_folder_name, folder_result = self._get_xml_entity_caches()
106109
discoverer.add_to_model_if_not_empty(self._dictionary, model_folder_name, folder_result)
107110

@@ -471,6 +474,31 @@ def _get_reliable_delivery_policies(self):
471474
_logger.exiting(class_name=_class_name, method_name=_method_name, result=model_top_folder_name)
472475
return model_top_folder_name, result
473476

477+
def _get_virtual_hosts(self):
478+
"""
479+
Discover the virtual hosts that are present in the domain.
480+
:return: model name for the folder: dictionary containing the discovered virtual hosts
481+
"""
482+
_method_name = '_get_virtual_hosts'
483+
_logger.entering(class_name=_class_name, method_name=_method_name)
484+
model_top_folder_name = model_constants.VIRTUAL_HOST
485+
result = OrderedDict()
486+
location = LocationContext(self._base_location)
487+
location.append_location(model_top_folder_name)
488+
vhosts = self._find_names_in_folder(location)
489+
if vhosts is not None:
490+
_logger.info('WLSDPLY-06647', len(vhosts), class_name=_class_name, method_name=_method_name)
491+
name_token = self._aliases.get_name_token(location)
492+
for vhost in vhosts:
493+
_logger.info('WLSDPLY-06648', vhost, class_name=_class_name, method_name=_method_name)
494+
location.add_name_token(name_token, vhost)
495+
result[vhost] = OrderedDict()
496+
self._populate_model_parameters(result[vhost], location)
497+
location.remove_name_token(name_token)
498+
499+
_logger.exiting(class_name=_class_name, method_name=_method_name, result=model_top_folder_name)
500+
return model_top_folder_name, result
501+
474502
def _get_xml_entity_caches(self):
475503
"""
476504
Discover the XML entity caches that are used by the servers in the domain.

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -783,7 +783,7 @@ WLSDPLY-06629=Adding Log Filter {0}
783783
WLSDPLY-06630=Discovering {0} Reliable Delivery Policies
784784
WLSDPLY-06631=Adding Reliable Delivery Policy {0}
785785
WLSDPLY-06632=Discovering {0} XML Entity Caches
786-
WLSDPLY-06633=Adding XML Entity Cache{0}
786+
WLSDPLY-06633=Adding XML Entity Cache {0}
787787
WLSDPLY-06634=Discovering {0} XML Registries
788788
WLSDPLY-06635=Adding XML Registry {0}
789789
WLSDPLY-06636=Adding keystore file {0} for node manager to archive file
@@ -799,6 +799,8 @@ WLSDPLY-06642=Custom Keystore file {0} at location {1} is a kss type which is no
799799
WLSDPLY-06644=Adding Domain {0}
800800
WLSDPLY-06645=Machine is not present in domain. Remove SecurityConfiguration NodeManagerPasswordEncrypted default
801801
WLSDPLY-06646=Machine is present in domain so will not remove SecurityConfiguration NodeManagerPasswordEncrypted default
802+
WLSDPLY-06647=Discovering {0} Virtual Hosts
803+
WLSDPLY-06648=Adding Virtual Host {0}
802804

803805

804806
# multi_tenant_discoverer.py, multi_tenant_resources_dsi

0 commit comments

Comments
 (0)