def __init__(self,
              model,
              model_context,
              aliases,
              wlst_mode=WlstModes.OFFLINE):
     Deployer.__init__(self, model, model_context, aliases, wlst_mode)
     self._resources = self.model.get_model_resources()
Ejemplo n.º 2
0
    def __init__(self,
                 model,
                 model_context,
                 aliases,
                 wlst_mode=WlstModes.OFFLINE):
        Deployer.__init__(self, model, model_context, aliases, wlst_mode)
        self._topology = self.model.get_model_topology()
        self._resources = self.model.get_model_resources()
        self._topology_helper = TopologyHelper(self.aliases,
                                               ExceptionType.DEPLOY,
                                               self.logger)
        self._domain_typedef = self.model_context.get_domain_typedef()

        self._security_provider_creator = SecurityProviderCreator(
            model.get_model(), model_context, aliases, ExceptionType.DEPLOY,
            self.logger)

        self.library_helper = LibraryHelper(self.model, self.model_context,
                                            self.aliases,
                                            model_context.get_domain_home(),
                                            ExceptionType.DEPLOY, self.logger)

        self.target_helper = TargetHelper(self.model, self.model_context,
                                          self.aliases, ExceptionType.DEPLOY,
                                          self.logger)
Ejemplo n.º 3
0
    def _add_model_elements(self, type_name, model_nodes, location):
        Deployer._add_model_elements(self, type_name, model_nodes, location)

        # check for file paths that need to be qualified
        self._topology_helper.qualify_nm_properties(type_name, model_nodes,
                                                    location,
                                                    self.model_context,
                                                    self.attribute_setter)
    def __init__(self,
                 model,
                 model_context,
                 aliases,
                 wlst_mode=WlstModes.OFFLINE):
        Deployer.__init__(self, model, model_context, aliases, wlst_mode)
        self._resources = self.model.get_model_resources()

        self.common_deployer = \
            CommonResourcesDeployer(self.model, self.model_context, self.aliases, wlst_mode=self.wlst_mode)
Ejemplo n.º 5
0
    def _add_model_elements(self, type_name, model_nodes, location):
        """
        Override the base method for these special cases:
        1) JMS resources must be deployed in specific order.
        2) JNDI properties require special handling.
        """
        if type_name == JMS_RESOURCE:
            self._add_jms_resources(model_nodes, location)
            return

        Deployer._add_model_elements(self, type_name, model_nodes, location)
    def _add_named_elements(self, type_name, model_nodes, location):
        """
        Override default behavior to create placeholders for referenced Coherence clusters.
        :param type_name: the model folder type
        :param model_nodes: the model dictionary of the specified model folder type
        :param location: the location object to use to create the MBeans
        :raises: DeployException: if an error occurs
        """
        self._topology_helper.check_coherence_cluster_references(type_name, model_nodes)
        # continue with regular processing

        Deployer._add_named_elements(self, type_name, model_nodes, location)
Ejemplo n.º 7
0
 def __init__(self,
              model,
              model_context,
              aliases,
              modifyBootStrapCredential=True):
     Deployer.__init__(self,
                       model,
                       model_context,
                       aliases,
                       wlst_mode=WlstModes.OFFLINE)
     self._exception_type = ExceptionType.DEPLOY
     self._modifyBootStrapCredential = modifyBootStrapCredential
Ejemplo n.º 8
0
 def __init__(self,
              model,
              model_context,
              aliases,
              wlst_mode=WlstModes.OFFLINE):
     """
     Construct a deployer with the specified arguments.
     :param model: the model to be deployed
     :param model_context: context information for the model deployment
     :param aliases: the aliases to use for deployment
     :param wlst_mode: the WLST mode to use for deployment
     """
     Deployer.__init__(self, model, model_context, aliases, wlst_mode)
     self._resources = self.model.get_model_resources()
