public interface RepositoryAdminService
Most methods require a String
parameter, name, naming
the repository.
All methods, unless mentioned otherwise, will throw the following exceptions:
NotFoundException
NotPermittedException
Modifier and Type | Method and Description |
---|---|
void |
create(RepositoryData repData)
Creates a repository and leaves it disabled.
|
void |
delete(java.lang.String name)
Delete a repository.
|
void |
disable(java.lang.String name)
Disable the repository.
|
void |
disablePolling(java.lang.String name)
Disables automatic polling on the target repository.
|
void |
enable(java.lang.String name)
Enable the repository.
|
boolean |
exists(java.lang.String name) |
void |
fullReindex(java.lang.String name,
boolean clone)
Delete the existing cache and re-index the repository from scratch.
|
DefaultRepositoryOptions |
getDefaultOptions()
Get the default repository options.
|
RepositoryOptions |
getEffectiveOptions(java.lang.String name)
Get the effective repository options for the repository, after delegating to-
and merging with the repository defaults.
|
RepositoryIndexer |
getIndexer(java.lang.String name)
Get the repository indexing service for the repository.
|
java.util.Set<java.lang.String> |
getNames()
Returns the name of all repositories.
|
java.util.Set<RepositoryData> |
getRepositories()
Returns the
RepositoryData of all repositories. |
RepositoryData |
getRepositoryData(java.lang.String name)
Return the data object for the repository.
|
RepositoryOptions |
getRepositoryOptions(java.lang.String name)
Return the repository options defined for the repository.
|
RepositoryState |
getState(java.lang.String name)
Return the state of the repository.
|
boolean |
isEnabled(java.lang.String name)
Whether the repository is enabled.
|
boolean |
isManaged(java.lang.String name)
Whether the repository is managed.
|
boolean |
isPipelined(java.lang.String name) |
void |
setDefaultOptions(DefaultRepositoryOptions options)
Set the default repository options.
|
void |
setRepositoryOptions(java.lang.String name,
RepositoryOptions options)
Set the repository options for just the specified repostiory.
|
RepositoryState |
start(java.lang.String name)
Start the repository.
|
RepositoryState |
stop(java.lang.String name)
Non-blocking call to stop the repository.
|
RepositoryState |
stopAndWait(java.lang.String name,
long timeoutMs)
Blocking call to stop the repository.
|
void |
testConnectionFor(RepositoryData repData)
Tests the connection for a repository.
|
RepositoryUpdateResult |
update(RepositoryData repData) |
java.util.Set<java.lang.String> getNames()
Set
of all repository names, or an empty set if there are noneboolean exists(java.lang.String name)
name
- the name of the repositorytrue
if and only if there exists a repository with a name equal to name
ignoring case.java.util.Set<RepositoryData> getRepositories()
RepositoryData
of all repositories.Set
of RepositoryData
, or an empty set if there are noneRepositoryData getRepositoryData(java.lang.String name)
RepositoryOptions getRepositoryOptions(java.lang.String name)
This excludes any merging with the default repository options. Use
getEffectiveOptions(String)
to get the effective options
used by the repository.
void setRepositoryOptions(java.lang.String name, RepositoryOptions options) throws RepositoryConfigException
When querying repository options, FishEye combines the repository
and default options (see getEffectiveOptions(String)
).
java.lang.NullPointerException
- if options is nullRepositoryConfigException
- if the repository options could not be persistedDefaultRepositoryOptions getDefaultOptions()
void setDefaultOptions(DefaultRepositoryOptions options) throws RepositoryConfigException
java.lang.NullPointerException
- if options is nullRepositoryConfigException
- if the default repository options could not be persistedRepositoryOptions getEffectiveOptions(java.lang.String name)
void create(RepositoryData repData) throws RepositoryConfigException
For CVS repositories, the directory must exist otherwise creation will fail.
java.lang.IllegalArgumentException
- if the repository name is already usedRepositoryConfigException
- if the repository couldn't be createdvoid testConnectionFor(RepositoryData repData) throws RepositoryConfigException
RepositoryConfigException
- if the repository config is invalidRepositoryUpdateResult update(RepositoryData repData) throws RepositoryConfigException
NotFoundException
- if the repository name doesn't existRepositoryConfigException
- if the repository couldn't be updatedRepositoryState getState(java.lang.String name)
java.lang.IllegalStateException
- if the repository is disabledboolean isEnabled(java.lang.String name)
boolean isManaged(java.lang.String name)
boolean isPipelined(java.lang.String name)
void enable(java.lang.String name) throws RepositoryConfigException
java.lang.IllegalStateException
- if the repository is enabledRepositoryConfigException
- if the enabling could not be persistedvoid disable(java.lang.String name) throws RepositoryConfigException
java.lang.IllegalStateException
- if the repository is disabled or not @{link RepositoryState#STOPPED}RepositoryConfigException
- if the disabling could not be persistedRepositoryState stop(java.lang.String name)
This method does not wait for the repository to stop. Use getState(String)
to check the progress of stopping the repository.
RepositoryState.STOPPING
, or RepositoryState.STOPPED
if immediately stoppedjava.lang.IllegalStateException
- if the repository is disabled or not @{link RepositoryState#RUNNING}RepositoryState stopAndWait(java.lang.String name, long timeoutMs)
Behaves the same as stop(String)
, but waits upto approximately timeoutMs for the
repository to stop before returning.
timeoutMs
- if timeoutMs <= 0, this acts as a call to stop(String)
RepositoryState.STOPPING
, or RepositoryState.STOPPED
if stopped after waitingstop(String)
RepositoryState start(java.lang.String name) throws RepositoryConfigException
RepositoryState.STARTING
or RepositoryState.RUNNING
if successfully startedjava.lang.IllegalStateException
- if the repository is disabled or not RepositoryState.STOPPED
RepositoryConfigException
- if there was a problem restarting the repository because of a configuration issuevoid delete(java.lang.String name) throws RepositoryConfigException
java.lang.IllegalStateException
- if the repository is enabled but not @{link RepositoryState#STOPPED}RepositoryConfigException
- if there was a problem deleting the repositoryRepositoryIndexer getIndexer(java.lang.String name)
CvsRepositoryIndexer
, GitRepositoryIndexer
,
P4RepositoryIndexer
, or SvnRepositoryIndexer
. You should
cast the result based on the type of the repository.void disablePolling(java.lang.String name) throws RepositoryConfigException
name
- the name of the repository to disable polling forRepositoryConfigException
void fullReindex(java.lang.String name, boolean clone) throws RepositoryConfigException, java.util.concurrent.TimeoutException
name
- the repository to reindexclone
- if the repository is a dvcs repository do a fresh clone before reindexingRepositoryConfigException
- when the re-indexing failedjava.util.concurrent.TimeoutException
- when the repository didn't stop in time