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 voidaddVcsRootUsageContributor(VcsRootUsagesContributor contributor)voidattachTo(SBuildType buildType, SVcsRoot vcsRoot)SVcsRootcreateNewVcsRoot(VcsUrl url, String name, VcsRootScope scope)voiddetachFrom(SBuildType buildType, SVcsRoot vcsRoot)SVcsRootExfindRootByExternalId(String vcsRootExternalId)Returns vcs root with specified external id.SVcsRootExfindRootById(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)intgetNumberOfUsagesInConfigurations(VcsRoot root)Returns number of usages of the specified VCS root in build configurationsintgetNumberOfUsagesInProjects(VcsRoot root)Returns number of usages of this VCS root in projects build configurations and templatesbooleanisUsedInProjects(SVcsRoot vcsRoot)voidsetProjectManager(ProjectManagerEx projectManager)voidsetVcsModificationHistoryEx(VcsModificationHistoryEx vcsModificationHistory)voidsetVcsSettingsTracker(VcsSettingsTracker vcsSettingsTracker)voidsetVcsStatusProvider(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:VcsRootsManagerreturns list of all registered vcs roots- Specified by:
getAllRegisteredVcsRootsin interfaceVcsRootsManager- Returns:
- see above
-
addVcsRootUsageContributor
public void addVcsRootUsageContributor(@NotNull VcsRootUsagesContributor contributor)- Specified by:
addVcsRootUsageContributorin interfaceVcsRootsManagerEx
-
findVcsRootsByScope
@NotNull public List<SVcsRoot> findVcsRootsByScope(@NotNull VcsRootScope scope)
Description copied from interface:VcsRootsManagerReturns all VCS roots having specified scope.- Specified by:
findVcsRootsByScopein 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:
UnsupportedVcsExceptionVcsException
-
getAllProjectUsages
@NotNull public List<SProject> getAllProjectUsages(@NotNull VcsRoot root)
Description copied from interface:VcsRootsManagerreturns all project which contain configurations which use the root. Projects are sorted withProjectManager.getProjectsComparator().- Specified by:
getAllProjectUsagesin interfaceVcsRootsManager- Parameters:
root- specified vcs root- Returns:
- all root usages in projects
-
isUsedInProjects
public boolean isUsedInProjects(@NotNull SVcsRoot vcsRoot)- Specified by:
isUsedInProjectsin 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:VcsRootsManagerReturns number of usages of this VCS root in projects build configurations and templates- Specified by:
getNumberOfUsagesInProjectsin interfaceVcsRootsManager- Parameters:
root- VCS root whose usages should be found- Returns:
- see above
-
getNumberOfUsagesInConfigurations
public int getNumberOfUsagesInConfigurations(VcsRoot root)
Description copied from interface:VcsRootsManagerReturns number of usages of the specified VCS root in build configurations- Specified by:
getNumberOfUsagesInConfigurationsin interfaceVcsRootsManager- Parameters:
root- VCS root whose usages are searched for- Returns:
- see above
-
findRootById
@Nullable public SVcsRootEx findRootById(long id)
Description copied from interface:VcsRootsManagerreturns vcs root with specified id- Specified by:
findRootByIdin interfaceVcsRootsManager- Specified by:
findRootByIdin interfaceVcsRootsManagerEx- Parameters:
id- vcs root id- Returns:
- vcs root by id
-
findRootByExternalId
@Nullable public SVcsRootEx findRootByExternalId(@Nullable String vcsRootExternalId)
Description copied from interface:VcsRootsManagerReturns 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:
findRootByExternalIdin interfaceVcsRootsManager- Specified by:
findRootByExternalIdin 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:VcsRootsManagerreturns available vcs roots with the given ids- Specified by:
findVcsRootsin 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:VcsRootsManagerReturns collection of VCS roots corresponding to VcsSupport with specified name (seeVcsSupportConfig.getName())- Specified by:
findRootsByVcsNamein interfaceVcsRootsManager- Parameters:
vcsSupportName- name of VcsSupport- Returns:
- see above
-
getAllConfigurationUsages
public List<SBuildType> getAllConfigurationUsages(VcsRoot root)
Description copied from interface:VcsRootsManagerReturns all configurations which use the root. Build configurations are sorted by project name then by build configuration name.- Specified by:
getAllConfigurationUsagesin 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:VcsRootsManagerExReturns all configurations which use the VCS roots specified. Result set can be unmodifiable.- Specified by:
getAllConfigurationUsagesin 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:VcsRootsManagerReturns all templates with specified vcs root attached.- Specified by:
getAllTemplateUsagesin interfaceVcsRootsManager- Parameters:
root- vcs root- Returns:
- all templates with specified vcs root
-
getAllVcsRootUsagesContributors
@NotNull public Set<VcsRootUsagesContributor> getAllVcsRootUsagesContributors()
- Specified by:
getAllVcsRootUsagesContributorsin 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:VcsRootsManagerReturns list of VCS roots having specified scope and having no usages in build configurations.- Specified by:
findUnusedVcsRootsByScopein 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:
getAttachedRootsin interfaceVcsRootsManagerEx
-
-