jetbrains.buildServer.vcs
Interface VcsRootsUpdate

All Known Subinterfaces:
VcsManager

public interface VcsRootsUpdate

Vcs root registry.


Method Summary
 SVcsRoot createNewVcsRoot(java.lang.String vcsSupportName, java.lang.String vcsRootName, java.util.Map<java.lang.String,java.lang.String> options, VcsRootScope scope)
          Creates and registers new root with specified parameters.
 SVcsRoot createNewVcsRoot(SVcsRoot originalRoot, VcsRootScope scope)
          Creates copy of specified VCS root.
 SVcsRoot createNewVcsRoot(VcsUrl url, java.lang.String name, VcsRootScope scope)
          Creates a VCS root from an URL
 void persistVcsRoots()
          Persists all of the VCS roots on disk.
 void removeVcsRoot(long vcsRootId)
          Removes VCS root from the list of registered vcs roots.
 void setVcsRootScope(long vcsRootId, VcsRootScope scope)
          Sets scope of the specified VCS root.
 SVcsRoot updateVcsRoot(long vcsRootId, java.lang.String vcsSupportName, java.lang.String newVcsRootName, java.util.Map<java.lang.String,java.lang.String> options)
          Updates VCS root with specified id and sets there new options and checkout path.
 

Method Detail

createNewVcsRoot

@NotNull
SVcsRoot createNewVcsRoot(@NotNull
                                  java.lang.String vcsSupportName,
                                  @Nullable
                                  java.lang.String vcsRootName,
                                  @NotNull
                                  java.util.Map<java.lang.String,java.lang.String> options,
                                  @NotNull
                                  VcsRootScope scope)
                          throws UnknownVcsException,
                                 DuplicateVcsRootNameException
Creates and registers new root with specified parameters. New VCS root will be given unique name.

Parameters:
vcsSupportName - VCS support name
vcsRootName - optional name of this VCS root, if null or empty string, unique name will be generated automatically
options - VCS root options
scope - scope of newly created VCS root
Returns:
newly created VCS root
Throws:
DuplicateVcsRootNameException - if name is not null and VCS root with such name already exists
UnknownVcsException - if specified VCS support does not exist

createNewVcsRoot

@NotNull
SVcsRoot createNewVcsRoot(@NotNull
                                  VcsUrl url,
                                  @NotNull
                                  java.lang.String name,
                                  @NotNull
                                  VcsRootScope scope)
                          throws UnknownVcsException,
                                 VcsException
Creates a VCS root from an URL

Parameters:
url - the URL (todo describe in more detail)
name - the name of the root
scope - scope of created VCS root
Returns:
a new VCS root
Throws:
UnknownVcsException - if there is no VCS support for this URL
VcsException - if other error occurs

createNewVcsRoot

@NotNull
SVcsRoot createNewVcsRoot(@NotNull
                                  SVcsRoot originalRoot,
                                  @NotNull
                                  VcsRootScope scope)
Creates copy of specified VCS root.

Parameters:
originalRoot - VCS root to copy
scope - scope of newly created VCS root
Returns:
VCS root copy

updateVcsRoot

@NotNull
SVcsRoot updateVcsRoot(long vcsRootId,
                               @NotNull
                               java.lang.String vcsSupportName,
                               @NotNull
                               java.lang.String newVcsRootName,
                               @NotNull
                               java.util.Map<java.lang.String,java.lang.String> options)
                       throws VcsRootNotFoundException,
                              DuplicateVcsRootNameException
Updates VCS root with specified id and sets there new options and checkout path. If either options or checkout path are changed then new VCS root version is created.

Parameters:
vcsRootId - id of VCS root to update
vcsSupportName - name/type of VCS (VcsSupportConfig.getName())
newVcsRootName - new VCS root name
options - new options
Returns:
updated VCS root instance
Throws:
DuplicateVcsRootNameException - if new VCS root name is specified and another VCS root with same name already exists
VcsRootNotFoundException - if VCS root with specified id does not exist

setVcsRootScope

void setVcsRootScope(long vcsRootId,
                     @NotNull
                     VcsRootScope scope)
                     throws VcsRootNotFoundException,
                            ScopeCannotBeChangedException
Sets scope of the specified VCS root. VCS root can have project or global scope. VCS roots with project scope are available to this project only. VCS roots with global scope are available globally, for all projects.

Parameters:
vcsRootId - VCS root id
scope - VCS root scope
Throws:
VcsRootNotFoundException - if VCS root does not exist
ScopeCannotBeChangedException - on attempt to set local project scope if VCS root is used in another project

removeVcsRoot

void removeVcsRoot(long vcsRootId)
                   throws VcsRootUsedException
Removes VCS root from the list of registered vcs roots.

Parameters:
vcsRootId - vcs root id
Throws:
VcsRootUsedException - if VCS root is attached to a build configuration

persistVcsRoots

void persistVcsRoots()
                     throws PersistFailedException
Persists all of the VCS roots on disk. Must be called after the each update of VCS roots.

Throws:
PersistFailedException - if persistence failed