def get_foreign_jndi_providers(self):
     """
     Discover Foreign JNDI providers from the domain.
     :return: model name for the dictionary and the dictionary containing the foreign JNDI provider information
     """
     _method_name = 'get_foreign_jndi_providers'
     _logger.entering(class_name=_class_name, method_name=_method_name)
     result = OrderedDict()
     model_top_folder_name = model_constants.FOREIGN_JNDI_PROVIDER
     location = LocationContext(self._base_location)
     location.append_location(model_top_folder_name)
     providers = self._find_names_in_folder(location)
     if providers is not None:
         _logger.info('WLSDPLY-06342',
                      len(providers),
                      class_name=_class_name,
                      method_name=_method_name)
         name_token = self._alias_helper.get_name_token(location)
         for provider in providers:
             _logger.info('WLSDPLY-06343',
                          provider,
                          class_name=_class_name,
                          method_name=_method_name)
             location.add_name_token(name_token, provider)
             result[provider] = OrderedDict()
             self._populate_model_parameters(result[provider], location)
             self._discover_subfolders(result[provider], location)
             location.remove_name_token(name_token)
     _logger.exiting(class_name=_class_name,
                     method_name=_method_name,
                     result=model_top_folder_name)
     return model_top_folder_name, result
 def get_jdbc_stores(self):
     """
     Discover the JDBC stores used for weblogic persistence
     :return: model file name: dictionary containing discovered JDBC stores
     """
     _method_name = 'get_jdbc_stores'
     _logger.entering(class_name=_class_name, method_name=_method_name)
     result = OrderedDict()
     model_top_folder_name = model_constants.JDBC_STORE
     location = LocationContext(self._base_location)
     location.append_location(model_top_folder_name)
     jdbc_stores = self._find_names_in_folder(location)
     if jdbc_stores is not None:
         _logger.info('WLSDPLY-06350',
                      len(jdbc_stores),
                      class_name=_class_name,
                      method_name=_method_name)
         name_token = self._alias_helper.get_name_token(location)
         for jdbc_store in jdbc_stores:
             _logger.info('WLSDPLY-06351',
                          jdbc_store,
                          class_name=_class_name,
                          method_name=_method_name)
             result[jdbc_store] = OrderedDict()
             location.add_name_token(name_token, jdbc_store)
             self._populate_model_parameters(result[jdbc_store], location)
             self.archive_jdbc_create_script(jdbc_store, result[jdbc_store])
             location.remove_name_token(name_token)
     _logger.exiting(class_name=_class_name,
                     method_name=_method_name,
                     result=result)
     return model_top_folder_name, result
Beispiel #3
0
    def _get_xml_entity_caches(self):
        """
        Discover the XML entity caches that are used by the servers in the domain.
        :return: model name for the folder: dictionary containing the discovered xml entity caches
        """
        _method_name = '_get_xml_entity_caches'
        _logger.entering(class_name=_class_name, method_name=_method_name)
        model_top_folder_name = model_constants.XML_ENTITY_CACHE
        result = OrderedDict()
        location = LocationContext(self._base_location)
        location.append_location(model_top_folder_name)
        caches = self._find_names_in_folder(location)
        if caches is not None:
            _logger.info('WLSDPLY-06632',
                         len(caches),
                         class_name=_class_name,
                         method_name=_method_name)
            name_token = self._alias_helper.get_name_token(location)
            for cache in caches:
                _logger.info('WLSDPLY-06633',
                             cache,
                             class_name=_class_name,
                             method_name=_method_name)
                location.add_name_token(name_token, cache)
                result[cache] = OrderedDict()
                self._populate_model_parameters(result[cache], location)
                location.remove_name_token(name_token)

        _logger.exiting(class_name=_class_name,
                        method_name=_method_name,
                        result=model_top_folder_name)
        return model_top_folder_name, result
Beispiel #4
0
    def _get_xml_registries(self):
        """
        Discover the XML registries that are used by the servers.
        :return: model name for the folder: dictionary containing the discovered log xml registries
        """
        _method_name = '_get_xml_registries'
        _logger.entering(class_name=_class_name, method_name=_method_name)
        model_top_folder_name = model_constants.XML_REGISTRY
        result = OrderedDict()
        location = LocationContext(self._base_location)
        location.append_location(model_top_folder_name)
        registries = self._find_names_in_folder(location)
        if registries is not None:
            _logger.info('WLSDPLY-06634',
                         len(registries),
                         class_name=_class_name,
                         method_name=_method_name)
            name_token = self._alias_helper.get_name_token(location)
            for registry in registries:
                _logger.info('WLSDPLY-06635',
                             registry,
                             class_name=_class_name,
                             method_name=_method_name)
                location.add_name_token(name_token, registry)
                result[registry] = OrderedDict()
                self._populate_model_parameters(result[registry], location)
                location.remove_name_token(name_token)

        _logger.exiting(class_name=_class_name,
                        method_name=_method_name,
                        result=model_top_folder_name)
        return model_top_folder_name, result
