Class BaseChefService

    • Field Detail

      • logger

        @Named("jclouds.chef")
        protected Logger logger
    • Method Detail

      • encrypt

        public byte[] encrypt​(InputStream input)
                       throws IOException
        Description copied from interface: ChefService
        Encrypts the given input stream.
        Specified by:
        encrypt in interface ChefService
        Parameters:
        input - The input stream to encrypt.
        Returns:
        The encrypted bytes for the given input stream.
        Throws:
        IOException - If there is an error reading from the input stream.
      • decrypt

        public byte[] decrypt​(InputStream input)
                       throws IOException
        Description copied from interface: ChefService
        Decrypts the given input stream.
        Specified by:
        decrypt in interface ChefService
        Parameters:
        input - The input stream to decrypt.
        Returns:
        The decrypted bytes for the given input stream.
        Throws:
        IOException - If there is an error reading from the input stream.
      • updateBootstrapConfigForGroup

        public void updateBootstrapConfigForGroup​(String group,
                                                  BootstrapConfig bootstrapConfig)
        Description copied from interface: ChefService
        Configures how the nodes of a certain group will be bootstrapped
        Specified by:
        updateBootstrapConfigForGroup in interface ChefService
        Parameters:
        group - The group where the given bootstrap configuration will be applied.
        bootstrapConfig - The configuration to be applied to the nodes in the group.
      • getBootstrapConfigForGroup

        public BootstrapConfig getBootstrapConfigForGroup​(String group)
        Description copied from interface: ChefService
        Gets the bootstrap configuration for a given group.
        Specified by:
        getBootstrapConfigForGroup in interface ChefService
        Parameters:
        group - The name of the group.
        Returns:
        The bootstrap configuration for the given group.
      • cleanupStaleNodesAndClients

        public void cleanupStaleNodesAndClients​(String prefix,
                                                int secondsStale)
        Description copied from interface: ChefService
        Removes the nodes and clients that have been inactive for a given amount of time.
        Specified by:
        cleanupStaleNodesAndClients in interface ChefService
        Parameters:
        prefix - The prefix for the nodes and clients to delete.
        secondsStale - The seconds of inactivity to consider a node and client obsolete.
      • updateAutomaticAttributesOnNode

        public void updateAutomaticAttributesOnNode​(String nodeName)
        Description copied from interface: ChefService
        Updates and populate the automatic attributes of the given node.
        Specified by:
        updateAutomaticAttributesOnNode in interface ChefService
        Parameters:
        nodeName - The node to update.
      • listNodes

        public Iterable<? extends Node> listNodes()
        Description copied from interface: ChefService
        Lists the details of all existing nodes.
        Specified by:
        listNodes in interface ChefService
        Returns:
        The details of all existing nodes.
      • listNodes

        public Iterable<? extends Node> listNodes​(ExecutorService executorService)
        Description copied from interface: ChefService
        Lists the details of all existing nodes, executing concurrently using the executorService.
        Specified by:
        listNodes in interface ChefService
        Returns:
        The details of all existing nodes.
      • listClients

        public Iterable<? extends Client> listClients()
        Description copied from interface: ChefService
        Lists the details of all existing clients.
        Specified by:
        listClients in interface ChefService
        Returns:
        The details of all existing clients.
      • listClients

        public Iterable<? extends Client> listClients​(ExecutorService executorService)
        Description copied from interface: ChefService
        Lists the details of all existing clients, but executing concurrently using the threads available in the ExecutorService.
        Specified by:
        listClients in interface ChefService
        Returns:
        The details of all existing clients.
      • listCookbookVersions

        public Iterable<? extends CookbookVersion> listCookbookVersions​(ExecutorService executorService)
        Description copied from interface: ChefService
        Lists the details of all existing cookbooks. This method is executed concurrently, using the threads available in the ExecutorService.
        Specified by:
        listCookbookVersions in interface ChefService
        Returns:
        The details of all existing cookbooks.
      • listCookbookVersionsInEnvironment

        public Iterable<? extends CookbookVersion> listCookbookVersionsInEnvironment​(String environmentName)
        Description copied from interface: ChefService
        Lists the details of all existing cookbooks in an environment.
        Specified by:
        listCookbookVersionsInEnvironment in interface ChefService
        Parameters:
        environmentName - The environment name.
        Returns:
        The details of all existing cookbooks in an environment.
      • listCookbookVersionsInEnvironment

        public Iterable<? extends CookbookVersion> listCookbookVersionsInEnvironment​(String environmentName,
                                                                                     ExecutorService executorService)
        Description copied from interface: ChefService
        Lists the details of all existing cookbooks in an environment.
        Specified by:
        listCookbookVersionsInEnvironment in interface ChefService
        Parameters:
        environmentName - The environment name.
        executorService - The thread pool to do the concurrent execution.
        Returns:
        The details of all existing cookbooks in an environment.
      • listCookbookVersionsInEnvironment

        public Iterable<? extends CookbookVersion> listCookbookVersionsInEnvironment​(String environmentName,
                                                                                     String numVersions)
        Description copied from interface: ChefService
        Lists the details of all existing cookbooks in an environment limiting number of versions.
        Specified by:
        listCookbookVersionsInEnvironment in interface ChefService
        Parameters:
        environmentName - The environment name.
        numVersions - The number of cookbook versions to include. Use 'all' to return all cookbook versions.
        Returns:
        The details of all existing cookbooks in environment.
      • listCookbookVersionsInEnvironment

        public Iterable<? extends CookbookVersion> listCookbookVersionsInEnvironment​(String environmentName,
                                                                                     String numVersions,
                                                                                     ExecutorService executorService)
        Description copied from interface: ChefService
        Lists the details of all existing cookbooks in an environment limiting number of versions.
        Specified by:
        listCookbookVersionsInEnvironment in interface ChefService
        Parameters:
        environmentName - The environment name.
        numVersions - The number of cookbook versions to include. Use 'all' to return all cookbook versions.
        executorService - The executorService used to do this operation concurrently.
        Returns:
        The details of all existing cookbooks in environment.
      • listNodesInEnvironment

        public Iterable<? extends Node> listNodesInEnvironment​(String environmentName)
        Description copied from interface: ChefService
        Lists the details of all existing nodes in the given environment.
        Specified by:
        listNodesInEnvironment in interface ChefService
        Parameters:
        environmentName - The name fo the environment.
        Returns:
        The details of all existing nodes in the given environment.
      • listNodesInEnvironment

        public Iterable<? extends Node> listNodesInEnvironment​(String environmentName,
                                                               ExecutorService executorService)
        Description copied from interface: ChefService
        Lists the details of all existing nodes in the given environment, using the ExecutorService to paralleling the execution.
        Specified by:
        listNodesInEnvironment in interface ChefService
        Parameters:
        environmentName - The name fo the environment.
        executorService - The thread pool used in this operation
        Returns:
        The details of all existing nodes in the given environment.