Interface RepositoryManager
- All Known Implementing Classes:
RepositoryManagerImpl
public interface RepositoryManager
High-level service to get to a
Repository
and from there to
CoreSession
objects.-
Method Summary
Modifier and TypeMethodDescriptionvoid
addRepository
(Repository repository) Registers a new repository.Gets the default repository.Gets the name of the default repository.Gets all registered repositories.getRepository
(String name) Gets a repository by its name.Gets the names of registered repositories.void
removeRepository
(String name) Removes a registered repository.
-
Method Details
-
getRepositories
Collection<Repository> getRepositories()Gets all registered repositories.- Returns:
- a read-only collection of repositories or an empty one if no repositories was defined
-
getRepositoryNames
Gets the names of registered repositories.- Returns:
- a list of repository names
- Since:
- 5.9.3
-
getRepository
Gets a repository by its name.- Parameters:
name
- the repository name- Returns:
- the repository or null if not found
-
addRepository
Registers a new repository.- Parameters:
repository
- the repository to register
-
removeRepository
Removes a registered repository.Do nothing if the repository is not registered.
- Parameters:
name
- the repository name to unregister
-
getDefaultRepository
Repository getDefaultRepository()Gets the default repository.If there is not a default repository returns the first registered. repository
This is a convenient method to get the repository for application having a single repository.
- Returns:
- the default repository
-
getDefaultRepositoryName
String getDefaultRepositoryName()Gets the name of the default repository.If there is not a default repository, returns the name of the first registered repository.
- Returns:
- the default repository name
-