Beispiel #5
0
    def _get_log_filters(self):
        """
        Discover the log filters that are used in the different types of Logs in the domain.
        :return: model name for the folder: dictionary containing the discovered log filters
        """
        _method_name = '_get_log_filters'
        _logger.entering(class_name=_class_name, method_name=_method_name)
        model_top_folder_name = model_constants.LOG_FILTER
        result = OrderedDict()
        location = LocationContext(self._base_location)
        location.append_location(model_top_folder_name)
        filters = self._find_names_in_folder(location)
        if filters is not None:
            _logger.info('WLSDPLY-06628',
                         len(filters),
                         class_name=_class_name,
                         method_name=_method_name)
            name_token = self._alias_helper.get_name_token(location)
            for logfilter in filters:
                _logger.info('WLSDPLY-06629',
                             logfilter,
                             class_name=_class_name,
                             method_name=_method_name)
                location.add_name_token(name_token, logfilter)
                result[logfilter] = OrderedDict()
                self._populate_model_parameters(result[logfilter], location)
                location.remove_name_token(name_token)

        _logger.exiting(class_name=_class_name,
                        method_name=_method_name,
                        result=model_top_folder_name)
        return model_top_folder_name, result
Beispiel #6
0
    def _get_reliable_delivery_policies(self):
        """
        Discover the reliable delivery policies that are used for soap message delivery in the servers.
        :return: model name for the folder: dictionary containing the discovered ws reliable delivery policies
        """
        _method_name = '_get_reliable_delivery_policies'
        _logger.entering(class_name=_class_name, method_name=_method_name)
        model_top_folder_name = model_constants.WS_RELIABLE_DELIVERY_POLICY
        result = OrderedDict()
        location = LocationContext(self._base_location)
        location.append_location(model_top_folder_name)
        policies = self._find_names_in_folder(location)
        if policies is not None:
            _logger.info('WLSDPLY-06630',
                         len(policies),
                         class_name=_class_name,
                         method_name=_method_name)
            name_token = self._alias_helper.get_name_token(location)
            for policy in policies:
                _logger.info('WLSDPLY-06631',
                             policy,
                             class_name=_class_name,
                             method_name=_method_name)
                location.add_name_token(name_token, policy)
                result[policy] = OrderedDict()
                self._populate_model_parameters(result[policy], location)
                location.remove_name_token(name_token)

        _logger.exiting(class_name=_class_name,
                        method_name=_method_name,
                        result=model_top_folder_name)
        return model_top_folder_name, result
