public interface

RepositoryAdminService

com.atlassian.fisheye.spi.admin.services.RepositoryAdminService

Class Overview

API for adminstration of FishEye repositories.

Most methods require a String parameter, name, naming the repository.

All methods, unless mentioned otherwise, will throw the following exceptions:

NotFoundException
if the supplied repository name doesn't exist.
NotPermittedException
if the requesting user isn't an administrator.

Summary

Public Methods
abstract void create(RepositoryData repData)
Creates a repository and leaves it disabled.
abstract void delete(String name)
Delete a repository.
abstract void disable(String name)
Disable the repository.
abstract void disablePolling(String name)
Disables automatic polling on the target repository.
abstract void enable(String name)
Enable the repository.
abstract boolean exists(String name)
abstract DefaultRepositoryOptions getDefaultOptions()
Get the default repository options.
abstract RepositoryOptions getEffectiveOptions(String name)
Get the effective repository options for the repository, after delegating to- and merging with the repository defaults.
abstract RepositoryIndexer getIndexer(String name)
Get the repository indexing service for the repository.
abstract Set<String> getNames()
Returns the name of all repositories.
abstract Set<RepositoryData> getRepositories()
Returns the RepositoryData of all repositories.
abstract RepositoryData getRepositoryData(String name)
Return the data object for the repository.
abstract RepositoryOptions getRepositoryOptions(String name)
Return the repository options defined for the repository.
abstract RepositoryState getState(String name)
Return the state of the repository.
abstract boolean isEnabled(String name)
Whether the repository is enabled.
abstract boolean isManaged(String name)
Whether the repository is managed.
abstract void setDefaultOptions(DefaultRepositoryOptions options)
Set the default repository options.
abstract void setRepositoryOptions(String name, RepositoryOptions options)
Set the repository options for just the specified repostiory.
abstract RepositoryState start(String name)
Start the repository.
abstract RepositoryState stop(String name)
Non-blocking call to stop the repository.
abstract RepositoryState stopAndWait(String name, long timeoutMs)
Blocking call to stop the repository.
abstract void testConnectionFor(RepositoryData repData)
Tests the connection for a repository.
abstract RepositoryUpdateResult update(RepositoryData repData)

Public Methods

public abstract void create (RepositoryData repData)

Creates a repository and leaves it disabled.

For CVS repositories, the directory must exist otherwise creation will fail.

Throws
IllegalArgumentException if the repository name is already used
RepositoryConfigException if the repository couldn't be created

public abstract void delete (String name)

Delete a repository.

Throws
IllegalStateException if the repository is enabled but not @{link RepositoryState#STOPPED}
RepositoryConfigException if there was a problem deleting the repository

public abstract void disable (String name)

Disable the repository.

Throws
IllegalStateException if the repository is disabled or not @{link RepositoryState#STOPPED}
RepositoryConfigException if the disabling could not be persisted

public abstract void disablePolling (String name)

Disables automatic polling on the target repository. This is useful for managed repositories, which detect when they are being pushed to and index on demand.

Parameters
name the name of the repository to disable polling for

public abstract void enable (String name)

Enable the repository.

Throws
IllegalStateException if the repository is enabled
RepositoryConfigException if the enabling could not be persisted

public abstract boolean exists (String name)

Parameters
name the name of the repository
Returns
  • true if and only if there exists a repository with a name equal to name ignoring case.

public abstract DefaultRepositoryOptions getDefaultOptions ()

Get the default repository options.

Returns
  • the default repository options

public abstract RepositoryOptions getEffectiveOptions (String name)

Get the effective repository options for the repository, after delegating to- and merging with the repository defaults.

public abstract RepositoryIndexer getIndexer (String name)

Get the repository indexing service for the repository.

Returns

public abstract Set<String> getNames ()

Returns the name of all repositories.

Returns
  • a Set of all repository names, or an empty set if there are none

public abstract Set<RepositoryData> getRepositories ()

Returns the RepositoryData of all repositories.

Returns

public abstract RepositoryData getRepositoryData (String name)

Return the data object for the repository.

public abstract RepositoryOptions getRepositoryOptions (String name)

Return the repository options defined for the repository.

This excludes any merging with the default repository options. Use getEffectiveOptions(String) to get the effective options used by the repository.

public abstract RepositoryState getState (String name)

Return the state of the repository.

Throws
IllegalStateException if the repository is disabled

public abstract boolean isEnabled (String name)

Whether the repository is enabled.

public abstract boolean isManaged (String name)

Whether the repository is managed.

public abstract void setDefaultOptions (DefaultRepositoryOptions options)

Set the default repository options.

Throws
NullPointerException if options is null
RepositoryConfigException if the default repository options could not be persisted

public abstract void setRepositoryOptions (String name, RepositoryOptions options)

Set the repository options for just the specified repostiory.

When querying repository options, FishEye combines the repository and default options (see getEffectiveOptions(String)).

Throws
NullPointerException if options is null
RepositoryConfigException if the repository options could not be persisted

public abstract RepositoryState start (String name)

Start the repository.

Returns
Throws
IllegalStateException if the repository is disabled or not STOPPED
RepositoryConfigException if there was a problem starting the repository

public abstract RepositoryState stop (String name)

Non-blocking call to stop the repository.

This method does not wait for the repository to stop. Use getState(String) to check the progress of stopping the repository.

Returns
Throws
IllegalStateException if the repository is disabled or not @{link RepositoryState#RUNNING}

public abstract RepositoryState stopAndWait (String name, long timeoutMs)

Blocking call to stop the repository.

Behaves the same as stop(String), but waits upto approximately timeoutMs for the repository to stop before returning.

Parameters
timeoutMs if timeoutMs , this acts as a call to stop(String)
Returns
See Also

public abstract void testConnectionFor (RepositoryData repData)

Tests the connection for a repository. This method supports testing the connection of a repository prior to registering it.

Throws
RepositoryConfigException if the repository config is invalid

public abstract RepositoryUpdateResult update (RepositoryData repData)

Throws
NotFoundException if the repository name doesn't exist
RepositoryConfigException if the repository couldn't be updated