Package org.opencms.repository
Class CmsRepositoryManager
java.lang.Object
org.opencms.repository.CmsRepositoryManager
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 Summary
ConstructorDescriptionCreates a new instance for the resource manager, will be called by the vfs configuration manager.CmsRepositoryManager
(boolean configured) Creates a new unconfigured instance of the repository manager. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addRepositoryClass
(I_CmsRepository repository) Adds a new configured repository.static List<I_CmsResourceWrapper>
createResourceWrappersFromConfiguration
(CmsParameterConfiguration config, String paramName, org.apache.commons.logging.Log log) Creates a list of resource wrappers from a collection of configuration parameters, for use in configuring repositories.getAdditionalInfoForLogin
(String userName, String password) Gets the additional infos for the user who just logged in which is required for the repositories to work.Returns the repositories.<REPO extends I_CmsRepository>
List<REPO>getRepositories
(Class<REPO> cls) Gets a list of the repositories for the given superclass.getRepository
(String name) Returns the repository with the given name.<REPO extends I_CmsRepository>
REPOgetRepository
(String name, Class<REPO> cls) Gets a repository by name, but only if its class is a subclass of the class passed as a parameter.void
Initializes a configuration after all parameters have been added.void
initializeCms
(CmsObject cms) Initializes repositories using an admin CMS object.boolean
Returns the configured.void
shutDown()
Shuts down the repository manager.
-
Constructor Details
-
CmsRepositoryManager
public CmsRepositoryManager()Creates a new instance for the resource manager, will be called by the vfs configuration manager. -
CmsRepositoryManager
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 Details
-
createResourceWrappersFromConfiguration
public static List<I_CmsResourceWrapper> createResourceWrappersFromConfiguration(CmsParameterConfiguration config, String paramName, org.apache.commons.logging.Log log) throws CmsConfigurationException Creates a list of resource wrappers from a collection of configuration parameters, for use in configuring repositories.- Parameters:
config
- the configurationparamName
- the parameter namelog
- the logger to use for error messages- Returns:
- the list of resource wrappers
- Throws:
CmsConfigurationException
- if something goes wrong with reading the configuration
-
addRepositoryClass
Adds a new configured repository.- Parameters:
repository
- the repository to add- Throws:
CmsConfigurationException
- in case the resource manager configuration is already initialized
-
getAdditionalInfoForLogin
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 userpassword
- the password of the logged in user- Returns:
- the additional info entries which should be written to the user
-
getRepositories
Returns the repositories.- Returns:
- the repositories
-
getRepositories
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
Returns the repository with the given name.- Parameters:
name
- the name of the repository- Returns:
- the repository configured for that name
-
getRepository
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 namecls
- the class used to filter repositories- Returns:
- the repository with the given name, or null
-
initConfiguration
Initializes a configuration after all parameters have been added.- Throws:
CmsConfigurationException
- if something goes wrong
-
initializeCms
Initializes repositories using an admin CMS object.- Parameters:
cms
- the CMS object with admin privileges
-
isConfigured
Returns the configured.- Returns:
- the configured
-
shutDown
Shuts down the repository manager.
-