Beispiel #7
0
 def get_server_templates(self):
     """
     Discover Server Templates in the domain.
     :return: model name for the dictionary and the dictionary containing the server template information
     """
     _method_name = 'get_server_templates'
     _logger.entering(class_name=_class_name, method_name=_method_name)
     result = OrderedDict()
     model_top_folder_name = model_constants.SERVER_TEMPLATE
     location = LocationContext(self._base_location)
     location.append_location(model_top_folder_name)
     templates = self._find_names_in_folder(location)
     if templates is not None:
         _logger.info('WLSDPLY-06605',
                      len(templates),
                      class_name=_class_name,
                      method_name=_method_name)
         name_token = self._alias_helper.get_name_token(location)
         for template in templates:
             _logger.info('WLSDPLY-06606',
                          template,
                          class_name=_class_name,
                          method_name=_method_name)
             location.add_name_token(name_token, template)
             result[template] = OrderedDict()
             self._populate_model_parameters(result[template], location)
             self._discover_subfolders(result[template], location)
             location.remove_name_token(name_token)
     _logger.exiting(class_name=_class_name,
                     method_name=_method_name,
                     result=result)
     return model_top_folder_name, result
    def get_singleton_service(self):
        """
        Discover the SingletonService global resource settings
        :return: model name for the folder: dictionary containing the discovered SingletonService
        """
        _method_name = 'get_singleton_service'
        _logger.entering(class_name=_class_name, method_name=_method_name)
        model_top_folder_name = model_constants.SINGLETON_SERVICE
        result = OrderedDict()
        location = LocationContext(self._base_location)
        location.append_location(model_top_folder_name)
        singleton_services = self._find_names_in_folder(location)
        if singleton_services is not None:
            _logger.info('WLSDPLY-06445',
                         len(singleton_services),
                         class_name=_class_name,
                         method_name=_method_name)
            name_token = self._alias_helper.get_name_token(location)
            for singleton_service in singleton_services:
                _logger.info('WLSDPLY-06446',
                             singleton_service,
                             class_name=_class_name,
                             method_name=_method_name)
                result[singleton_service] = OrderedDict()
                location.add_name_token(name_token, singleton_service)
                self._populate_model_parameters(result[singleton_service],
                                                location)
                location.remove_name_token(name_token)

        _logger.exiting(class_name=_class_name,
                        method_name=_method_name,
                        result=model_top_folder_name)
        return model_top_folder_name, result
    def get_wtc_servers(self):
        """
        Discover the WTC servers from the domain.
        :return: model folder name: dictionary containing the discovered WTCServers
        """
        _method_name = 'get_wtc_servers'
        _logger.entering(class_name=_class_name, method_name=_method_name)
        model_top_folder_name = model_constants.WTC_SERVER
        result = OrderedDict()
        location = LocationContext(self._base_location)
        location.append_location(model_top_folder_name)
        wtc_servers = self._find_names_in_folder(location)
        if wtc_servers is not None:
            _logger.info('WLSDPLY-06451',
                         len(wtc_servers),
                         class_name=_class_name,
                         method_name=_method_name)
            name_token = self._aliases.get_name_token(location)
            for wtc_server in wtc_servers:
                _logger.info('WLSDPLY-06452',
                             wtc_server,
                             class_name=_class_name,
                             method_name=_method_name)
                result[wtc_server] = OrderedDict()
                location.add_name_token(name_token, wtc_server)
                self._populate_model_parameters(result[wtc_server], location)
                self._discover_subfolders(result[wtc_server], location)
                location.remove_name_token(name_token)

        _logger.exiting(class_name=_class_name,
                        method_name=_method_name,
                        result=result)
        return model_top_folder_name, result
 def get_path_services(self):
     """
     Discover the path services for weblogic message grouping.
     :return: model file name: dictionary containing discovered path services
     """
     _method_name = 'get_path_services'
     _logger.entering(class_name=_class_name, method_name=_method_name)
     result = OrderedDict()
     model_top_folder_name = model_constants.PATH_SERVICE
     location = LocationContext(self._base_location)
     location.append_location(model_top_folder_name)
     path_services = self._find_names_in_folder(location)
     if path_services is not None:
         _logger.info('WLSDPLY-06355',
                      len(path_services),
                      class_name=_class_name,
                      method_name=_method_name)
         name_token = self._alias_helper.get_name_token(location)
         for path_service in path_services:
             _logger.info('WLSDPLY-06356',
                          path_service,
                          class_name=_class_name,
                          method_name=_method_name)
             result[path_service] = OrderedDict()
             location.add_name_token(name_token, path_service)
             self._populate_model_parameters(result[path_service], location)
             location.remove_name_token(name_token)
     _logger.exiting(class_name=_class_name,
                     method_name=_method_name,
                     result=result)
     return model_top_folder_name, result
    def _get_named_resources(self, folder_name):
        """
        Discover each resource of the specified type in the domain.
        :return: model name and dictionary for the discovered resources
        """
        _method_name = '_get_named_resources'
        _logger.entering(folder_name, class_name=_class_name, method_name=_method_name)

        result = OrderedDict()
        model_top_folder_name = folder_name
        location = LocationContext(self._base_location)
        location.append_location(model_top_folder_name)
        resource_names = self._find_names_in_folder(location)
        if resource_names is not None:
            _logger.info('WLSDPLY-06364', len(resource_names), folder_name, class_name=_class_name,
                         method_name=_method_name)
            name_token = self._alias_helper.get_name_token(location)
            for resource_name in resource_names:
                _logger.info('WLSDPLY-06365', folder_name, resource_name, class_name=_class_name,
                             method_name=_method_name)
                location.add_name_token(name_token, resource_name)
                result[resource_name] = OrderedDict()
                self._populate_model_parameters(result[resource_name], location)
                self._discover_subfolders(result[resource_name], location)
                location.remove_name_token(name_token)
        _logger.exiting(class_name=_class_name, method_name=_method_name, result=model_top_folder_name)
        return model_top_folder_name, result
 def _get_virtual_targets(self):
     """
     Discover the virtual targets used for targeting partition resources.
     :return: model name for virtual targets:dictionary with the discovered virtual targets
     """
     _method_name = '_get_virtual_targets'
     _logger.entering(class_name=_class_name, method_name=_method_name)
     result = OrderedDict()
     model_top_folder_name = model_constants.VIRTUAL_TARGET
     location = LocationContext(self._base_location)
     location.append_location(model_top_folder_name)
     targets = self._find_names_in_folder(location)
     if targets:
         _logger.info('WLSDPLY-06710',
                      len(targets),
                      class_name=_class_name,
                      method_name=_method_name)
         name_token = self._alias_helper.get_name_token(location)
         for target in targets:
             _logger.info('WLSDPLY-06711',
                          target,
                          class_name=_class_name,
                          method_name=_method_name)
             location.add_name_token(name_token, target)
             result[target] = OrderedDict()
             self._populate_model_parameters(result[target], location)
             self._discover_subfolders(result[target], location)
             location.remove_name_token(name_token)
     _logger.exiting(class_name=_class_name,
                     method_name=_method_name,
                     result=model_top_folder_name)
     return model_top_folder_name, result
