def __init__(self, aliases, logger, model_context, exception_type):
     self.aliases = aliases
     self.logger = logger
     self.model_context = model_context
     self.exception_type = exception_type
     self.weblogic_helper = WebLogicHelper(self.logger)
     self.wlst_helper = WlstHelper(self.exception_type)
Beispiel #2
0
 def __init__(self, aliases, logger, exception_type):
     self.logger = logger
     self.exception_type = exception_type
     self.alias_helper = AliasHelper(aliases, self.logger,
                                     self.exception_type)
     self.weblogic_helper = WebLogicHelper(self.logger)
     self.wlst_helper = WlstHelper(self.logger, self.exception_type)
Beispiel #3
0
def main(args):
    """
    The main entry point for the encryptModel tool.

    :param args:
    :return:
    """
    _method_name = 'main'

    __logger.entering(args[0],
                      class_name=_class_name,
                      method_name=_method_name)
    for index, arg in enumerate(args):
        __logger.finer('sys.argv[{0}] = {1}',
                       str(index),
                       str(arg),
                       class_name=_class_name,
                       method_name=_method_name)

    WlstHelper(ExceptionType.ENCRYPTION).silence()
    exit_code = _process_request(args)
    __logger.exiting(class_name=_class_name,
                     method_name=_method_name,
                     result=exit_code)
    sys.exit(exit_code)
    def __init__(self,
                 model_context,
                 base_location,
                 wlst_mode,
                 aliases=None,
                 variable_injector=None):
        """

        :param model_context: context about the model for this instance of discover domain
        :param base_location: to look for common weblogic resources. By default this is the global path or '/'
        """
        self._model_context = model_context
        self._base_location = base_location
        self._wlst_mode = wlst_mode
        if aliases:
            self._aliases = aliases
        else:
            self._aliases = Aliases(self._model_context,
                                    wlst_mode=self._wlst_mode)
        self._alias_helper = AliasHelper(self._aliases, _logger,
                                         ExceptionType.DISCOVER)
        self._variable_injector = variable_injector
        self._att_handler_map = OrderedDict()
        self._custom_folder = CustomFolderHelper(self._aliases, _logger,
                                                 self._model_context,
                                                 ExceptionType.DISCOVER,
                                                 self._variable_injector)
        self._weblogic_helper = WebLogicHelper(_logger)
        self._wlst_helper = WlstHelper(ExceptionType.DISCOVER)
        self._mbean_utils = MBeanUtils(self._model_context, self._alias_helper,
                                       ExceptionType.DISCOVER)
        self._wls_version = self._weblogic_helper.get_actual_weblogic_version()
Beispiel #5
0
    def __init__(self,
                 model,
                 model_context,
                 aliases,
                 exception_type=ExceptionType.CREATE,
                 logger=PlatformLogger('wlsdeploy.create')):

        self.logger = logger
        self.aliases = aliases
        self._exception_type = exception_type
        self.wlst_helper = WlstHelper(exception_type)
        self.model = Model(model)
        self.model_context = model_context
        self.wls_helper = WebLogicHelper(self.logger)
        self.attribute_setter = AttributeSetter(self.aliases, self.logger,
                                                exception_type)
        self.custom_folder_helper = CustomFolderHelper(self.aliases,
                                                       self.logger,
                                                       self.model_context,
                                                       exception_type)

        # Must be initialized by the subclass since only it has
        # the knowledge required to compute the domain name.
        self.archive_helper = None
        self.files_to_extract_from_archive = list()
        return
