|
1 | 1 | """
|
2 |
| -Copyright (c) 2017, 2020, Oracle Corporation and/or its affiliates. |
| 2 | +Copyright (c) 2017, 2022, Oracle Corporation and/or its affiliates. |
3 | 3 | Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
|
4 | 4 | """
|
5 | 5 | from java.io import File
|
@@ -102,6 +102,9 @@ def discover(self):
|
102 | 102 | model_folder_name, folder_result = self._get_reliable_delivery_policies()
|
103 | 103 | discoverer.add_to_model_if_not_empty(self._dictionary, model_folder_name, folder_result)
|
104 | 104 |
|
| 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 | + |
105 | 108 | model_folder_name, folder_result = self._get_xml_entity_caches()
|
106 | 109 | discoverer.add_to_model_if_not_empty(self._dictionary, model_folder_name, folder_result)
|
107 | 110 |
|
@@ -471,6 +474,31 @@ def _get_reliable_delivery_policies(self):
|
471 | 474 | _logger.exiting(class_name=_class_name, method_name=_method_name, result=model_top_folder_name)
|
472 | 475 | return model_top_folder_name, result
|
473 | 476 |
|
| 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 | + |
474 | 502 | def _get_xml_entity_caches(self):
|
475 | 503 | """
|
476 | 504 | Discover the XML entity caches that are used by the servers in the domain.
|
|
0 commit comments