Beispiel #13
0
 def get_resource_group_templates(self):
     """
     Discover the resource group templates used by one to many partitions. Discover the resources that
     are contained by the resource group template.
     :return: model name for template:dictionary containing discovered resource group templates
     """
     _method_name = 'get_resource_group_templates'
     _logger.entering(class_name=_class_name, method_name=_method_name)
     result = OrderedDict()
     model_top_folder_name = model_constants.RESOURCE_GROUP_TEMPLATE
     location = LocationContext(self._base_location)
     location.append_location(model_top_folder_name)
     templates = self._find_names_in_folder(location)
     if templates is not None:
         _logger.info('WLSDPLY-06701', len(templates), class_name=_class_name, method_name=_method_name)
         name_token = self._alias_helper.get_name_token(location)
         for template in templates:
             _logger.info('WLSDPLY-06702', template, class_name=_class_name, method_name=_method_name)
             location.add_name_token(name_token, template)
             result[template] = self._discover_single_folder(location)
             CommonResourcesDiscoverer(self._model_context, result[template],
                                       wlst_mode=self._wlst_mode, base_location=location).discover()
             DeploymentsDiscoverer(self._model_context, result[template],
                                   wlst_mode=self._wlst_mode, base_location=location).discover()
             location.remove_name_token(name_token)
     _logger.exiting(class_name=_class_name, method_name=_method_name, result=model_top_folder_name)
     return model_top_folder_name, result
Beispiel #14
0
 def get_resource_groups(self, base_location):
     """
     Discover the resource groups located at the indicated base_location - global or partition.
     :param base_location: context containing the current location information
     :return: model name for dictionary:dictionary containing the discovered resource groups
     """
     _method_name = 'get_resource_groups'
     _logger.entering(str(base_location), class_name=_class_name, method_name=_method_name)
     result = OrderedDict()
     model_top_folder_name = model_constants.RESOURCE_GROUP
     location = LocationContext(base_location)
     location.append_location(model_top_folder_name)
     resource_groups = self._find_names_in_folder(location)
     if resource_groups is not None:
         _logger.info('WLSDPLY-06703', len(resource_groups), class_name=_class_name, method_name=_method_name)
         name_token = self._alias_helper.get_name_token(location)
         for resource_group in resource_groups:
             _logger.info('WLSDPLY-06704', resource_group, self._alias_helper.get_model_folder_path(location),
                          class_name=_class_name, method_name=_method_name)
             location.add_name_token(name_token, resource_group)
             result[resource_group] = self._discover_single_folder(location)
             CommonResourcesDiscoverer(self._model_context, result[resource_group], base_location,
                                       wlst_mode=self._wlst_mode, aliases=self._aliases).discover()
             DeploymentsDiscoverer(self._model_context, result[resource_group], base_location,
                                   wlst_mode=self._wlst_mode, aliases=self._aliases).discover()
             location.remove_name_token(name_token)
     _logger.exiting(class_name=_class_name, method_name=_method_name, result=model_top_folder_name)
     return model_top_folder_name, result
Beispiel #15
0
    def get_jms_servers(self):
        """
        Discover the JMS servers from the domain.
        :return: model folder name: dictionary containing the discovered JMS servers
        """
        _method_name = 'get_jms_servers'
        _logger.entering(class_name=_class_name, method_name=_method_name)
        result = OrderedDict()
        model_top_folder_name = model_constants.JMS_SERVER
        location = LocationContext(self._base_location)
        location.append_location(model_top_folder_name)
        jms_servers = self._find_names_in_folder(location)
        if jms_servers is not None:
            _logger.info('WLSDPLY-06470', len(jms_servers), class_name=_class_name, method_name=_method_name)
            name_token = self._alias_helper.get_name_token(location)
            for jms_server in jms_servers:
                _logger.info('WLSDPLY-06471', jms_server, class_name=_class_name, method_name=_method_name)
                location.add_name_token(name_token, jms_server)
                result[jms_server] = OrderedDict()
                self._populate_model_parameters(result[jms_server], location)
                self._discover_subfolders(result[jms_server], location)
                location.remove_name_token(name_token)

        _logger.exiting(class_name=_class_name, method_name=_method_name, result=result)
        return model_top_folder_name, result