Beispiel #6
0
 def __init__(self,
              model_context,
              base_location,
              wlst_mode,
              aliases=None,
              credential_injector=None):
     """
     :param model_context: context about the model for this instance of discover domain
     :param base_location: to look for common weblogic resources. By default this is the global path or '/'
     :param wlst_mode: offline or online
     :param aliases: optional, aliases object to use
     :param credential_injector: optional, injector to collect credentials
     """
     self._model_context = model_context
     self._base_location = base_location
     self._wlst_mode = wlst_mode
     if aliases:
         self._aliases = aliases
     else:
         self._aliases = Aliases(self._model_context,
                                 wlst_mode=self._wlst_mode,
                                 exception_type=ExceptionType.DISCOVER)
     self._credential_injector = credential_injector
     self._att_handler_map = OrderedDict()
     self._custom_folder = CustomFolderHelper(self._aliases, _logger,
                                              self._model_context,
                                              ExceptionType.DISCOVER,
                                              self._credential_injector)
     self._weblogic_helper = WebLogicHelper(_logger)
     self._wlst_helper = WlstHelper(ExceptionType.DISCOVER)
     self._mbean_utils = MBeanUtils(self._model_context, self._aliases,
                                    ExceptionType.DISCOVER)
     self._wls_version = self._weblogic_helper.get_actual_weblogic_version()
 def __init__(self, aliases, logger, exception_type, wlst_mode=WlstModes.OFFLINE):
     self.__logger = logger
     self.__exception_type = exception_type
     self.__wlst_mode = wlst_mode
     self.__alias_helper = AliasHelper(aliases, self.__logger, exception_type)
     self.__wlst_helper = WlstHelper(self.__logger, exception_type)
     return
Beispiel #8
0
 def __init__(self, model_context, alias_helper, exception_type):
     self.__model_context = model_context
     self.__exception_type = exception_type
     self.__alias_helper = alias_helper
     self.__wlst_helper = WlstHelper(_logger, exception_type)
     self.__helper = self.__get_helper()
     self.__ignore_list = None
    def __init__(self,
                 model,
                 model_context,
                 aliases,
                 wlst_mode=WlstModes.OFFLINE):
        self.name = self._class_name
        self.model = model
        self.wlst_mode = wlst_mode
        self.model_context = model_context
        self.aliases = aliases
        self.logger = PlatformLogger('wlsdeploy.deploy')
        self.alias_helper = AliasHelper(aliases, self.logger,
                                        ExceptionType.DEPLOY)
        self.wls_helper = WebLogicHelper(self.logger)
        self.wlst_helper = WlstHelper(self.logger, ExceptionType.DEPLOY)
        self.attribute_setter = AttributeSetter(self.aliases,
                                                self.logger,
                                                ExceptionType.DEPLOY,
                                                wlst_mode=wlst_mode)
        self.topology_helper = TopologyHelper(self.aliases,
                                              ExceptionType.DEPLOY,
                                              self.logger)

        self.archive_helper = 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.model_context.get_domain_home(),
                self.logger, exception_helper.ExceptionType.DEPLOY)
        return
Beispiel #10
0
def main(args):
    """
    The main entry point for the discoverDomain tool.

    :param args:
    :return:
    """
    _method_name = 'main'

    __logger.entering(class_name=_class_name, method_name=_method_name)
    for index, arg in enumerate(args):
        __logger.finer('sys.argv[{0}] = {1}', str(index), str(arg), class_name=_class_name, method_name=_method_name)

    helper = WlstHelper(ExceptionType.DISCOVER)
    helper.silence()

    exit_code = CommandLineArgUtil.PROG_OK_EXIT_CODE

    try:
        model_context = __process_args(args)
    except CLAException, ex:
        exit_code = ex.getExitCode()
        if exit_code != CommandLineArgUtil.HELP_EXIT_CODE:
            __logger.severe('WLSDPLY-20008', _program_name, ex.getLocalizedMessage(), error=ex,
                            class_name=_class_name, method_name=_method_name)

        # create a minimal model for summary logging
        model_context = model_context_helper.create_exit_context(_program_name)
        __log_and_exit(model_context, exit_code, _class_name, _method_name)
Beispiel #11
0
 def __init__(self, model_context, alias_helper, exception_type, location, mbean_interface_name):
     self.__model_context = model_context
     self.__exception_type = exception_type
     self.__location = location
     self.__alias_helper = alias_helper
     self.__mbean_interface = mbean_interface_name
     self.__wlst_helper = WlstHelper(_logger, exception_type)
     self.__mbean_instance = None
     self.__mbean_name = ''
