예제 #1
0
    def _add_jms_resources(self, resource_nodes, location):
        """
        Special processing to process child nodes in specific order
        :param resource_nodes: the JMS resource model nodes
        :param location: the location to add resources
        """
        if not len(resource_nodes):
            return

        location = LocationContext(location).append_location(JMS_RESOURCE)
        if not self._check_location(location):
            return
        deployer_utils.set_single_folder_token(location, self.aliases)

        # SAF imported destination may reference error handling, and vice versa
        self.topology_helper.create_placeholder_named_elements(
            location, SAF_ERROR_HANDLING, resource_nodes)
        # Error destinations for Topics, Queues, Templates reference other Topics, Queues
        self._create_placeholder_for_error_destinations(
            location, resource_nodes)

        for element_name in self.resource_elements:
            model_nodes = dictionary_utils.get_dictionary_element(
                resource_nodes, element_name)
            self._add_named_elements(element_name, model_nodes, location)
        return
    def get_datasources(self):
        """
        Discover JDBC datasource information from the domain.
        :return: model name for the dictionary and the dictionary containing the datasources information
        """
        _method_name = 'get_datasources'
        _logger.entering(class_name=_class_name, method_name=_method_name)
        result = OrderedDict()
        model_top_folder_name = model_constants.JDBC_SYSTEM_RESOURCE
        model_second_folder = model_constants.JDBC_RESOURCE
        location = LocationContext(self._base_location)
        location.append_location(model_top_folder_name)
        datasources = self._find_names_in_folder(location)
        if datasources is not None:
            _logger.info('WLSDPLY-06340',
                         len(datasources),
                         class_name=_class_name,
                         method_name=_method_name)
            typedef = self._model_context.get_domain_typedef()
            name_token = self._aliases.get_name_token(location)
            for datasource in datasources:
                if typedef.is_system_datasource(datasource):
                    _logger.info('WLSDPLY-06361',
                                 typedef.get_domain_type(),
                                 datasource,
                                 class_name=_class_name,
                                 method_name=_method_name)
                else:
                    _logger.info('WLSDPLY-06341',
                                 datasource,
                                 class_name=_class_name,
                                 method_name=_method_name)
                    result[datasource] = OrderedDict()
                    location.add_name_token(name_token, datasource)
                    self._populate_model_parameters(result[datasource],
                                                    location)

                    location.append_location(model_second_folder)
                    deployer_utils.set_single_folder_token(
                        location, self._aliases)
                    if self.wlst_cd(
                            self._aliases.get_wlst_attributes_path(location),
                            location):
                        result[datasource][model_second_folder] = OrderedDict()
                        resource_result = result[datasource][
                            model_second_folder]
                        self._populate_model_parameters(
                            resource_result, location)
                        self._discover_subfolders(resource_result, location)
                        location.remove_name_token(name_token)
                        location.pop_location()
        _logger.exiting(class_name=_class_name,
                        method_name=_method_name,
                        result=result)
        return model_top_folder_name, result
 def get_coherence_resource(self, location):
     """
     Discover the coherence resources for the domain. Collect custom configuration files and persistence
     directories into the archive file.
     :param location: context containing the current location information
     :return: model name for coherence resource: dictionary containing coherence resources.
     """
     _method_name = '_get_coherence_resource'
     _logger.entering(str(location), class_name=_class_name, method_name=_method_name)
     result = OrderedDict()
     model_top_folder_name = model_constants.COHERENCE_RESOURCE
     location.append_location(model_top_folder_name)
     deployer_utils.set_single_folder_token(location, self._aliases)
     self._populate_model_parameters(result, location)
     self._discover_subfolders(result, location)
     location.pop_location()
     _logger.exiting(class_name=_class_name, method_name=_method_name, result=result)
     return model_top_folder_name, result
 def _update_placeholder(self, type_name, name, location):
     """
     Make any required updates to a newly-created placeholder.
     :param type_name: the type name of the placeholder
     :param name: the name of the placeholder MBean
     :param location: the location of the placeholder
     """
     if type_name == JDBC_SYSTEM_RESOURCE:
         # for online update, Name must be assigned to each JDBCSystemResource / JdbcResource MBean.
         # (see datasource_deployer.set_attributes())
         child_location = LocationContext(location).append_location(JDBC_RESOURCE)
         deployer_utils.set_single_folder_token(child_location, self.aliases)
         wlst_path = self.aliases.get_wlst_attributes_path(child_location)
         if self.wlst_helper.path_exists(wlst_path):
             original_location = self.wlst_helper.get_pwd()
             self.wlst_helper.cd(wlst_path)
             existing_name = self.wlst_helper.get('Name')
             if existing_name is None:
                 self.wlst_helper.set('Name', name)
             self.wlst_helper.cd(original_location)
예제 #5
0
 def _get_jms_resources(self, location):
     _method_name = '_get_jms_resources'
     _logger.entering(class_name=_class_name, method_name=_method_name)
     result = OrderedDict()
     model_name = model_constants.JMS_RESOURCE
     location.append_location(model_name)
     deployer_utils.set_single_folder_token(location, self._aliases)
     self._populate_model_parameters(result, location)
     wlst_subfolders = self._find_subfolders(location)
     if wlst_subfolders is not None:
         for wlst_subfolder in wlst_subfolders:
             model_subfolder_name = self._get_model_name(location, wlst_subfolder)
             if model_subfolder_name:
                 if model_subfolder_name == model_constants.TEMPLATE:
                     model_subfolder_name, subfolder_result = self._get_jms_templates(location)
                     discoverer.add_to_model_if_not_empty(result, model_subfolder_name, subfolder_result)
                 elif model_subfolder_name == model_constants.FOREIGN_SERVER:
                     model_subfolder_name, subfolder_result = self._get_foreign_servers(location)
                     discoverer.add_to_model_if_not_empty(result, model_subfolder_name, subfolder_result)
                 else:
                     self._discover_subfolder(model_subfolder_name, location, result)
     location.pop_location()
     _logger.exiting(class_name=_class_name, method_name=_method_name, result=result)
     return model_name, result