Beispiel #16
0
 def get_partitions(self):
     """
     Discover the partitions for the domain, including partition resources and resource groups.
     :return: model name for the dictionary:dictionary containing the discovered partitions
     """
     _method_name = 'get_partitions'
     _logger.entering(class_name=_class_name, method_name=_method_name)
     result = OrderedDict()
     model_top_folder_name = model_constants.PARTITION
     location = LocationContext(self._base_location)
     location.append_location(model_top_folder_name)
     partitions = self._find_names_in_folder(location)
     if partitions is not None:
         _logger.info('WLSDPLY-06705', len(partitions), class_name=_class_name, method_name=_method_name)
         name_token = self._alias_helper.get_name_token(location)
         for partition in partitions:
             _logger.info('WLSDPLY-06706', partition, class_name=_class_name, method_name=_method_name)
             location.add_name_token(name_token, partition)
             result[partition] = self._discover_single_folder(location)
             model_rg_name, rg_result = self.get_resource_groups(location)
             discoverer.add_to_model_if_not_empty(result[partition], model_rg_name, rg_result)
             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 and not model_subfolder_name == model_constants.RESOURCE_GROUP:
                         self._discover_subfolder(model_subfolder_name, location, result[partition])
             location.remove_name_token(name_token)
     _logger.exiting(class_name=_class_name, method_name=_method_name, result=model_top_folder_name)
     return model_top_folder_name, result
 def get_file_stores(self):
     """
     Discover the file stores used for weblogic persistence
     :return: model folder name: dictionary with the discovered file stores
     """
     _method_name = 'get_file_stores'
     _logger.entering(class_name=_class_name, method_name=_method_name)
     result = OrderedDict()
     model_top_folder_name = model_constants.FILE_STORE
     location = LocationContext(self._base_location)
     location.append_location(model_top_folder_name)
     file_stores = self._find_names_in_folder(location)
     if file_stores is not None:
         _logger.info('WLSDPLY-06346', len(file_stores), class_name=_class_name, method_name=_method_name)
         typedef = self._model_context.get_domain_typedef()
         name_token = self._alias_helper.get_name_token(location)
         for file_store in file_stores:
             if typedef.is_system_file_store(file_store):
                 _logger.info('WLSDPLY-06363', typedef.get_domain_type(), file_store, class_name=_class_name,
                              method_name=_method_name)
             else:
                 _logger.info('WLSDPLY-06347', file_store, class_name=_class_name, method_name=_method_name)
                 result[file_store] = OrderedDict()
                 location.add_name_token(name_token, file_store)
                 self._populate_model_parameters(result[file_store], location)
                 self.archive_file_store_directory(file_store, result[file_store])
                 location.remove_name_token(name_token)
     _logger.exiting(class_name=_class_name, method_name=_method_name, result=result)
     return model_top_folder_name, result
Beispiel #18
0
    def get_jms_system_resources(self):
        """
        Discover the JMS system resources, including the sub-deployments, system resource attributes and all
        the entities contained within a system resource from the domain.
        :return: model folder name: dictionary with the discovered JMS system resources
        """
        _method_name = 'get_jms_system_resources'
        _logger.entering(class_name=_class_name, method_name=_method_name)
        result = OrderedDict()
        model_top_folder_name = model_constants.JMS_SYSTEM_RESOURCE
        location = LocationContext(self._base_location)
        location.append_location(model_top_folder_name)
        jms_resources = self._find_names_in_folder(location)
        if jms_resources is not None:
            _logger.info('WLSDPLY-06478', len(jms_resources), class_name=_class_name, method_name=_method_name)
            name_token = self._alias_helper.get_name_token(location)
            for jms_resource in jms_resources:
                _logger.info('WLSDPLY-06479', jms_resource, class_name=_class_name, method_name=_method_name)
                result[jms_resource] = OrderedDict()
                location.add_name_token(name_token, jms_resource)
                self._populate_model_parameters(result[jms_resource], location)
                model_subfolder_name, subfolder_result = self._get_subdeployments(location)
                discoverer.add_to_model_if_not_empty(result[jms_resource], model_subfolder_name, subfolder_result)
                model_subfolder_name, subfolder_result = self._get_jms_resources(location)
                discoverer.add_to_model_if_not_empty(result[jms_resource], model_subfolder_name, subfolder_result)
                location.remove_name_token(name_token)

        _logger.exiting(class_name=_class_name, method_name=_method_name, result=result)
        return model_top_folder_name, result
    def get_unix_machines(self):
        """
        Discover the Machines in the domains that represent unix machines.
        :return: dictionary with the unix machine and node manager information
        """
        _method_name = 'get_unix_machines'
        _logger.entering(class_name=_class_name, method_name=_method_name)
        result = OrderedDict()
        model_top_folder_name = model_constants.UNIX_MACHINE
        location = LocationContext(self._base_location)
        location.append_location(model_top_folder_name)
        machines = self._find_names_in_folder(location)
        if machines is not None:
            _logger.info('WLSDPLY-06609', len(machines), class_name=_class_name, method_name=_method_name)
            name_token = self._alias_helper.get_name_token(location)
            for machine in machines:
                _logger.info('WLSDPLY-06610', machine, class_name=_class_name, method_name=_method_name)
                location.add_name_token(name_token, machine)
                result[machine] = OrderedDict()
                self._populate_model_parameters(result[machine], location)
                self._discover_subfolders(result[machine], location)
                location.remove_name_token(name_token)

        _logger.exiting(class_name=_class_name, method_name=_method_name, result=result)
        return model_top_folder_name, result
 def get_machines(self, unix_machines=None):
     """
     Discover the Machines that the domain servers are mapped to. Remove any machines from the domain machine list
     that are contained in the unix machines dictionary. These machines are represented in a separate unix machine
     section of the model.
     :return: model name of the machine section:dictionary containing the discovered node manager information
     """
     _method_name = 'get_machines'
     _logger.entering(class_name=_class_name, method_name=_method_name)
     if unix_machines is None:
         # did not like a mutable default value in method signature
         unix_machines = OrderedDict()
     result = OrderedDict()
     model_top_folder_name = model_constants.MACHINE
     location = LocationContext(self._base_location)
     location.append_location(model_top_folder_name)
     machines = self._find_names_in_folder(location)
     if machines is not None:
         name_token = self._alias_helper.get_name_token(location)
         for unix_machine in unix_machines:
             if unix_machine in machines:
                 machines.remove(unix_machine)
         _logger.info('WLSDPLY-06611', len(machines), class_name=_class_name, method_name=_method_name)
         for machine in machines:
             _logger.info('WLSDPLY-06612', machine, class_name=_class_name, method_name=_method_name)
             location.add_name_token(name_token, machine)
             result[machine] = OrderedDict()
             self._populate_model_parameters(result[machine], location)
             self._discover_subfolders(result[machine], location)
             location.remove_name_token(name_token)
     _logger.exiting(class_name=_class_name, method_name=_method_name)
     return model_top_folder_name, result