Beispiel #12
0
 def __init__(self, aliases, logger, model_context, exception_type, variable_injector=None):
     global _logger
     self._exception_type = exception_type
     self._model_context = model_context
     if logger is not None:
         _logger = logger
     self._alias_helper = AliasHelper(aliases, _logger, self._exception_type)
     self._weblogic_helper = WebLogicHelper(_logger)
     self._wlst_helper = WlstHelper(_logger, self._exception_type)
     self._info_helper = MBeanUtils(self._model_context, self._alias_helper, self._exception_type)
     self._variable_injector = variable_injector
Beispiel #13
0
 def __init__(self, model_context, exception_type, location):
     self.__model_context = model_context
     self.__exception_type = exception_type
     self.__location = location
     self.__aliases = Aliases(
         self.__model_context,
         wlst_mode=self.__model_context.get_target_wlst_mode())
     self.__alias_helper = AliasHelper(self.__aliases, _logger,
                                       exception_type)
     self.__wlst_helper = WlstHelper(_logger, exception_type)
     self.__mbean_instance = None
     self.__mbean_name = ''
Beispiel #14
0
    def __init__(self, model, model_context, aliases, exception_type, logger):
        self.logger = logger
        self.model = model
        self.model_context = model_context
        self.alias_helper = AliasHelper(aliases, self.logger, exception_type)
        self.wlst_helper = WlstHelper(self.logger, exception_type)

        topology = model.get_model_topology()
        if ADMIN_SERVER_NAME in topology:
            self._admin_server_name = topology[ADMIN_SERVER_NAME]
        else:
            self._admin_server_name = DEFAULT_ADMIN_SERVER_NAME
    def __init__(self, model, model_context, aliases, domain_home, exception_type, logger):
        self.logger = logger
        self.model = model
        self.model_context = model_context
        self.domain_home = domain_home
        self.alias_helper = AliasHelper(aliases, self.logger, exception_type)
        self.wlst_helper = WlstHelper(self.logger, exception_type)

        self.archive_helper = 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_type)
Beispiel #16
0
def set_single_folder_token(location, aliases):
    """
    Determine the name of the MBean at the specified WLST location, and set the corresponding token.
    :param location: the single-folder location to be updated
    :param aliases: the aliases object to use for name and path resolution
    """
    exception_type = aliases.get_exception_type()
    wlst_helper = WlstHelper(exception_type)
    list_path = aliases.get_wlst_list_path(location)
    existing_names = wlst_helper.get_existing_object_list(list_path)
    if len(existing_names) > 0:
        mbean_name = existing_names[0]
        token = aliases.get_name_token(location)
        location.add_name_token(token, mbean_name)
 def __init__(self, model, model_context, aliases, exception_type, logger):
     self.logger = logger
     self.model = model
     self.model_context = model_context
     self.aliases = aliases
     self.wlst_helper = WlstHelper(exception_type)
     self.wls_helper = WebLogicHelper(self.logger)
     self.exception_type = exception_type
     self.domain_typedef = self.model_context.get_domain_typedef()
     topology = model.get_model_topology()
     if ADMIN_SERVER_NAME in topology:
         self._admin_server_name = topology[ADMIN_SERVER_NAME]
     else:
         self._admin_server_name = DEFAULT_ADMIN_SERVER_NAME
 def __init__(self, model_context, topology_dictionary, base_location,
              wlst_mode=WlstModes.OFFLINE, aliases=None, variable_injector=None):
     """
     Instantiate an instance of the TopologyDiscoverer class with the runtime information provided by
     the init parameters.
     :param model_context: containing the arguments for this discover
     :param topology_dictionary: dictionary in which to add discovered topology information
     :param wlst_mode: indicates whether this discover is run in online or offline mode
     """
     Discoverer.__init__(self, model_context, base_location, wlst_mode, aliases, variable_injector)
     self._dictionary = topology_dictionary
     self._add_att_handler(model_constants.CLASSPATH, self._add_classpath_libraries_to_archive)
     self._add_att_handler(model_constants.CUSTOM_IDENTITY_KEYSTORE_FILE, self._add_keystore_file_to_archive)
     self._add_att_handler(model_constants.CUSTOM_TRUST_KEYSTORE_FILE, self._add_keystore_file_to_archive)
     self._wlst_helper = WlstHelper(ExceptionType.DISCOVER)
