Esempio n. 1
0
    def __init__(self, model_dictionary, model_context, aliases, exception_type, logger):
        Creator.__init__(self, model_dictionary, model_context, aliases, exception_type, logger)

        self._topology = self.model.get_model_topology()
        self._domain_typedef = self.model_context.get_domain_typedef()

        return
Esempio n. 2
0
    def __init__(self, model_dictionary, model_context, aliases,
                 exception_type, logger):
        Creator.__init__(self, model_dictionary, model_context, aliases,
                         exception_type, logger)

        self.logger = logger
        self.alias_helper = AliasHelper(aliases, self.logger, exception_type)
        self.wlst_helper = WlstHelper(self.logger, exception_type)
        self.wls_helper = WebLogicHelper(self.logger)

        self._topology = self.model.get_model_topology()

        #
        # Creating domains with the wls.jar template is busted for pre-12.1.2 domains with regards to the
        # names of the default authentication providers (both the DefaultAuthenticator and the
        # DefaultIdentityAsserter names are 'Provider', making it impossible to work with in WLST.  If
        # the WLS version is earlier than fix this as part of domain creation...
        #
        self.__fix_default_authentication_provider_names = \
            self.wls_helper.do_default_authentication_provider_names_need_fixing()
        return
Esempio n. 3
0
    def __init__(self, model_dictionary, model_context, aliases):
        _method_name = '__init__'
        Creator.__init__(self, model_dictionary, model_context, aliases)

        # domainInfo section is required to get the admin password, everything else
        # is optional and will use the template defaults
        if model_helper.get_model_domain_info_key() not in model_dictionary:
            ex = exception_helper.create_create_exception('WLSDPLY-12200', self.__program_name,
                                                          model_helper.get_model_domain_info_key(),
                                                          self.model_context.get_model_file())
            self.logger.throwing(ex, class_name=self.__class_name, method_name=_method_name)
            raise ex

        self.topology_helper = TopologyHelper(self.aliases, ExceptionType.CREATE, self.logger)
        self.security_provider_creator = SecurityProviderCreator(model_dictionary, model_context, aliases,
                                                                 ExceptionType.CREATE, self.logger)

        self._domain_typedef = self.model_context.get_domain_typedef()
        self._topology = self.model.get_model_topology()
        self._domain_info = self.model.get_model_domain_info()

        if DOMAIN_NAME in self._topology:
            self._domain_name = self._topology[DOMAIN_NAME]
        else:
            self._domain_name = DEFAULT_WLS_DOMAIN_NAME
        self._domain_home = os.path.join(self.model_context.get_domain_parent_dir(), self._domain_name)

        if ADMIN_SERVER_NAME in self._topology:
            self._admin_server_name = self._topology[ADMIN_SERVER_NAME]
        else:
            self._admin_server_name = DEFAULT_ADMIN_SERVER_NAME

        self.__default_domain_name = None
        self.__default_admin_server_name = None
        self.__default_security_realm_name = None

        archive_file_name = self.model_context.get_archive_file_name()
        if archive_file_name is not None:
            self.archive_helper = ArchiveHelper(archive_file_name, self._domain_home, self.logger,
                                                exception_helper.ExceptionType.CREATE)

        self.library_helper = LibraryHelper(self.model, self.model_context, self.aliases, self._domain_home,
                                            ExceptionType.CREATE, self.logger)

        self.target_helper = TargetHelper(self.model, self.model_context, self.aliases, ExceptionType.CREATE,
                                          self.logger)

        #
        # Creating domains with the wls.jar template is busted for pre-12.1.2 domains with regards to the
        # names of the default authentication providers (both the DefaultAuthenticator and the
        # DefaultIdentityAsserter names are 'Provider', making it impossible to work with in WLST.  If
        # the WLS version is earlier than fix this as part of domain creation...
        #
        self.__fix_default_authentication_provider_names = \
            self.wls_helper.do_default_authentication_provider_names_need_fixing()

        #
        # This list gets modified as the domain is being created so do use this list for anything else...
        #
        self.__topology_folder_list = self.alias_helper.get_model_topology_top_level_folder_names()
        return
    def __init__(self, model_dictionary, model_context, aliases):
        _method_name = '__init__'
        Creator.__init__(self, model_dictionary, model_context, aliases)

        # domainInfo section is required to get the admin password, everything else
        # is optional and will use the template defaults
        if model_helper.get_model_domain_info_key() not in model_dictionary:
            ex = exception_helper.create_create_exception(
                'WLSDPLY-12200', self.__program_name,
                model_helper.get_model_domain_info_key(),
                self.model_context.get_model_file())
            self.logger.throwing(ex,
                                 class_name=self.__class_name,
                                 method_name=_method_name)
            raise ex

        self.topology_helper = TopologyHelper(self.aliases,
                                              ExceptionType.CREATE,
                                              self.logger)
        self.security_provider_creator = SecurityProviderCreator(
            model_dictionary, model_context, aliases, ExceptionType.CREATE,
            self.logger)

        self._domain_typedef = self.model_context.get_domain_typedef()
        self._topology = self.model.get_model_topology()
        self._domain_info = self.model.get_model_domain_info()

        if DOMAIN_NAME in self._topology:
            self._domain_name = self._topology[DOMAIN_NAME]
        else:
            self._domain_name = DEFAULT_WLS_DOMAIN_NAME

        # if domain home specified on command line, set it here, otherwise append domain name to domain parent
        model_domain_home = self.model_context.get_domain_home()
        if model_domain_home:
            self._domain_home = model_domain_home
        else:
            self._domain_home = os.path.join(
                self.model_context.get_domain_parent_dir(), self._domain_name)

        if ADMIN_SERVER_NAME in self._topology:
            self._admin_server_name = self._topology[ADMIN_SERVER_NAME]
        else:
            self._admin_server_name = DEFAULT_ADMIN_SERVER_NAME

        self.__default_domain_name = None
        self.__default_admin_server_name = None
        self.__default_security_realm_name = None

        archive_file_name = self.model_context.get_archive_file_name()
        if archive_file_name is not None:
            self.archive_helper = ArchiveHelper(
                archive_file_name, self._domain_home, self.logger,
                exception_helper.ExceptionType.CREATE)

        self.library_helper = LibraryHelper(self.model, self.model_context,
                                            self.aliases, self._domain_home,
                                            ExceptionType.CREATE, self.logger)

        self.target_helper = TargetHelper(self.model, self.model_context,
                                          self.aliases, ExceptionType.CREATE,
                                          self.logger)

        #
        # This list gets modified as the domain is being created so do use this list for anything else...
        #
        self.__topology_folder_list = self.alias_helper.get_model_topology_top_level_folder_names(
        )
        return