Package sonia.scm.repository
Interface RepositoryLocationResolver.RepositoryLocationResolverInstance<T>
- Enclosing class:
- RepositoryLocationResolver
public static interface RepositoryLocationResolver.RepositoryLocationResolverInstance<T>
-
Method Summary
Modifier and TypeMethodDescriptioncreateLocation
(String repositoryId) Create a new location for the new repository.void
forAllLocations
(BiConsumer<String, T> consumer) Iterates all repository locations known to this resolver instance and calls the consumer giving the repository id and its location for each repository.getLocation
(String repositoryId) Get the existing location for the repository.default void
modifyLocation
(String repositoryId, T location) Modifies the location for an existing repository.default void
modifyLocationAndKeepOld
(String repositoryId, T location) Modifies the location for an existing repository without removing the original location.void
setLocation
(String repositoryId, T location) Set the location of a new repository.
-
Method Details
-
getLocation
Get the existing location for the repository.- Parameters:
repositoryId
- The id of the repository.- Throws:
RepositoryLocationResolver.LocationNotFoundException
- when there is no known location for the given repository.
-
createLocation
Create a new location for the new repository.- Parameters:
repositoryId
- The id of the new repository.- Throws:
IllegalStateException
- when there already is a location for the given repository registered.
-
setLocation
Set the location of a new repository.- Parameters:
repositoryId
- The id of the new repository.- Throws:
IllegalStateException
- when there already is a location for the given repository registered.
-
modifyLocation
default void modifyLocation(String repositoryId, T location) throws RepositoryLocationResolver.RepositoryStorageException Modifies the location for an existing repository.- Parameters:
repositoryId
- The id of the new repository.- Throws:
IllegalArgumentException
- if the new location equals the current location.UnsupportedOperationException
- if the backing persistence layer does not support modification.RepositoryLocationResolver.RepositoryStorageException
- if any occurs during the move.
-
modifyLocationAndKeepOld
default void modifyLocationAndKeepOld(String repositoryId, T location) throws RepositoryLocationResolver.RepositoryStorageException Modifies the location for an existing repository without removing the original location.- Parameters:
repositoryId
- The id of the repository.- Throws:
IllegalArgumentException
- if the new location equals the current location.UnsupportedOperationException
- if the backing persistence layer does not support modification.RepositoryLocationResolver.RepositoryStorageException
- if any occurs during the move.
-
forAllLocations
Iterates all repository locations known to this resolver instance and calls the consumer giving the repository id and its location for each repository.- Parameters:
consumer
- This callback will be called for each repository with the repository id and its location.
-