Package com.google.gerrit.server.git
Interface GitRepositoryManager
-
- All Known Implementing Classes:
GitRepositoryManagerOnInit
,LocalDiskRepositoryManager
,MultiBaseLocalDiskRepositoryManager
public interface GitRepositoryManager
Manages Git repositories for the Gerrit server process.Implementations of this interface should be a
Singleton
and registered in Guice so they are globally available within the server environment.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
GitRepositoryManager.Status
Status of the repository.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default Boolean
canPerformGC()
Check if garbage collection can be performed by the repository manager.org.eclipse.jgit.lib.Repository
createRepository(Project.NameKey name)
Create (and open) a repository by name.GitRepositoryManager.Status
getRepositoryStatus(Project.NameKey name)
GetGitRepositoryManager.Status
of the repository by name.SortedSet<Project.NameKey>
list()
Returns set of all known projects, sorted by natural NameKey order.org.eclipse.jgit.lib.Repository
openRepository(Project.NameKey name)
Get (or open) a repository by name.
-
-
-
Method Detail
-
getRepositoryStatus
GitRepositoryManager.Status getRepositoryStatus(Project.NameKey name)
GetGitRepositoryManager.Status
of the repository by name.
-
openRepository
org.eclipse.jgit.lib.Repository openRepository(Project.NameKey name) throws org.eclipse.jgit.errors.RepositoryNotFoundException, IOException
Get (or open) a repository by name.- Parameters:
name
- the repository name, relative to the base directory.- Returns:
- the cached Repository instance. Caller must call
close()
when done to decrement the resource handle. - Throws:
org.eclipse.jgit.errors.RepositoryNotFoundException
- the name does not denote an existing repository.IOException
- the name cannot be read as a repository.
-
createRepository
org.eclipse.jgit.lib.Repository createRepository(Project.NameKey name) throws org.eclipse.jgit.errors.RepositoryNotFoundException, RepositoryExistsException, IOException
Create (and open) a repository by name.- Parameters:
name
- the repository name, relative to the base directory.- Returns:
- the cached Repository instance. Caller must call
close()
when done to decrement the resource handle. - Throws:
RepositoryExistsException
- repository exists.RepositoryCaseMismatchException
- the name collides with an existing repository name, but only in case of a character within the name.org.eclipse.jgit.errors.RepositoryNotFoundException
- the name is invalid.IOException
- the repository cannot be created.
-
list
SortedSet<Project.NameKey> list()
Returns set of all known projects, sorted by natural NameKey order.
-
canPerformGC
default Boolean canPerformGC()
Check if garbage collection can be performed by the repository manager.- Returns:
- true if repository can perform garbage collection.
-
-