Beispiel #21
0
    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)
            name_token = self._alias_helper.get_name_token(location)
            for datasource in datasources:
                _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)
                if self.wlst_cd(self._alias_helper.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_migratable_targets(self):
        """
        Discover the migratable targets for the domain, including auto generated migratable targets for the server.
        :return: model name for the folder: dictionary containing the discovered migratable targets
        """
        _method_name = 'get_migratable_targets'
        _logger.entering(class_name=_class_name, method_name=_method_name)
        model_top_folder_name = model_constants.MIGRATABLE_TARGET
        result = OrderedDict()
        location = LocationContext(self._base_location)
        location.append_location(model_top_folder_name)
        targets = self._find_names_in_folder(location)
        if targets is not None:
            _logger.info('WLSDPLY-06607', len(targets), class_name=_class_name, method_name=_method_name)
            name_token = self._alias_helper.get_name_token(location)
            for target in targets:
                _logger.info('WLSDPLY-06608', target, class_name=_class_name, method_name=_method_name)
                location.add_name_token(name_token, target)
                result[target] = OrderedDict()
                self._populate_model_parameters(result[target], location)
                self._discover_subfolders(result[target], location)
                location.remove_name_token(name_token)

        _logger.exiting(class_name=_class_name, method_name=_method_name)
        return model_top_folder_name, result
Beispiel #23
0
    def get_mail_sessions(self):
        """
        Discover the mail sessions from the domain.
        :return: model name for the dictionary and the dictionary containing the mail session information
        """
        _method_name = 'get_mail_sessions'
        _logger.entering(class_name=_class_name, method_name=_method_name)
        result = OrderedDict()
        model_top_folder_name = model_constants.MAIL_SESSION
        location = LocationContext(self._base_location)
        location.append_location(model_top_folder_name)
        mail_sessions = self._find_names_in_folder(location)
        if mail_sessions is not None:
            _logger.info('WLSDPLY-06344', len(mail_sessions), class_name=_class_name, method_name=_method_name)
            name_token = self._alias_helper.get_name_token(location)
            for mail_session in mail_sessions:
                _logger.info('WLSDPLY-06345', mail_session, class_name=_class_name, method_name=_method_name)
                result[mail_session] = OrderedDict()
                mail_session_result = result[mail_session]
                location.add_name_token(name_token, mail_session)
                self._populate_model_parameters(mail_session_result, location)
                _fix_passwords_in_properties(mail_session_result)
                location.remove_name_token(name_token)

        _logger.exiting(class_name=_class_name, method_name=_method_name, result=model_top_folder_name)
        return model_top_folder_name, result
    def get_jolt_connection_pool(self):
        """
        Discover the global resource Jolt Connection Pool
        :return: model name for the folder: dictionary containing the discovered JoltConnectionPool
        """
        _method_name = 'get_jolt_connection_pool'
        _logger.entering(class_name=_class_name, method_name=_method_name)
        model_top_folder_name = model_constants.JOLT_CONNECTION_POOL
        result = OrderedDict()
        location = LocationContext(self._base_location)
        location.append_location(model_top_folder_name)
        jolt_pools = self._find_names_in_folder(location)
        if jolt_pools is not None:
            _logger.info('WLSDPLY-06449',
                         len(jolt_pools),
                         class_name=_class_name,
                         method_name=_method_name)
            name_token = self._aliases.get_name_token(location)
            for jolt_pool in jolt_pools:
                _logger.info('WLSDPLY-06450',
                             jolt_pool,
                             class_name=_class_name,
                             method_name=_method_name)
                result[jolt_pool] = OrderedDict()
                location.add_name_token(name_token, jolt_pool)
                self._populate_model_parameters(result[jolt_pool], location)
                location.remove_name_token(name_token)

        _logger.exiting(class_name=_class_name,
                        method_name=_method_name,
                        result=model_top_folder_name)
        return model_top_folder_name, result
 def get_wldf_system_resources(self):
     """
     Discover each WLDF system resource in the domain.
     :return: model name for the WLDF system resource:dictionary containing the discovered WLDF system resources
     """
     _method_name = 'get_wldf_system_resources'
     _logger.entering(class_name=_class_name, method_name=_method_name)
     result = OrderedDict()
     model_top_folder_name = model_constants.WLDF_SYSTEM_RESOURCE
     location = LocationContext(self._base_location)
     location.append_location(model_top_folder_name)
     wldf_resources = self._find_names_in_folder(location)
     if wldf_resources is not None:
         _logger.info('WLSDPLY-06357', len(wldf_resources), class_name=_class_name, method_name=_method_name)
         typedef = self._model_context.get_domain_typedef()
         name_token = self._alias_helper.get_name_token(location)
         for wldf_resource in wldf_resources:
             if typedef.is_system_wldf(wldf_resource):
                 _logger.info('WLSDPLY-06362', typedef.get_domain_type(), wldf_resource, class_name=_class_name,
                              method_name=_method_name)
             else:
                 _logger.info('WLSDPLY-06358', wldf_resource, class_name=_class_name, method_name=_method_name)
                 location.add_name_token(name_token, wldf_resource)
                 result[wldf_resource] = OrderedDict()
                 self._populate_model_parameters(result[wldf_resource], location)
                 self._discover_subfolders(result[wldf_resource], location)
                 location.remove_name_token(name_token)
     _logger.exiting(class_name=_class_name, method_name=_method_name, result=model_top_folder_name)
     return model_top_folder_name, result
Beispiel #26
0
    def get_clusters(self):
        """
        Discover the Clusters in the domain.
        :return:  model name for the dictionary and the dictionary containing the cluster information
        """
        _method_name = 'get_clusters'
        _logger.entering(class_name=_class_name, method_name=_method_name)
        result = OrderedDict()
        model_top_folder_name = model_constants.CLUSTER
        location = LocationContext(self._base_location)
        location.append_location(model_top_folder_name)
        clusters = self._find_names_in_folder(location)
        if clusters is not None:
            _logger.info('WLSDPLY-06601',
                         len(clusters),
                         class_name=_class_name,
                         method_name=_method_name)
            name_token = self._alias_helper.get_name_token(location)
            for cluster in clusters:
                _logger.info('WLSDPLY-06602',
                             cluster,
                             class_name=_class_name,
                             method_name=_method_name)
                location.add_name_token(name_token, cluster)
                result[cluster] = OrderedDict()
                self._populate_model_parameters(result[cluster], location)
                self._discover_subfolders(result[cluster], location)
                location.remove_name_token(name_token)
            location.pop_location()

        _logger.exiting(class_name=_class_name,
                        method_name=_method_name,
                        result=model_top_folder_name)
        return model_top_folder_name, result
    def get_coherence_clusters(self):
        """
        Discover the Coherence clusters and archive the necessary coherence artifacts.
        :return: model folder name: dictionary with the discovered coherence clusters
        """
        _method_name = '_get_coherence_clusters'
        _logger.entering(class_name=_class_name, method_name=_method_name)
        result = OrderedDict()
        model_top_folder_name = model_constants.COHERENCE_CLUSTER_SYSTEM_RESOURCE
        location = LocationContext(self._base_location)
        location.append_location(model_top_folder_name)
        coherence_clusters = self._find_names_in_folder(location)
        if coherence_clusters is not None:
            _logger.info('WLSDPLY-06311', len(coherence_clusters), class_name=_class_name, method_name=_method_name)
            typedef = self._model_context.get_domain_typedef()
            name_token = self._aliases.get_name_token(location)
            for coherence_cluster in coherence_clusters:
                if typedef.is_system_coherence_cluster(coherence_cluster):
                    _logger.info('WLSDPLY-06322', typedef.get_domain_type(), coherence_cluster, class_name=_class_name,
                                 method_name=_method_name)
                else:
                    _logger.info('WLSDPLY-06312', coherence_cluster, class_name=_class_name, method_name=_method_name)
                    location.add_name_token(name_token, coherence_cluster)
                    result[coherence_cluster] = OrderedDict()
                    self._populate_model_parameters(result[coherence_cluster], location)
                    model_subfolder_name, subfolder_result = self.get_coherence_cache_config(location)
                    discoverer.add_to_model_if_not_empty(result[coherence_cluster], model_subfolder_name,
                                                         subfolder_result)
                    model_subfolder_name, subfolder_result = self.get_coherence_resource(location)
                    discoverer.add_to_model_if_not_empty(result[coherence_cluster], model_subfolder_name,
                                                         subfolder_result)
                    location.remove_name_token(name_token)

        _logger.exiting(class_name=_class_name, method_name=_method_name, result=result)
        return model_top_folder_name, result
    def _create_list_of_setservergroups_targets(self):
        """
        If an update is executed in online WLST mode, return a list of all existing configured / mixed clusters and
        stand-alone managed servers. This method will be invoked to create a list of existing, and a list of new
        as added by the update tool. These lists will be compared to determine if they will encounter
        the online WLST problem with setServerGroups. The setServerGroups will target template resources to the
        new entities, but this targeting is not persisted to the config.xml.
        """
        _method_name = '_create_list_of_setservergroups_targets'
        self.logger.entering(class_name=self._class_name,
                             method_name=_method_name)

        if not self.is_online_with_ext_templates():
            self.logger.exiting(class_name=self._class_name,
                                method_name=_method_name)
            return list(), list()

        location = LocationContext().append_location(SERVER)
        server_path = self.aliases.get_wlst_list_path(location)
        existing_managed_servers = list()
        existing_servers = self.wlst_helper.get_existing_object_list(
            server_path)
        if existing_servers is not None:
            name_token = self.aliases.get_name_token(location)
            for server_name in existing_servers:
                location.add_name_token(name_token, server_name)
                wlst_path = self.aliases.get_wlst_attributes_path(location)
                self.wlst_helper.cd(wlst_path)
                cluster_attribute = self.aliases.get_wlst_attribute_name(
                    location, CLUSTER)
                cluster_value = self.wlst_helper.get(cluster_attribute)
                if cluster_value is None:
                    existing_managed_servers.append(server_name)
                location.remove_name_token(name_token)

        existing_configured_clusters = list()
        location = LocationContext().append_location(CLUSTER)
        cluster_path = self.aliases.get_wlst_list_path(location)
        existing_clusters = self.wlst_helper.get_existing_object_list(
            cluster_path)
        if existing_clusters is not None:
            name_token = self.aliases.get_name_token(location)
            for cluster_name in existing_clusters:
                location.add_name_token(name_token, cluster_name)
                wlst_path = self.aliases.get_wlst_attributes_path(location)
                self.wlst_helper.cd(wlst_path)
                ds_mbean = self.aliases.get_wlst_mbean_type(location)
                if not self.wlst_helper.subfolder_exists(
                        ds_mbean,
                        self.aliases.get_wlst_subfolders_path(location)):
                    existing_configured_clusters.append(cluster_name)
                location.remove_name_token(name_token)

        self.logger.exiting(
            class_name=self._class_name,
            method_name=_method_name,
            result='configured_clusters=' + str(existing_configured_clusters) +
            ' managed servers=' + str(existing_managed_servers))
        return existing_configured_clusters, existing_managed_servers
    def get_applications(self):
        """
        Discover application deployment information from the domain. Collect the application deployment binaries into
        the discovery archive file. If an application binary cannot be collected into the archive file, remove
        the application source path from the model and un-target the application.
        :return: model name for the dictionary and the dictionary containing the applications information
        """
        _method_name = 'get_applications'
        _logger.entering(class_name=_class_name, method_name=_method_name)
        result = OrderedDict()
        model_top_folder_name = model_constants.APPLICATION
        location = LocationContext(self._base_location)
        location.append_location(model_top_folder_name)
        applications = self._find_names_in_folder(location)
        if applications:
            _logger.info('WLSDPLY-06391',
                         len(applications),
                         class_name=_class_name,
                         method_name=_method_name)
            typedef = self._model_context.get_domain_typedef()
            name_token = self._alias_helper.get_name_token(location)
            for application in applications:
                if typedef.is_system_app(application):
                    _logger.info('WLSDPLY-06400',
                                 typedef.get_domain_type(),
                                 application,
                                 class_name=_class_name,
                                 method_name=_method_name)
                else:
                    _logger.info('WLSDPLY-06392',
                                 application,
                                 class_name=_class_name,
                                 method_name=_method_name)
                    location.add_name_token(name_token, application)
                    result[application] = OrderedDict()
                    self._populate_model_parameters(result[application],
                                                    location)
                    self._add_application_to_archive(application,
                                                     result[application])
                    self._discover_subfolders(result[application], location)
                    location.remove_name_token(name_token)

        _logger.exiting(class_name=_class_name,
                        method_name=_method_name,
                        result=result)
        return model_top_folder_name, result
    def get_shared_libraries(self):
        """
        Discover the shared library deployment information from the domain. Collect any shared library binaries into
        the discovered archive file. If the shared library cannot be collected into the archive, the shared library
        source path will be removed from the model and the shared library un-targeted.
        :return: model name for the dictionary and the dictionary containing the shared library information
        """
        _method_name = 'get_shared_libraries'
        _logger.entering(class_name=_class_name, method_name=_method_name)
        result = OrderedDict()
        model_top_folder_name = model_constants.LIBRARY
        location = LocationContext(self._base_location)
        location.append_location(model_top_folder_name)
        libraries = self._find_names_in_folder(location)
        if libraries:
            _logger.info('WLSDPLY-06381',
                         len(libraries),
                         class_name=_class_name,
                         method_name=_method_name)
            typedef = self._model_context.get_domain_typedef()
            name_token = self._alias_helper.get_name_token(location)
            for library in libraries:
                if typedef.is_system_shared_library(library):
                    _logger.info('WLSDPLY-06401',
                                 typedef.get_domain_type(),
                                 library,
                                 class_name=_class_name,
                                 method_name=_method_name)
                else:
                    _logger.info('WLSDPLY-06382',
                                 library,
                                 class_name=_class_name,
                                 method_name=_method_name)
                    location.add_name_token(name_token, library)
                    result[library] = OrderedDict()
                    self._populate_model_parameters(result[library], location)
                    self._add_shared_libraries_to_archive(
                        library, result[library])
                    self._discover_subfolders(result[library], location)
                    location.remove_name_token(name_token)

        _logger.exiting(class_name=_class_name,
                        method_name=_method_name,
                        result=model_top_folder_name)
        return model_top_folder_name, result