Class CmsRepositoryManager


  • public class CmsRepositoryManager
    extends java.lang.Object
    The RepositoryManager keeps a list with all configured I_CmsRepository and can be used to get a repository by its name.

    The configuration of the repositories is done in the configuration file opencms-importexport.xml.

    Since:
    6.2.4
    • Constructor Detail

      • CmsRepositoryManager

        public CmsRepositoryManager()
        Creates a new instance for the resource manager, will be called by the vfs configuration manager.

      • CmsRepositoryManager

        public CmsRepositoryManager​(boolean configured)
        Creates a new unconfigured instance of the repository manager.

        Is used if there are no repositories configured.

        Parameters:
        configured - determines if the repository manager was configured
    • Method Detail

      • getAdditionalInfoForLogin

        public java.util.Map<java.lang.String,​java.lang.Object> getAdditionalInfoForLogin​(java.lang.String userName,
                                                                                                java.lang.String password)
        Gets the additional infos for the user who just logged in which is required for the repositories to work.

        Parameters:
        userName - the name of the logged in user
        password - the password of the logged in user
        Returns:
        the additional info entries which should be written to the user
      • getRepositories

        public <REPO extends I_CmsRepository> java.util.List<REPO> getRepositories​(java.lang.Class<REPO> cls)
        Gets a list of the repositories for the given superclass.

        Parameters:
        cls - the superclass
        Returns:
        the repositories for whose classes the given class is a superclass
      • getRepository

        public I_CmsRepository getRepository​(java.lang.String name)
        Returns the repository with the given name.

        Parameters:
        name - the name of the repository
        Returns:
        the repository configured for that name
      • getRepository

        public <REPO extends I_CmsRepository> REPO getRepository​(java.lang.String name,
                                                                 java.lang.Class<REPO> cls)
        Gets a repository by name, but only if its class is a subclass of the class passed as a parameter.

        Otherwise, null will be returned.

        Parameters:
        name - the repository name
        cls - the class used to filter repositories
        Returns:
        the repository with the given name, or null
      • initializeCms

        public void initializeCms​(CmsObject cms)
        Initializes repositories using an admin CMS object.

        Parameters:
        cms - the CMS object with admin privileges
      • isConfigured

        public boolean isConfigured()
        Returns the configured.

        Returns:
        the configured
      • shutDown

        public void shutDown()
        Shuts down the repository manager.