Class RepositoryManager

  • Direct Known Subclasses:
    PEDomainsManager

    public class RepositoryManager
    extends MasterPasswordFileManager
    The RepositoryManager serves as a common base class for the following PEDomainsManager, PEInstancesManager, AgentManager (the SE Node Agent). Its purpose is to abstract out any shared functionality related to lifecycle management of domains, instances and node agents. This includes creation, deletion, listing, and starting and stopping.
    Since:
    August 19, 2003, 2:29 PM
    Author:
    kebbs
    • Constructor Detail

      • RepositoryManager

        public RepositoryManager()
        Creates a new instance of RepositoryManager
    • Method Detail

      • repositoryExists

        protected boolean repositoryExists​(RepositoryConfig config)
      • isValidRepository

        protected boolean isValidRepository​(File f)
      • isValidRepository

        protected boolean isValidRepository​(RepositoryConfig config)
      • checkRepository

        public void checkRepository​(RepositoryConfig config,
                                    boolean existingRepository,
                                    boolean checkRootDir)
                             throws RepositoryException
        Sanity check on the repository.This is executed prior to create/delete/start/stop.
        Parameters:
        config - The base configuration
        existingRepository - true if the domain or instance must exist, false if it must not
        checkRootDir - whether to check if the root directory is read/writable
        Throws:
        RepositoryException
      • deleteRepository

        protected void deleteRepository​(RepositoryConfig config)
                                 throws RepositoryException
        Deletes the repository (domain, node agent, server instance).
        Parameters:
        config - the repository to delete
        Throws:
        RepositoryException - if it was unable to delete the repository
      • deleteRepository

        protected void deleteRepository​(RepositoryConfig config,
                                        boolean deleteJMSProvider)
                                 throws RepositoryException
        Deletes the repository (domain, node agent, server instance). If the deleteJMSProvider flag is set, we delete the jms instance.The jms instance is present in the domain only and not when the repository corresponds to a server instance or node agent.
        Parameters:
        config - the repository to delete
        deleteJMSProvider - if the JMS provider should be deleted as well
        Throws:
        RepositoryException - if it failed to delete the repository
      • listRepository

        protected String[] listRepository​(RepositoryConfig config)
                                   throws RepositoryException
        Return all repositories (domains, node agents, server instances)
        Parameters:
        config - the configuration to look in
        Returns:
        an array of the filepaths of all repositories' root folders
        Throws:
        RepositoryException
      • getConfigForRepositoryStatus

        protected RepositoryConfig getConfigForRepositoryStatus​(RepositoryConfig config,
                                                                String repository)
        Return all repositories (domains, node agents, server instances) and their corresponding status (e.g.running or stopped) in string form.
        Parameters:
        config - the base RepositoryConfig
        repository - the domain or agent name
        Returns:
        The repository here corresponds to either the domain or node agent name
      • validateMasterPassword

        public void validateMasterPassword​(RepositoryConfig config,
                                           String password)
                                    throws RepositoryException
        We validate the master password by trying to open the password alias keystore. This means that the keystore must already exist.
        Parameters:
        config - the RepositoryConfig to check against
        password - the master password to validate
        Throws:
        RepositoryException - if the master password failed to validate
      • changePasswordAliasKeystorePassword

        protected void changePasswordAliasKeystorePassword​(RepositoryConfig config,
                                                           String oldPassword,
                                                           String newPassword)
                                                    throws RepositoryException
        Change the password protecting the password alias keystore
        Parameters:
        config - the config to find the keystore location from
        oldPassword - old password
        newPassword - new password
        Throws:
        RepositoryException
      • createHttpBCInstallRoot

        public void createHttpBCInstallRoot​(PEFileLayout layout)
                                     throws Exception
        This method is used to create httpsoapbc install root
        Parameters:
        layout - PEFileLayout
        Throws:
        Exception - if an error occured creating the file
      • createJavaEESEInstallRoot

        public void createJavaEESEInstallRoot​(PEFileLayout layout)
                                       throws Exception
        This method is used to create Java EESE install root
        Parameters:
        layout - PEFileLayout
        Throws:
        Exception - IllegalArgumentException if source does not exist, RuntimeException if the a parent directory of the destination cannot be created or a IOException if there is an error creating the output file or coping it.
      • createWSDLSLInstallRoot

        public void createWSDLSLInstallRoot​(PEFileLayout layout)
                                     throws Exception
        This method is used to create WSDLSL install root
        Parameters:
        layout - PEFileLayout
        Throws:
        Exception - if an error occured creating the file
      • createMQInstance

        protected void createMQInstance​(RepositoryConfig config)
        Create MQ instance.
        Parameters:
        config - the RepositoryConfig to create the MQ instance within
      • isNSSSupportAvailable

        public static boolean isNSSSupportAvailable()
        Determines if the NSS support is available in this installation. The check involves availability of the certutil executable.
        Returns:
        true if certutil exists false otherwise