Beispiel #19
0
 def __init__(self,
              aliases,
              logger,
              model_context,
              exception_type,
              credential_injector=None):
     global _logger
     self._exception_type = exception_type
     self._model_context = model_context
     if logger is not None:
         _logger = logger
     self._weblogic_helper = WebLogicHelper(_logger)
     self._wlst_helper = WlstHelper(self._exception_type)
     self._info_helper = MBeanUtils(self._model_context, aliases,
                                    self._exception_type)
     self._credential_injector = credential_injector
Beispiel #20
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
Beispiel #21
0
    def __init__(self, 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._coherence_cluster_elements = [CLUSTER, SERVER, SERVER_TEMPLATE]
Beispiel #22
0
from wlsdeploy.util import cla_helper
from wlsdeploy.util import getcreds
from wlsdeploy.util import tool_exit
from wlsdeploy.util import variables
from wlsdeploy.util import wlst_extended
from wlsdeploy.util.cla_utils import CommandLineArgUtil
from wlsdeploy.util.model import Model
from wlsdeploy.util.weblogic_helper import WebLogicHelper

wlst_extended.wlst_functions = globals()

_program_name = 'deployApps'
_class_name = 'deploy'
__logger = PlatformLogger('wlsdeploy.deploy')
__wls_helper = WebLogicHelper(__logger)
__wlst_helper = WlstHelper(__logger, ExceptionType.DEPLOY)
__wlst_mode = WlstModes.OFFLINE

__required_arguments = [
    CommandLineArgUtil.ORACLE_HOME_SWITCH,
    CommandLineArgUtil.DOMAIN_HOME_SWITCH
]

__optional_arguments = [
    # Used by shell script to locate WLST
    CommandLineArgUtil.DOMAIN_TYPE_SWITCH,
    CommandLineArgUtil.ARCHIVE_FILE_SWITCH,
    CommandLineArgUtil.MODEL_FILE_SWITCH,
    CommandLineArgUtil.PREVIOUS_MODEL_FILE_SWITCH,
    CommandLineArgUtil.VARIABLE_FILE_SWITCH,
    CommandLineArgUtil.ADMIN_URL_SWITCH,
Beispiel #23
0
from wlsdeploy.tool.util import wlst_helper
from wlsdeploy.tool.util.wlst_helper import WlstHelper
from wlsdeploy.tool.util.rcu_helper import RCUHelper
from wlsdeploy.util import cla_helper
from wlsdeploy.util import tool_exit
from wlsdeploy.util.cla_utils import CommandLineArgUtil
from wlsdeploy.util.model import Model
from wlsdeploy.util.weblogic_helper import WebLogicHelper

wlst_helper.wlst_functions = globals()

_program_name = UPDATE_DOMAIN
_class_name = 'update'
__logger = PlatformLogger('wlsdeploy.update')
__wls_helper = WebLogicHelper(__logger)
__wlst_helper = WlstHelper(ExceptionType.DEPLOY)
__wlst_mode = WlstModes.OFFLINE

__required_arguments = [
    CommandLineArgUtil.ORACLE_HOME_SWITCH,
    CommandLineArgUtil.DOMAIN_HOME_SWITCH
]

__optional_arguments = [
    # Used by shell script to locate WLST
    CommandLineArgUtil.DOMAIN_TYPE_SWITCH,
    CommandLineArgUtil.ARCHIVE_FILE_SWITCH,
    CommandLineArgUtil.MODEL_FILE_SWITCH,
    CommandLineArgUtil.PREVIOUS_MODEL_FILE_SWITCH,
    CommandLineArgUtil.VARIABLE_FILE_SWITCH,
    CommandLineArgUtil.ADMIN_URL_SWITCH,