A manager for
Repository s. Every RepositoryManager has
one SYSTEM repository and zero or more "user repositories". The SYSTEM
repository contains data that describes the configuration of the other
repositories (their IDs, which implementations of the Repository API to use,
access rights, etc.). The other repositories are instantiated based on this
configuration data.
author: Arjohn Kampman
refresh() Shuts down all initialized user repositories.
public boolean
removeRepositoryConfig(String repositoryID) Removes the configuration for the specified repository from the manager's
system repository if such a configuration is present.
public void
shutDown() Shuts down all initialized repositories, including the SYSTEM repository.
Creates a new RepositoryManager that operates on the specfified base
directory.
Parameters: baseDir - The base directory where data for repositories can be stored, amongother things.
Adds or updates the configuration of a repository to the manager's system
repository. The system repository may already contain a configuration for
a repository with the same ID as specified by config, in which
case all previous configuration data for that repository will be cleared
before the new configuration is added.
Parameters: config - The repository configuration that should be added to or updated inthe system repository. throws: RepositoryException - If the manager failed to update it's system repository. throws: RepositoryConfigException - If the manager doesn't know how to update a configuration due toinconsistent configuration data in the system repository. Forexample, this happens when there are multiple existingconfigurations with the concerning ID.
Clean up a removed repository. Note that the configuration for this
repository is no longer present in the system repository.
Parameters: repositoryID - the ID of the repository to clean up throws: IOException -
Creates and initializes the repository with the specified ID.
Parameters: id - A repository ID. The created repository, or null if no such repositoryexists. throws: RepositoryConfigException - If no repository could be created due to invalid or incompleteconfiguration data.
Returns all configured repositories. This may be an expensive operation as
it initializes repositories that have not been initialized yet.
The Set of all Repositories defined in the SystemRepository. See Also:RepositoryManager.getInitializedRepositories()
Returns all inititalized repositories. This method returns fast as no lazy
creation of repositories takes place.
An unmodifiable collection containing the initializedrepositories. See Also:RepositoryManager.getAllRepositories()
Gets the repository that is known by the specified ID from this manager.
Parameters: id - A repository ID. A Repository object, or null if no repository was knownfor the specified ID. throws: RepositoryConfigException - If no repository could be created due to invalid or incompleteconfiguration data.
Gets the repository that is known by the specified ID from this manager.
Parameters: id - A repository ID. A Repository object, or null if no repository was knownfor the specified ID. throws: RepositoryException - When not able to retrieve existing configurations
Removes the configuration for the specified repository from the manager's
system repository if such a configuration is present. Returns
true if the system repository actually contained the specified
repository configuration.
Parameters: repositoryID - The ID of the repository whose configuration needs to be removed. throws: RepositoryException - If the manager failed to update it's system repository. throws: RepositoryConfigException - If the manager doesn't know how to remove a configuration due toinconsistent configuration data in the system repository. Forexample, this happens when there are multiple existingconfigurations with the concerning ID.