Package sonia.scm.repository
Interface RepositoryManager
- All Superinterfaces:
AutoCloseable,Closeable,HandlerBase<Repository>,Initable,LastModifiedAware,Manager<Repository>,TypeManager<Repository,RepositoryHandler>
- All Known Implementing Classes:
AbstractRepositoryManager,RepositoryManagerDecorator
The central class for managing
Repository objects.
This class is a singleton and is available via injection.-
Method Summary
Modifier and TypeMethodDescriptionvoidarchive(Repository repository) Archives the given repository.default Repositorycreate(Repository repository, Consumer<Repository> afterCreation) Creates a new repository and afterwards executes the logic from the afterCreation.voidfireHookEvent(RepositoryHookEvent event) FireRepositoryHookEventto the event bus.get(NamespaceAndName namespaceAndName) Returns aRepositoryby its namespace and name or null if theRepositorycould not be found.Returns all namespaces.Returns all configured repository types.getHandler(String type) Returns aRepositoryHandlerby the given type (hg, git, svn ...).voidimportRepository(Repository repository) Imports an existingRepository.rename(Repository repository, String newNameSpace, String newName) voidunarchive(Repository repository) Un-archives the given repository.Methods inherited from interface sonia.scm.HandlerBase
create, delete, modifyMethods inherited from interface sonia.scm.LastModifiedAware
getLastModifiedMethods inherited from interface sonia.scm.Manager
get, getAll, getAll, getAll, getAll, getAll, getPage, refreshMethods inherited from interface sonia.scm.TypeManager
getTypes
-
Method Details
-
fireHookEvent
FireRepositoryHookEventto the event bus.- Parameters:
event- hook event- Since:
- 2.0.0
-
importRepository
Imports an existingRepository. Note: This method should only be called from aRepositoryHandler.- Parameters:
repository-Repositoryto import- Throws:
IOException
-
get
Returns aRepositoryby its namespace and name or null if theRepositorycould not be found.- Parameters:
namespaceAndName- namespace and name of theRepository- Returns:
Repositoryby its namespace and name or null if theRepositorycould not be found
-
getConfiguredTypes
Collection<RepositoryType> getConfiguredTypes()Returns all configured repository types. -
getHandler
Returns aRepositoryHandlerby the given type (hg, git, svn ...).- Specified by:
getHandlerin interfaceTypeManager<Repository,RepositoryHandler> - Parameters:
type- the type of theRepositoryHandler- Returns:
RepositoryHandlerby the given type
-
rename
- Parameters:
repository- the repositoryRepositorynewNameSpace- the new repository namespacenewName- the new repository name- Returns:
Repositorythe renamed repository
-
getAllNamespaces
Collection<String> getAllNamespaces()Returns all namespaces. -
create
Creates a new repository and afterwards executes the logic from the afterCreation.- Parameters:
repository- the repository to createafterCreation- consumer which is executed after the repository was created- Returns:
- created repository
- Since:
- 2.11.0
-
archive
Archives the given repository.- Since:
- 2.12.0
-
unarchive
Un-archives the given repository.- Since:
- 2.12.0
-