@Service(value="repositoryRegistry") public class ArchivaRepositoryRegistry extends Object implements ConfigurationListener, EventHandler<Event>, RepositoryRegistry
The modification methods addXX and removeXX persist the changes immediately to the configuration. If the configuration save fails the changes are rolled back.
TODO: Audit events
| Constructor and Description |
|---|
ArchivaRepositoryRegistry() |
| Modifier and Type | Method and Description |
|---|---|
ManagedRepository |
clone(ManagedRepository repo,
String newId)
Creates a new repository instance with the same settings as this one.
|
RemoteRepository |
clone(RemoteRepository repo,
String newId)
Creates a new repository instance with the same settings as this one.
|
<T extends Repository> |
clone(T repo,
String newId) |
void |
configurationEvent(ConfigurationEvent event)
Generic event point to notify components that something has happend in the configuration.
|
void |
destroy() |
ArchivaIndexManager |
getIndexManager(RepositoryType type) |
Collection<ManagedRepository> |
getManagedRepositories()
Returns only the managed repositories.
|
ManagedRepository |
getManagedRepository(String repoId)
Convenience method, that returns the managed repository with the given id.
|
Collection<RemoteRepository> |
getRemoteRepositories()
Returns only the remote repositories.
|
RemoteRepository |
getRemoteRepository(String repoId)
Convenience method, that returns the remote repository with the given id.
|
Collection<Repository> |
getRepositories()
Returns all repositories that are registered.
|
Repository |
getRepository(String repoId)
Returns the repository with the given id.
|
RepositoryGroup |
getRepositoryGroup(String groupId) |
Collection<RepositoryGroup> |
getRepositoryGroups() |
void |
handle(Event event) |
ManagedRepository |
putRepository(ManagedRepository managedRepository)
Adds a new repository to the current list, or replaces the repository definition with
the same id, if it exists already.
|
ManagedRepository |
putRepository(ManagedRepositoryConfiguration managedRepositoryConfiguration)
Adds a new repository or updates the repository with the same id, if it exists already.
|
ManagedRepository |
putRepository(ManagedRepositoryConfiguration managedRepositoryConfiguration,
Configuration configuration)
Adds a new repository or updates the repository with the same id.
|
RemoteRepository |
putRepository(RemoteRepository remoteRepository)
Adds a remote repository, or overwrites the repository definition with the same id, if it exists already.
|
RemoteRepository |
putRepository(RemoteRepositoryConfiguration remoteRepositoryConfiguration)
Adds a new repository or updates the repository with the same id, if it exists already.
|
RemoteRepository |
putRepository(RemoteRepository remoteRepository,
Configuration configuration) |
RemoteRepository |
putRepository(RemoteRepositoryConfiguration remoteRepositoryConfiguration,
Configuration configuration)
Adds a new repository or updates the repository with the same id.
|
RepositoryGroup |
putRepositoryGroup(RepositoryGroup repositoryGroup)
Adds a new repository group to the current list, or replaces the repository group definition with
the same id, if it exists already.
|
RepositoryGroup |
putRepositoryGroup(RepositoryGroupConfiguration repositoryGroupConfiguration)
Adds a new repository group or updates the repository with the same id, if it exists already.
|
RepositoryGroup |
putRepositoryGroup(RepositoryGroupConfiguration repositoryGroupConfiguration,
Configuration configuration)
Adds a new repository group or updates the repository group with the same id.
|
<T extends Event> |
registerEventHandler(EventType<T> type,
EventHandler<? super T> eventHandler) |
void |
reload()
Reloads the registry from the configuration.
|
void |
removeRepository(ManagedRepository managedRepository)
Removes a managed repository from the registry and configuration, if it exists.
|
void |
removeRepository(ManagedRepository managedRepository,
Configuration configuration) |
void |
removeRepository(RemoteRepository remoteRepository)
Removes the remote repository from the registry and configuration.
|
void |
removeRepository(RemoteRepository remoteRepository,
Configuration configuration) |
void |
removeRepository(Repository repo) |
void |
removeRepository(String repoId) |
void |
removeRepositoryGroup(RepositoryGroup repositoryGroup)
Removes a repository group from the registry and configuration, if it exists.
|
void |
removeRepositoryGroup(RepositoryGroup repositoryGroup,
Configuration configuration) |
void |
resetIndexingContext(Repository repository)
Resets the indexing context of a given repository.
|
void |
setArchivaConfiguration(ArchivaConfiguration archivaConfiguration) |
<T extends Event> |
unregisterEventHandler(EventType<T> type,
EventHandler<? super T> eventHandler) |
public ArchivaRepositoryRegistry()
public void setArchivaConfiguration(ArchivaConfiguration archivaConfiguration)
setArchivaConfiguration in interface RepositoryRegistry@PreDestroy public void destroy()
public ArchivaIndexManager getIndexManager(RepositoryType type)
getIndexManager in interface RepositoryRegistrypublic Collection<Repository> getRepositories()
getRepositories in interface RepositoryRegistrypublic Collection<ManagedRepository> getManagedRepositories()
getManagedRepositories in interface RepositoryRegistrypublic Collection<RemoteRepository> getRemoteRepositories()
getRemoteRepositories in interface RepositoryRegistrypublic Collection<RepositoryGroup> getRepositoryGroups()
getRepositoryGroups in interface RepositoryRegistrypublic Repository getRepository(String repoId)
getRepository in interface RepositoryRegistryrepoId - the repository idpublic ManagedRepository getManagedRepository(String repoId)
getManagedRepository in interface RepositoryRegistryrepoId - the repository idpublic RemoteRepository getRemoteRepository(String repoId)
getRemoteRepository in interface RepositoryRegistryrepoId - the repository idpublic RepositoryGroup getRepositoryGroup(String groupId)
getRepositoryGroup in interface RepositoryRegistrypublic ManagedRepository putRepository(ManagedRepository managedRepository) throws RepositoryException
putRepository in interface RepositoryRegistrymanagedRepository - the new repository.RepositoryException - if the new repository could not be saved to the configuration.public ManagedRepository putRepository(ManagedRepositoryConfiguration managedRepositoryConfiguration) throws RepositoryException
putRepository in interface RepositoryRegistrymanagedRepositoryConfiguration - the repository configurationRepositoryException - if an error occurs, or the configuration is not valid.public ManagedRepository putRepository(ManagedRepositoryConfiguration managedRepositoryConfiguration, Configuration configuration) throws RepositoryException
putRepository in interface RepositoryRegistrymanagedRepositoryConfiguration - the new or changed managed repository configurationconfiguration - the configuration object (may be null)RepositoryException - if the configuration cannot be saved or updatedpublic RepositoryGroup putRepositoryGroup(RepositoryGroup repositoryGroup) throws RepositoryException
putRepositoryGroup in interface RepositoryRegistryrepositoryGroup - the new repository group.RepositoryException - if the new repository group could not be saved to the configuration.public RepositoryGroup putRepositoryGroup(RepositoryGroupConfiguration repositoryGroupConfiguration) throws RepositoryException
putRepositoryGroup in interface RepositoryRegistryrepositoryGroupConfiguration - the repository configurationRepositoryException - if an error occurs, or the configuration is not valid.public RepositoryGroup putRepositoryGroup(RepositoryGroupConfiguration repositoryGroupConfiguration, Configuration configuration) throws RepositoryException
putRepositoryGroup in interface RepositoryRegistryrepositoryGroupConfiguration - The configuration of the new or changed repository group.configuration - The configuration object. If it is null, the configuration is not saved.RepositoryException - if the configuration cannot be saved or updatedpublic RemoteRepository putRepository(RemoteRepository remoteRepository, Configuration configuration) throws RepositoryException
putRepository in interface RepositoryRegistryRepositoryExceptionpublic RemoteRepository putRepository(RemoteRepository remoteRepository) throws RepositoryException
putRepository in interface RepositoryRegistryremoteRepository - the remote repository to addRepositoryException - if an error occurs during configuration savepublic RemoteRepository putRepository(RemoteRepositoryConfiguration remoteRepositoryConfiguration) throws RepositoryException
putRepository in interface RepositoryRegistryremoteRepositoryConfiguration - the repository configurationRepositoryException - if an error occurs, or the configuration is not valid.public RemoteRepository putRepository(RemoteRepositoryConfiguration remoteRepositoryConfiguration, Configuration configuration) throws RepositoryException
putRepository in interface RepositoryRegistryremoteRepositoryConfiguration - the new or changed repository configurationconfiguration - the configuration objectRepositoryException - if the configuration cannot be saved or updatedpublic void removeRepository(String repoId) throws RepositoryException
removeRepository in interface RepositoryRegistryRepositoryExceptionpublic void removeRepository(Repository repo) throws RepositoryException
removeRepository in interface RepositoryRegistryRepositoryExceptionpublic void removeRepository(ManagedRepository managedRepository) throws RepositoryException
removeRepository in interface RepositoryRegistrymanagedRepository - the managed repository to removeRepositoryException - if a error occurs during configuration savepublic void removeRepository(ManagedRepository managedRepository, Configuration configuration) throws RepositoryException
removeRepository in interface RepositoryRegistryRepositoryExceptionpublic void removeRepositoryGroup(RepositoryGroup repositoryGroup) throws RepositoryException
removeRepositoryGroup in interface RepositoryRegistryrepositoryGroup - the repository group to removeRepositoryException - if a error occurs during configuration savepublic void removeRepositoryGroup(RepositoryGroup repositoryGroup, Configuration configuration) throws RepositoryException
removeRepositoryGroup in interface RepositoryRegistryRepositoryExceptionpublic void removeRepository(RemoteRepository remoteRepository) throws RepositoryException
removeRepository in interface RepositoryRegistryremoteRepository - the remote repository to removeRepositoryException - if a error occurs during configuration savepublic void removeRepository(RemoteRepository remoteRepository, Configuration configuration) throws RepositoryException
removeRepository in interface RepositoryRegistryRepositoryExceptionpublic void reload()
reload in interface RepositoryRegistrypublic void resetIndexingContext(Repository repository) throws IndexUpdateFailedException
resetIndexingContext in interface RepositoryRegistryrepository - The repositoryIndexUpdateFailedException - If the index could not be resetted.public ManagedRepository clone(ManagedRepository repo, String newId) throws RepositoryException
clone in interface RepositoryRegistryrepo - The origin repositoryRepositoryExceptionpublic <T extends Repository> Repository clone(T repo, String newId) throws RepositoryException
clone in interface RepositoryRegistryRepositoryExceptionpublic RemoteRepository clone(RemoteRepository repo, String newId) throws RepositoryException
clone in interface RepositoryRegistryrepo - The origin repositoryRepositoryExceptionpublic void configurationEvent(ConfigurationEvent event)
ConfigurationListenerconfigurationEvent in interface ConfigurationListenerpublic <T extends Event> void registerEventHandler(EventType<T> type, EventHandler<? super T> eventHandler)
registerEventHandler in interface EventSourcepublic <T extends Event> void unregisterEventHandler(EventType<T> type, EventHandler<? super T> eventHandler)
unregisterEventHandler in interface EventSourcepublic void handle(Event event)
handle in interface EventHandler<Event>Copyright © 2006–2019 The Apache Software Foundation. All rights reserved.