Ejemplo n.º 9
0
    def _add_named_elements(self, type_name, model_nodes, location):
        """
        Override the base method for these special cases:
        1) Group params require special handling.
        2) Destinations may require placeholder templates.
        """
        if type_name == GROUP_PARAMS:
            self._add_group_params(model_nodes, location)
            return

        if type_name == JNDI_PROPERTY:
            self._add_jndi_properties(model_nodes, location)
            return

        if type_name in self.template_destination_type_names:
            self._check_destination_template(model_nodes, location)
            # continue with regular processing

        Deployer._add_named_elements(self, type_name, model_nodes, location)
    def _set_attributes_and_add_subfolders(self, location, model_nodes):
        """
        Override the base method for attributes and sub-folders of partition.
        Process sub-folders first to allow attributes to reference partition work manager and resource manager.
        :param location: the location of the attributes and sub-folders
        :param model_nodes: a map of model nodes including attributes and sub-folders
        :raise: DeployException: if an error condition is encountered
        """
        parent_type = self.get_location_type(location)
        if parent_type == PARTITION:
            self._add_subfolders(model_nodes, location)
            self.wlst_helper.cd(
                self.alias_helper.get_wlst_attributes_path(location))
            self.set_attributes(location, model_nodes)
            return

        Deployer._set_attributes_and_add_subfolders(self, location,
                                                    model_nodes)
        return
    def _add_subfolders(self, model_nodes, location, excludes=None):
        """
        Override the base method for sub-folders of resource group and template.
        Those sub-folders must be processed in a specific order, some with special processing.
        :param model_nodes: the child nodes of a model element
        :param location: the location where sub-folders should be added
        :param excludes: optional list of sub-folder names to be excluded from processing
        """
        parent_type = self.get_location_type(location)
        is_in = (parent_type == RESOURCE_GROUP) or (parent_type
                                                    == RESOURCE_GROUP_TEMPLATE)
        if is_in:
            self._add_resource_group_resources(model_nodes, location)
            return

        Deployer._add_subfolders(self,
                                 model_nodes,
                                 location,
                                 excludes=excludes)
        return
    def set_attributes(self, location, model_nodes, excludes=None):
        """
        Override this method to set the Name attribute in JDBCResource folder for online deployment.
        Bug 27091687 requires this value to be explicitly set.
        :param location: the location to set attributes
        :param model_nodes: model nodes containing attributes to be set
        :param excludes: names of attributes to avoid setting
        """
        type_name = self.get_location_type(location)
        if type_name == JDBC_RESOURCE and self.wlst_mode == WlstModes.ONLINE:
            existing_name = self.wlst_helper.get('Name')
            if existing_name is None:
                parent_location = LocationContext(location)
                parent_location.pop_location()
                data_source_token = self.aliases.get_name_token(
                    parent_location)
                data_source_name = location.get_name_for_token(
                    data_source_token)
                self.wlst_helper.set('Name', data_source_name)
            # continue

        Deployer.set_attributes(self, location, model_nodes, excludes)
        return
Ejemplo n.º 13
0
    def _add_subfolders(self, model_nodes, location, excludes=None):
        """
        Override the base method for sub-folders of self-tuning.
        The work manager sub-folder must be processed last.
        """
        parent_type = self.get_location_type(location)
        if parent_type == SELF_TUNING:
            # add all sub-folders except work manager
            Deployer._add_subfolders(self,
                                     model_nodes,
                                     location,
                                     excludes=[WORK_MANAGER])

            # add the work manager sub-folder last
            watch_nodes = dictionary_utils.get_dictionary_element(
                model_nodes, WORK_MANAGER)
            self._add_named_elements(WORK_MANAGER, watch_nodes, location)
            return

        Deployer._add_subfolders(self,
                                 model_nodes,
                                 location,
                                 excludes=excludes)
        return
Ejemplo n.º 14
0
    def _add_subfolders(self, model_nodes, location, excludes=None):
        """
        Override the base method for sub-folders of watch notification.
        The watch sub-folder must be processed last.
        """
        parent_type = self.get_location_type(location)
        if parent_type == WATCH_NOTIFICATION:
            # add all sub-folders except watch
            Deployer._add_subfolders(self,
                                     model_nodes,
                                     location,
                                     excludes=[WATCH])

            # add the watch sub-folder last
            watch_nodes = dictionary_utils.get_dictionary_element(
                model_nodes, WATCH)
            self._add_named_elements(WATCH, watch_nodes, location)
            return

        Deployer._add_subfolders(self,
                                 model_nodes,
                                 location,
                                 excludes=excludes)
        return
Ejemplo n.º 15
0
 def __init__(self,
              model,
              model_context,
              aliases,
              wlst_mode=WlstModes.OFFLINE):
     Deployer.__init__(self, model, model_context, aliases, wlst_mode)