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 | Interface and Description |
---|---|
static class |
RepositoryAdminService.NamePolicy
Policy which defines how to handle repository creation in case when given repository key
(
RepositoryData.name ) already exists. |
Modifier and Type | Method and Description |
---|---|
boolean |
addRequiredGroup(java.lang.String repositoryName,
java.lang.String groupName)
Adds group to repository required groups list
Note the current user must have admin rights for this repository.
|
void |
create(RepositoryData repData)
Creates a repository and leaves it disabled.
|
void |
create(RepositoryData repData,
RepositoryAdminService.NamePolicy namePolicy)
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.
|
boolean |
displayNameExists(java.lang.String displayName)
Check if repository with given display name exists
|
void |
enable(java.lang.String name)
Enable the repository.
|
boolean |
exists(java.lang.String name)
Check if repository with key name exists
|
void |
fullIncrementalIndex(java.lang.String repositoryName)
Runs an full incremental repository index.
|
void |
fullReindex(java.lang.String name,
boolean clone)
Delete the existing cache and re-index the repository from scratch.
|
boolean |
getAllowAnonymous(java.lang.String repositoryName)
Gets repository "allow anonymous" flag.
|
boolean |
getAllowLoggedIn(java.lang.String repositoryName)
Gets repository "allow logged in" flag
Note the current user must have admin rights for this repository.
|
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 current user can admin.
|
java.util.Set<RepositoryData> |
getRepositories()
Returns the
RepositoryData of all repositories current user can admin. |
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.
|
Page<java.lang.String> |
getRequiredGroups(java.lang.String repositoryName,
PageRequest pageRequest)
Get a page of repository required groups
Note the current user must have admin rights for this repository.
|
RepositoryState |
getState(java.lang.String name)
Return the state of the repository.
|
boolean |
getUseDefaults(java.lang.String repositoryName)
Gets repository "use defaults" flag.
|
void |
incrementalIndex(java.lang.String repositoryName,
boolean wait)
Runs an incremental repository index.
|
boolean |
isEnabled(java.lang.String name)
Whether the repository is enabled.
|
boolean |
isManaged(java.lang.String name)
Deprecated.
managed repositories were deprecated in version 2.8 and removed completely in 3.2. See
https://confluence.atlassian.com/display/FISHEYE/End+of+Support+Announcement+for+Internally+Managed+Repositories
|
boolean |
isPipelined(java.lang.String name) |
void |
reindexChangesetDiscussion(java.lang.String repositoryName)
Rebuilds the changeset discussion index for the specified repository.
|
void |
reindexLineCount(java.lang.String repositoryName)
Re-indexes the linecount data used to generate the LOC graphs.
|
void |
reindexReviews(java.lang.String repositoryName)
Re-indexes all the Crucible revision data (which revisions have been reviewed)
|
void |
reindexSearch(java.lang.String repositoryName)
Rebuilds the search index data for the given repository.
|
boolean |
removeRequiredGroup(java.lang.String repositoryName,
java.lang.String groupName)
Removes group from repository required groups list
Note the current user must have admin rights for this repository.
|
void |
rescanMetadata(java.lang.String repositoryName,
java.lang.String fromRevision,
java.lang.String toRevision)
Re-scans the repository metadata.
|
Page<RepositoryData> |
searchRepositories(RepositorySearchCriteria repositorySearchCriteria,
PageRequest pageRequest) |
void |
setAllowAnonymous(java.lang.String repositoryName,
boolean allowAnonymous)
Sets repository "allow anonymous" flag.
|
void |
setAllowLoggedIn(java.lang.String repositoryName,
boolean allowLoggedIn)
Sets repository "allow logged in" flag.
|
void |
setDefaultAllowAnonymous(boolean allowAnonymous)
Sets default repository permissions "allow anonymous" flag
|
void |
setDefaultAllowLoggedIn(boolean allowLoggedIn)
Sets default repository permissions "allow logged in" flag
|
void |
setDefaultOptions(DefaultRepositoryOptions options)
Set the default repository options.
|
void |
setRepositoryOptions(java.lang.String name,
RepositoryOptions options)
Set the repository options for the specified repository.
|
void |
setRepositoryUpdateOptions(java.lang.String name,
UpdateOptions options)
Set the repository update options for the specified repository.
|
void |
setUseDefaults(java.lang.String repositoryName,
boolean useDefaults)
Sets repository "use defaults" flag
Note the current user must have admin rights for this repository.
|
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)
Stops repository and waits default timeout until repository is STOPPED
|
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 keys, or an empty set if there are noneboolean exists(java.lang.String name)
name
- the key of the repositorytrue
if and only if there exists a repository with a key equal to name
ignoring case and
current user can admin this repositoryboolean displayNameExists(java.lang.String displayName)
displayName
- the display name of the repositorytrue
if and only if there exists a repository with a display name equal to displayName
ignoring case and that current user can admin this repositoryjava.util.Set<RepositoryData> getRepositories()
RepositoryData
of all repositories current user can admin.Set
of RepositoryData
, or an empty set if there are nonePage<RepositoryData> searchRepositories(RepositorySearchCriteria repositorySearchCriteria, PageRequest pageRequest)
RepositoryData getRepositoryData(java.lang.String name) throws NotFoundException
NotFoundException
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 persistedvoid setRepositoryUpdateOptions(java.lang.String name, UpdateOptions options) throws RepositoryConfigException
RepositoryConfigException
- if the repository options could not be persistedboolean addRequiredGroup(java.lang.String repositoryName, java.lang.String groupName) throws NotPermittedException, RepositoryConfigException, NotFoundException, java.lang.IllegalStateException, java.lang.IllegalArgumentException
repositoryName
- repository keygroupName
- group nameNotPermittedException
- when user in context has no admin rightsRepositoryConfigException
- when configuration change could not be persistedNotFoundException
- when repository with repositoryName doesn't existjava.lang.IllegalStateException
- when permission properties settings do not allow for groupsjava.lang.IllegalArgumentException
- when group with groupName does not existboolean removeRequiredGroup(java.lang.String repositoryName, java.lang.String groupName) throws NotPermittedException, RepositoryConfigException, NotFoundException, java.lang.IllegalStateException
repositoryName
- repository keygroupName
- group nameNotPermittedException
- when user in context has no admin rightsRepositoryConfigException
- when configuration change could not be persistedNotFoundException
- when repository with repositoryName doesn't existjava.lang.IllegalStateException
- when permission properties settings do not allow for groupsPage<java.lang.String> getRequiredGroups(java.lang.String repositoryName, PageRequest pageRequest) throws NotPermittedException, NotFoundException, java.lang.IllegalStateException
repositoryName
- repository keypageRequest
- page request propertiesNotPermittedException
- when user in context has no admin rightsNotFoundException
- when repository with repositoryName doesn't existjava.lang.IllegalStateException
- when permission properties settings do not allow for groupsvoid setUseDefaults(java.lang.String repositoryName, boolean useDefaults) throws NotPermittedException, RepositoryConfigException, NotFoundException
repositoryName
- repository keyuseDefaults
- new "use defaults" flag valueNotPermittedException
- when user in context has no admin rightsRepositoryConfigException
- when configuration change could not be persistedNotFoundException
- when repository with repositoryName doesn't existboolean getUseDefaults(java.lang.String repositoryName) throws NotPermittedException, NotFoundException
repositoryName
- repository keyNotPermittedException
- when user in context has no admin rightsNotFoundException
- when repository with repositoryName doesn't existvoid setAllowAnonymous(java.lang.String repositoryName, boolean allowAnonymous) throws NotPermittedException, RepositoryConfigException, NotFoundException
repositoryName
- repository keyallowAnonymous
- new "allow anonymous" flag valueNotPermittedException
- when user in context has no admin rightsRepositoryConfigException
- when configuration change could not be persistedNotFoundException
- when repository with repositoryName doesn't existvoid setDefaultAllowAnonymous(boolean allowAnonymous) throws NotPermittedException, RepositoryConfigException
NotPermittedException
RepositoryConfigException
boolean getAllowAnonymous(java.lang.String repositoryName) throws NotPermittedException, NotFoundException
repositoryName
- repository keyNotPermittedException
- when user in context has no admin rightsNotFoundException
- when repository with repositoryName doesn't existvoid setAllowLoggedIn(java.lang.String repositoryName, boolean allowLoggedIn) throws NotPermittedException, RepositoryConfigException, NotFoundException
repositoryName
- repository keyallowLoggedIn
- new "allow logged in" flag valueNotPermittedException
- when user in context has no admin rightsRepositoryConfigException
- when configuration change could not be persistedNotFoundException
- when repository with repositoryName doesn't existvoid setDefaultAllowLoggedIn(boolean allowLoggedIn) throws NotPermittedException, RepositoryConfigException
allowLoggedIn
- new "allow logged in" flag valueNotPermittedException
- when user in context has no admin rightsRepositoryConfigException
- when configuration change could not be persistedboolean getAllowLoggedIn(java.lang.String repositoryName) throws NotPermittedException, NotFoundException
repositoryName
- repository keyNotPermittedException
- when user in context has no admin rightsNotFoundException
- when repository with repositoryName doesn't existDefaultRepositoryOptions 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 key is already usedjava.lang.IllegalArgumentException
- if the repository display name is already usedRepositoryConfigException
- if the repository couldn't be createdvoid create(RepositoryData repData, RepositoryAdminService.NamePolicy namePolicy) throws RepositoryConfigException
For CVS repositories, the directory must exist otherwise creation will fail.
repData
- details of the repository to be created; it updates the 'name' property if repository was renamednamePolicy
- how to resolve repository name conflictsjava.lang.IllegalArgumentException
- if failed to generate unique repository namejava.lang.IllegalArgumentException
- if the repository display 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 key 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)
@Deprecated boolean isManaged(java.lang.String name)
boolean isPipelined(java.lang.String name)
void enable(java.lang.String name) throws RepositoryConfigException
RepositoryConfigException
- 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 stopAndWait(java.lang.String name)
name
- repository keyRepositoryState.STOPPING
, or RepositoryState.STOPPED
if stopped after waitingRepositoryState 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 key 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 timevoid reindexChangesetDiscussion(java.lang.String repositoryName) throws RepositoryStateException
Not all changeset discussions will be listed in the activity stream until re-indexing is complete
Note this is asynchronous request to re-index changeset discussion and there is no guarantee to when and if it will be done.
repositoryName
- the key of the repository to perform the operation forRepositoryStateException
- when repository not in running statevoid reindexSearch(java.lang.String repositoryName) throws RepositoryStateException
Note that the reindex process might take some time, and that search data will only be partially available during the process.
Note this is asynchronous request to re-index search and there is no guarantee to when and if it will be done.
repositoryName
- the key of the repository to re-indexRepositoryStateException
- when repository not in running statevoid reindexLineCount(java.lang.String repositoryName) throws RepositoryStateException
Note this is asynchronous request to re-index line count and there is no guarantee to when and if it will be done.
repositoryName
- the key of the repository to re-indexRepositoryStateException
- when repository not in running statevoid reindexReviews(java.lang.String repositoryName) throws RepositoryStateException
Note this is asynchronous request to re-index reviews and there is no guarantee to when and if it will be done.
repositoryName
- the key of the repository to reindexRepositoryStateException
- when repository not in running statevoid incrementalIndex(java.lang.String repositoryName, boolean wait) throws RepositoryStateException
repositoryName
- repository keywait
- if true will wait for the indexing to finish before returningRepositoryStateException
- when repository not in running statevoid fullIncrementalIndex(java.lang.String repositoryName) throws RepositoryStateException
Note this is asynchronous request and there is no guarantee to when and if it will be done.
repositoryName
- the key of the repository to scanRepositoryStateException
- when repository not in running statevoid rescanMetadata(java.lang.String repositoryName, java.lang.String fromRevision, java.lang.String toRevision) throws RepositoryStateException
Note this is asynchronous request to rescan metadata and there is no guarantee to to when and if it will be done.
repositoryName
- the key of the repository to re-scanfromRevision
- the revision number to start attoRevision
- the revision number to end atRepositoryStateException
- when repository not in running state