Class MapRepositoryProvider
java.lang.Object
org.eclipse.emf.cdo.spi.server.MapRepositoryProvider
- All Implemented Interfaces:
IRepositoryProvider
Provides an immutable, explicitly selected set of repositories by configured names or aliases. The copied mapping
prevents later caller changes from altering repository exposure, and its enumeration is a stable snapshot for the
lifetime of this provider.
- Since:
- 4.27
- Author:
- Eike Stepper
-
Constructor Summary
ConstructorsConstructorDescriptionMapRepositoryProvider(Map<String, ? extends IRepository> repositories) Creates a provider from an explicit mapping of lookup names to repositories. -
Method Summary
Modifier and TypeMethodDescriptiongetRepository(String name) Resolves a repository by a name understood by this provider.Returns a snapshot of the names that this provider can currently use to resolve repositories.
-
Constructor Details
-
MapRepositoryProvider
Creates a provider from an explicit mapping of lookup names to repositories. Lookup names are independent of the values returned byCDOCommonRepository.getName(), allowing deployments to expose repositories under aliases.- Parameters:
repositories- the names to expose and their repository instances- Throws:
NullPointerException- if the map, a name, or a repository isnull
-
-
Method Details
-
getRepository
Description copied from interface:IRepositoryProviderResolves a repository by a name understood by this provider.- Specified by:
getRepositoryin interfaceIRepositoryProvider- Parameters:
name- the repository lookup name or alias- Returns:
- the repository associated with the name, or
nullif the provider has no such repository
-
getRepositoryNames
Description copied from interface:IRepositoryProviderReturns a snapshot of the names that this provider can currently use to resolve repositories. The names are provider lookup names and may be aliases; they are not required to equalCDOCommonRepository.getName(). A name in the returned snapshot resolves throughIRepositoryProvider.getRepository(String)when it is returned, but a dynamic provider may be changed immediately afterwards. The returned set must not change after this method returns.- Specified by:
getRepositoryNamesin interfaceIRepositoryProvider- Returns:
- an immutable snapshot, which may be empty when enumeration is supported but no repositories are available
-