Package jetbrains.buildServer.vcs.impl
Class VcsRootsManagerImpl
- java.lang.Object
-
- jetbrains.buildServer.vcs.impl.VcsRootsManagerImpl
-
- All Implemented Interfaces:
VcsRootsManager
,VcsRootsManagerEx
public class VcsRootsManagerImpl extends Object implements VcsRootsManagerEx
-
-
Constructor Summary
Constructors Constructor Description VcsRootsManagerImpl(VcsRegistry registrar, EventDispatcher<BuildServerListener> dispatcher, SecurityContextEx securityContext, ServerResponsibility serverResponsibility)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addVcsRootUsageContributor(VcsRootUsagesContributor contributor)
void
attachTo(SBuildType buildType, SVcsRoot vcsRoot)
SVcsRoot
createNewVcsRoot(VcsUrl url, String name, VcsRootScope scope)
void
detachFrom(SBuildType buildType, SVcsRoot vcsRoot)
SVcsRootEx
findRootByExternalId(String vcsRootExternalId)
Returns vcs root with specified external id.SVcsRootEx
findRootById(long id)
returns vcs root with specified idCollection<? extends SVcsRoot>
findRootsByVcsName(String vcsSupportName)
Returns collection of VCS roots corresponding to VcsSupport with specified name (seeVcsSupportConfig.getName()
)List<SVcsRoot>
findUnusedVcsRootsByScope(VcsRootScope scope)
Returns list of VCS roots having specified scope and having no usages in build configurations.Collection<SVcsRoot>
findVcsRoots(Collection<Long> ids)
returns available vcs roots with the given idsList<SVcsRoot>
findVcsRootsByScope(VcsRootScope scope)
Returns all VCS roots having specified scope.Set<String>
getAllConfigurationUsages(Collection<Long> vcsRootIds)
Returns all configurations which use the VCS roots specified.List<SBuildType>
getAllConfigurationUsages(VcsRoot root)
Returns all configurations which use the root.List<SProject>
getAllProjectUsages(VcsRoot root)
returns all project which contain configurations which use the root.List<SVcsRoot>
getAllRegisteredVcsRoots()
returns list of all registered vcs rootsList<BuildTypeTemplate>
getAllTemplateUsages(VcsRoot root)
Returns all templates with specified vcs root attached.Set<VcsRootUsagesContributor>
getAllVcsRootUsagesContributors()
List<SVcsRoot>
getAttachedRoots(SBuildType buildType)
int
getNumberOfUsagesInConfigurations(VcsRoot root)
Returns number of usages of the specified VCS root in build configurationsint
getNumberOfUsagesInProjects(VcsRoot root)
Returns number of usages of this VCS root in projects build configurations and templatesboolean
isUsedInProjects(SVcsRoot vcsRoot)
void
setProjectManager(ProjectManagerEx projectManager)
void
setVcsModificationHistoryEx(VcsModificationHistoryEx vcsModificationHistory)
void
setVcsSettingsTracker(VcsSettingsTracker vcsSettingsTracker)
void
setVcsStatusProvider(VcsStatusLogger statusProvider)
-
-
-
Constructor Detail
-
VcsRootsManagerImpl
public VcsRootsManagerImpl(@NotNull VcsRegistry registrar, @NotNull EventDispatcher<BuildServerListener> dispatcher, @NotNull SecurityContextEx securityContext, @NotNull ServerResponsibility serverResponsibility)
-
-
Method Detail
-
setVcsModificationHistoryEx
public void setVcsModificationHistoryEx(@NotNull VcsModificationHistoryEx vcsModificationHistory)
-
setVcsStatusProvider
public void setVcsStatusProvider(@NotNull VcsStatusLogger statusProvider)
-
setProjectManager
public void setProjectManager(ProjectManagerEx projectManager)
-
setVcsSettingsTracker
public void setVcsSettingsTracker(@NotNull VcsSettingsTracker vcsSettingsTracker)
-
getAllRegisteredVcsRoots
@NotNull public List<SVcsRoot> getAllRegisteredVcsRoots()
Description copied from interface:VcsRootsManager
returns list of all registered vcs roots- Specified by:
getAllRegisteredVcsRoots
in interfaceVcsRootsManager
- Returns:
- see above
-
addVcsRootUsageContributor
public void addVcsRootUsageContributor(@NotNull VcsRootUsagesContributor contributor)
- Specified by:
addVcsRootUsageContributor
in interfaceVcsRootsManagerEx
-
findVcsRootsByScope
@NotNull public List<SVcsRoot> findVcsRootsByScope(@NotNull VcsRootScope scope)
Description copied from interface:VcsRootsManager
Returns all VCS roots having specified scope.- Specified by:
findVcsRootsByScope
in interfaceVcsRootsManager
- Parameters:
scope
- scope of VCS roots- Returns:
- all VCS roots with specified scope
-
createNewVcsRoot
@NotNull public SVcsRoot createNewVcsRoot(@NotNull VcsUrl url, @NotNull String name, @NotNull VcsRootScope scope) throws UnsupportedVcsException, VcsException
- Throws:
UnsupportedVcsException
VcsException
-
getAllProjectUsages
@NotNull public List<SProject> getAllProjectUsages(@NotNull VcsRoot root)
Description copied from interface:VcsRootsManager
returns all project which contain configurations which use the root. Projects are sorted withProjectManager.getProjectsComparator()
.- Specified by:
getAllProjectUsages
in interfaceVcsRootsManager
- Parameters:
root
- specified vcs root- Returns:
- all root usages in projects
-
isUsedInProjects
public boolean isUsedInProjects(@NotNull SVcsRoot vcsRoot)
- Specified by:
isUsedInProjects
in interfaceVcsRootsManager
- Parameters:
vcsRoot
- VCS Root to check- Returns:
- true if VCS root is used by any project (is attached to a build configuration or template, or is used as Versioned Settings VCS root)
-
getNumberOfUsagesInProjects
public int getNumberOfUsagesInProjects(VcsRoot root)
Description copied from interface:VcsRootsManager
Returns number of usages of this VCS root in projects build configurations and templates- Specified by:
getNumberOfUsagesInProjects
in interfaceVcsRootsManager
- Parameters:
root
- VCS root whose usages should be found- Returns:
- see above
-
getNumberOfUsagesInConfigurations
public int getNumberOfUsagesInConfigurations(VcsRoot root)
Description copied from interface:VcsRootsManager
Returns number of usages of the specified VCS root in build configurations- Specified by:
getNumberOfUsagesInConfigurations
in interfaceVcsRootsManager
- Parameters:
root
- VCS root whose usages are searched for- Returns:
- see above
-
findRootById
@Nullable public SVcsRootEx findRootById(long id)
Description copied from interface:VcsRootsManager
returns vcs root with specified id- Specified by:
findRootById
in interfaceVcsRootsManager
- Specified by:
findRootById
in interfaceVcsRootsManagerEx
- Parameters:
id
- vcs root id- Returns:
- vcs root by id
-
findRootByExternalId
@Nullable public SVcsRootEx findRootByExternalId(@Nullable String vcsRootExternalId)
Description copied from interface:VcsRootsManager
Returns vcs root with specified external id. Since 8.1 the method also looks up the vcs root by the previous external ids. So the result project can have a different external id after a call. But the later is impossible if there is a vcs root that currently has aexternalId
.- Specified by:
findRootByExternalId
in interfaceVcsRootsManager
- Specified by:
findRootByExternalId
in interfaceVcsRootsManagerEx
- Parameters:
vcsRootExternalId
- vcs root external id- Returns:
- vcs root by external id
-
findVcsRoots
@NotNull public Collection<SVcsRoot> findVcsRoots(@NotNull Collection<Long> ids)
Description copied from interface:VcsRootsManager
returns available vcs roots with the given ids- Specified by:
findVcsRoots
in interfaceVcsRootsManager
- Parameters:
ids
- root ids- Returns:
- collection of available object identified by the given ids
-
findRootsByVcsName
@NotNull public Collection<? extends SVcsRoot> findRootsByVcsName(String vcsSupportName)
Description copied from interface:VcsRootsManager
Returns collection of VCS roots corresponding to VcsSupport with specified name (seeVcsSupportConfig.getName()
)- Specified by:
findRootsByVcsName
in interfaceVcsRootsManager
- Parameters:
vcsSupportName
- name of VcsSupport- Returns:
- see above
-
getAllConfigurationUsages
public List<SBuildType> getAllConfigurationUsages(VcsRoot root)
Description copied from interface:VcsRootsManager
Returns all configurations which use the root. Build configurations are sorted by project name then by build configuration name.- Specified by:
getAllConfigurationUsages
in interfaceVcsRootsManager
- Parameters:
root
- specified vcs root- Returns:
- all root usages in configuration
-
getAllConfigurationUsages
@NotNull public Set<String> getAllConfigurationUsages(@NotNull Collection<Long> vcsRootIds)
Description copied from interface:VcsRootsManagerEx
Returns all configurations which use the VCS roots specified. Result set can be unmodifiable.- Specified by:
getAllConfigurationUsages
in interfaceVcsRootsManagerEx
- Parameters:
vcsRootIds
- ids of vcs roots to search through- Returns:
- all root usages (set of build type ids)
- See Also:
VcsRootsManager.getAllConfigurationUsages(VcsRoot)
-
getAllTemplateUsages
@NotNull public List<BuildTypeTemplate> getAllTemplateUsages(@NotNull VcsRoot root)
Description copied from interface:VcsRootsManager
Returns all templates with specified vcs root attached.- Specified by:
getAllTemplateUsages
in interfaceVcsRootsManager
- Parameters:
root
- vcs root- Returns:
- all templates with specified vcs root
-
getAllVcsRootUsagesContributors
@NotNull public Set<VcsRootUsagesContributor> getAllVcsRootUsagesContributors()
- Specified by:
getAllVcsRootUsagesContributors
in interfaceVcsRootsManagerEx
- Returns:
- all registred extension which can provide additional usages for VCS root
-
findUnusedVcsRootsByScope
public List<SVcsRoot> findUnusedVcsRootsByScope(@NotNull VcsRootScope scope)
Description copied from interface:VcsRootsManager
Returns list of VCS roots having specified scope and having no usages in build configurations.- Specified by:
findUnusedVcsRootsByScope
in interfaceVcsRootsManager
- Parameters:
scope
- scope to filter VCS roots- Returns:
- list of unused VCS roots
-
attachTo
public void attachTo(@NotNull SBuildType buildType, @NotNull SVcsRoot vcsRoot)
-
detachFrom
public void detachFrom(@NotNull SBuildType buildType, @NotNull SVcsRoot vcsRoot)
-
getAttachedRoots
@NotNull public List<SVcsRoot> getAttachedRoots(@NotNull SBuildType buildType)
- Specified by:
getAttachedRoots
in interfaceVcsRootsManagerEx
-
-