Beispiel #1
0
    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
Beispiel #2
0
    def _is_alias_folder(self, path):
        """
        Check if the delimited path is a folder or attribute
        :param path: '|' delimited path
        :return: true if it is a folder otherwise false
        """
        debug("DEBUG: Entering is_alias_folder %s", path)
        path_tokens = path.split(PATH_TOKEN)
        model_context = ModelContext("test", {})
        aliases = Aliases(model_context=model_context,
                          wlst_mode=WlstModes.OFFLINE)
        location = LocationContext()
        last_token = path_tokens[-1]
        alias_helper = AliasHelper(aliases, __logger, ExceptionType.COMPARE)

        found = True
        name_token_next = False
        for path_token in path_tokens[1:]:
            if name_token_next:
                token_name = aliases.get_name_token(location)
                location.add_name_token(token_name, path_token)
                name_token_next = False
            else:
                location.append_location(path_token)
                if last_token == path_token:
                    break
                name_token_next = alias_helper.supports_multiple_mbean_instances(
                    location)
            attrib_names = alias_helper.get_model_attribute_names(location)
            if last_token in attrib_names:
                found = False

        debug("DEBUG: is_alias_folder %s %s", path, found)

        return found
Beispiel #3
0
 def get_jms_bridge_destinations(self):
     """
     Discover the JMS bridge destinations from the domain.
     :return: model folder name: dictionary containing the discovered bridge destinations
     """
     _method_name = 'get_jms_bridge_destinations'
     _logger.entering(class_name=_class_name, method_name=_method_name)
     result = OrderedDict()
     model_top_folder_name = model_constants.JMS_BRIDGE_DESTINATION
     location = LocationContext(self._base_location)
     location.append_location(model_top_folder_name)
     destinations = self._find_names_in_folder(location)
     if destinations is not None:
         _logger.info('WLSDPLY-06474',
                      len(destinations),
                      class_name=_class_name,
                      method_name=_method_name)
         name_token = self._aliases.get_name_token(location)
         for destination in destinations:
             _logger.info('WLSDPLY-06475',
                          destination,
                          class_name=_class_name,
                          method_name=_method_name)
             result[destination] = OrderedDict()
             location.add_name_token(name_token, destination)
             self._populate_model_parameters(result[destination], 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 #4
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
Beispiel #5
0
    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
 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
    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._aliases.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
Beispiel #8
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._aliases.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 #9
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._aliases.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 #10
0
 def get_embedded_ldap_configuration(self):
     """
     Get the Embedded LDAP server configuration for the domain and only return the configuration
     when there are non-default settings other than the credential value.
     :return: name for the model:dictionary containing the discovered Embedded LDAP configuration
     """
     _method_name = 'get_embedded_ldap_configuration'
     _logger.entering(class_name=_class_name, method_name=_method_name)
     result = OrderedDict()
     model_top_folder_name = model_constants.EMBEDDED_LDAP
     location = LocationContext(self._base_location)
     location.append_location(model_top_folder_name)
     embedded_ldap_configuration = self._find_singleton_name_in_folder(
         location)
     if embedded_ldap_configuration is not None:
         location.add_name_token(self._aliases.get_name_token(location),
                                 embedded_ldap_configuration)
         self._populate_model_parameters(result, location)
         # IFF credential is the only attribute, skip adding the Embedded LDAP server configuration
         if len(result
                ) == 1 and model_constants.CREDENTIAL_ENCRYPTED in result:
             injector = self._get_variable_injector()
             if injector is not None:
                 injector.remove_from_cache(
                     location, model_constants.CREDENTIAL_ENCRYPTED)
             result = OrderedDict()
             _logger.info('WLSDPLY-06639',
                          class_name=_class_name,
                          method_name=_method_name)
         else:
             _logger.info('WLSDPLY-06640',
                          class_name=_class_name,
                          method_name=_method_name)
     _logger.exiting(class_name=_class_name, method_name=_method_name)
     return model_top_folder_name, result
Beispiel #11
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._aliases.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 #12
0
 def discover_security_configuration(self):
     """
     Discover the security configuration for the domain.
     :return: name for the model:dictionary containing the discovered security configuration
     """
     _method_name = 'discover_security_configuration'
     _logger.entering(class_name=_class_name, method_name=_method_name)
     result = OrderedDict()
     model_top_folder_name = model_constants.SECURITY_CONFIGURATION
     location = LocationContext(self._base_location)
     location.append_location(model_top_folder_name)
     security_configuration = self._find_singleton_name_in_folder(location)
     if security_configuration is not None:
         _logger.info('WLSDPLY-06622',
                      class_name=_class_name,
                      method_name=_method_name)
         location.add_name_token(self._aliases.get_name_token(location),
                                 security_configuration)
         self._populate_model_parameters(result, location)
         self._massage_security_credential(result)
         try:
             self._discover_subfolders(result, location)
         except DiscoverException, de:
             _logger.warning('WLSDPLY-06200',
                             self._wls_version,
                             de.getLocalizedMessage(),
                             class_name=_class_name,
                             method_name=_method_name)
             result = OrderedDict()
Beispiel #13
0
 def get_servers(self):
     """
     Discover Servers in the domain.
     :return: model name for the dictionary and the dictionary containing the server information
     """
     _method_name = 'get_servers'
     _logger.entering(class_name=_class_name, method_name=_method_name)
     result = OrderedDict()
     model_top_folder_name = model_constants.SERVER
     location = LocationContext(self._base_location)
     location.append_location(model_top_folder_name)
     servers = self._find_names_in_folder(location)
     if servers is not None:
         _logger.info('WLSDPLY-06603',
                      len(servers),
                      class_name=_class_name,
                      method_name=_method_name)
         name_token = self._aliases.get_name_token(location)
         for server in servers:
             location.add_name_token(name_token, server)
             if not self._dynamic_server(server, location):
                 _logger.info('WLSDPLY-06604',
                              server,
                              class_name=_class_name,
                              method_name=_method_name)
                 result[server] = OrderedDict()
                 self._populate_model_parameters(result[server], location)
                 self._discover_subfolders(result[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 #14
0
    def _print_model_folder_sample(self, model_path_tokens,
                                   valid_section_folder_keys, control_option):
        """
        Prints a model sample for a folder in a model, when more than just the section_name[:] is provided.
        :param model_path_tokens: a Python list of path elements built from model path
        :param valid_section_folder_keys: A list of valid folder names for the model section in the path
        :param control_option: A command-line switch that controls what is output to STDOUT
        """
        _method_name = '_print_model_folder_sample'

        section_name = model_path_tokens[0]
        top_folder = model_path_tokens[1]
        if top_folder not in valid_section_folder_keys:
            ex = exception_helper.create_cla_exception(
                'WLSDPLY-10110', section_name + ':', top_folder,
                ', '.join(valid_section_folder_keys))
            self._logger.throwing(ex,
                                  class_name=_class_name,
                                  method_name=_method_name)
            raise ex

        print("")

        # write the parent folders, with indention and any name folders included

        indent = 0
        model_location = LocationContext()
        for token in model_path_tokens:
            if indent > 0:
                code, message = self._alias_helper.is_valid_model_folder_name(
                    model_location, token)
                if code != ValidationCodes.VALID:
                    ex = exception_helper.create_cla_exception(
                        "WLSDPLY-05027", message)
                    self._logger.throwing(ex,
                                          class_name=_class_name,
                                          method_name=_method_name)
                    raise ex
                model_location.append_location(token)

            _print_indent(token + ":", indent)
            indent += 1

            if self._has_multiple_folders(model_location):
                short_name = self._get_short_name(model_location)
                name = "'" + short_name + "-1'"
                _print_indent(name + ":", indent)
                indent += 1

        # list the attributes and folders, as specified

        if model_help_utils.show_attributes(control_option):
            # Print the attributes associated with location context
            self._print_attributes_sample(model_location, indent)

        if model_help_utils.show_folders(control_option):
            self._print_subfolders_sample(model_location, control_option,
                                          indent)

        return
Beispiel #15
0
 def discover_domain_mbean(self, model_top_folder_name):
     """
     Discover the domain specific MBean and its configuration attributes.
     :return: model name for domain MBean:dictionary containing the discovered Domain MBean attributes
     """
     _method_name = 'discover_domain_mbean'
     _logger.entering(model_top_folder_name,
                      class_name=_class_name,
                      method_name=_method_name)
     result = OrderedDict()
     location = LocationContext(self._base_location)
     location.append_location(model_top_folder_name)
     name = self._find_singleton_name_in_folder(location)
     if name is not None:
         _logger.info('WLSDPLY-06644',
                      model_top_folder_name,
                      class_name=_class_name,
                      method_name=_method_name)
         location.add_name_token(self._aliases.get_name_token(location),
                                 name)
         self._populate_model_parameters(result, location)
         # if any subfolders exist, discover
         self._discover_subfolders(result, location)
     _logger.exiting(class_name=_class_name, method_name=_method_name)
     return model_top_folder_name, result
Beispiel #16
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._aliases.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 #17
0
    def get_shutdown_classes(self):
        """
        Discover ShutdownClass information for the domain.
        :return: model name for the dictionary and the dictionary containing the shutdown class information
        """
        _method_name = 'get_shutdown_classes'
        _logger.entering(class_name=_class_name, method_name=_method_name)
        result = OrderedDict()
        model_top_folder_name = model_constants.SHUTDOWN_CLASS
        location = LocationContext(self._base_location)
        location.append_location(model_top_folder_name)
        shutdown_classes = self._find_names_in_folder(location)
        if shutdown_classes is not None:
            _logger.info('WLSDPLY-06445',
                         len(shutdown_classes),
                         class_name=_class_name,
                         method_name=_method_name)
            name_token = self._alias_helper.get_name_token(location)
            for shutdown_class in shutdown_classes:
                _logger.info('WLSDPLY-06446',
                             shutdown_class,
                             class_name=_class_name,
                             method_name=_method_name)
                result[shutdown_class] = OrderedDict()
                location.add_name_token(name_token, shutdown_class)
                self._populate_model_parameters(result[shutdown_class],
                                                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 #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)
            typedef = self._model_context.get_domain_typedef()
            name_token = self._aliases.get_name_token(location)
            for jms_resource in jms_resources:
                if typedef.is_system_jms(jms_resource):
                    _logger.info('WLSDPLY-06491', typedef.get_domain_type(), jms_resource, class_name=_class_name,
                                 method_name=_method_name)
                else:
                    _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_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._aliases.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
Beispiel #20
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)
            typedef = self._model_context.get_domain_typedef()
            name_token = self._aliases.get_name_token(location)
            for jms_server in jms_servers:
                if typedef.is_system_jms_server(jms_server):
                    _logger.info('WLSDPLY-06490', typedef.get_domain_type(), jms_server, class_name=_class_name,
                                 method_name=_method_name)
                else:
                    _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 #21
0
    def get_startup_classes(self):
        """
        Discover the StartupClasses for the domain.
        :return: model name for the dictionary and the dictionary containing the startup class information
        """
        _method_name = 'get_startup_classes'
        _logger.entering(class_name=_class_name, method_name=_method_name)
        result = OrderedDict()
        model_top_folder_name = model_constants.STARTUP_CLASS
        location = LocationContext(self._base_location)
        location.append_location(model_top_folder_name)
        startup_classes = self._find_names_in_folder(location)
        if startup_classes is not None:
            _logger.info('WLSDPLY-06442', len(startup_classes), 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 startup_class in startup_classes:
                if typedef.is_system_startup_class(startup_class):
                    _logger.info('WLSDPLY-06447', typedef.get_domain_type(), startup_class, class_name=_class_name,
                                 method_name=_method_name)
                else:
                    _logger.info('WLSDPLY-06443', startup_class, class_name=_class_name, method_name=_method_name)
                    result[startup_class] = OrderedDict()
                    location.add_name_token(name_token, startup_class)
                    self._populate_model_parameters(result[startup_class], 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_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
Beispiel #23
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_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
Beispiel #25
0
    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_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 #27
0
 def get_saf_agents(self):
     """
     Discover the SAF agents from the domain.
     :return: model folder name: dictionary containing the discovered SAF agents
     """
     _method_name = 'get_saf_agents'
     _logger.entering(class_name=_class_name, method_name=_method_name)
     result = OrderedDict()
     model_top_folder_name = model_constants.SAF_AGENT
     location = LocationContext(self._base_location)
     location.append_location(model_top_folder_name)
     agents = self._find_names_in_folder(location)
     if agents is not None:
         _logger.info('WLSDPLY-06472',
                      len(agents),
                      class_name=_class_name,
                      method_name=_method_name)
         name_token = self._aliases.get_name_token(location)
         for agent in agents:
             _logger.info('WLSDPLY-06473',
                          agent,
                          class_name=_class_name,
                          method_name=_method_name)
             location.add_name_token(name_token, agent)
             result[agent] = OrderedDict()
             self._populate_model_parameters(result[agent], location)
             self._discover_subfolders(result[agent], 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
Beispiel #29
0
 def get_jms_bridges(self):
     """
     Discover the JMS Bridges from the domain.
     :return: model folder name: dictionary containing the discovered JMS bridges
     """
     _method_name = 'get_jms_bridges'
     _logger.entering(class_name=_class_name, method_name=_method_name)
     result = OrderedDict()
     model_top_folder_name = model_constants.MESSAGING_BRIDGE
     location = LocationContext(self._base_location)
     location.append_location(model_top_folder_name)
     bridges = self._find_names_in_folder(location)
     if bridges is not None:
         _logger.info('WLSDPLY-06476',
                      len(bridges),
                      class_name=_class_name,
                      method_name=_method_name)
         name_token = self._aliases.get_name_token(location)
         for bridge in bridges:
             _logger.info('WLSDPLY-06477',
                          bridge,
                          class_name=_class_name,
                          method_name=_method_name)
             result[bridge] = OrderedDict()
             location.add_name_token(name_token, bridge)
             self._populate_model_parameters(result[bridge], 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 #30
0
    def get_webapp_container(self):
        """
        Discover the WebAppContainer global resource settings
        :return: model name for the folder: dictionary containing the discovered WebAppContainer
        """
        _method_name = '_get_webapp_container'
        _logger.entering(class_name=_class_name, method_name=_method_name)
        model_top_folder_name = model_constants.WEBAPP_CONTAINER
        result = OrderedDict()
        location = LocationContext(self._base_location)
        location.append_location(model_top_folder_name)
        webapp_container = self._find_singleton_name_in_folder(location)
        if webapp_container is not None:
            _logger.info('WLSDPLY-06615',
                         class_name=_class_name,
                         method_name=_method_name)
            location.add_name_token(
                self._alias_helper.get_name_token(location), webapp_container)
            self._populate_model_parameters(result, location)
            self._discover_subfolders(result, location)
            new_name = self._add_mimemapping_file_to_archive(result)
            if new_name:
                result[model_constants.MIME_MAPPING_FILE] = new_name

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