Package jetbrains.buildServer.serverSide
Interface SProject
-
- All Superinterfaces:
BuildProject
,java.lang.Comparable<BuildProject>
,InheritableUserParametersHolder
,jetbrains.buildServer.log.Loggable
,ParametersSupport
,ReadOnlyUserParameters
,SPersistentEntity
,UserParametersHolder
public interface SProject extends BuildProject, SPersistentEntity, InheritableUserParametersHolder, ParametersSupport, jetbrains.buildServer.log.Loggable
Represents a server side project
-
-
Field Summary
-
Fields inherited from interface jetbrains.buildServer.BuildProject
ROOT_PROJECT_ID
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description SProjectFeatureDescriptor
addFeature(java.lang.String id, java.lang.String type, java.util.Map<java.lang.String,java.lang.String> params)
Adds new project feature with provided ID if auto-generated ID is not desirableSProjectFeatureDescriptor
addFeature(java.lang.String type, java.util.Map<java.lang.String,java.lang.String> params)
Adds new project feature.void
addFeature(SProjectFeatureDescriptor feature)
Adds project feature.boolean
belongsTo(SProject project)
Returns true if the specified project is or contains (including transitively) this project.boolean
containsBuildType(java.lang.String buildTypeId)
Returns true if this project or one of subprojects has own build configuration with specified id.SBuildType
copyBuildType(SBuildType originalBuildType, java.lang.String newExtId, java.lang.String newName, CopyOptions copyOptions)
Creates a copy of the given build configuration.BuildTypeTemplate
copyBuildTypeTemplate(BuildTypeTemplate originalTemplate, java.lang.String newExtId, java.lang.String newName)
Creates new template by copying settings from the original one.SVcsRoot
copyVcsRoot(SVcsRoot originalRoot, java.lang.String externalId)
Creates a copy of original VCS root in this project.SBuildType
createBuildType(java.lang.String name)
Creates new build configuration with given nameSBuildType
createBuildType(java.lang.String extId, java.lang.String name)
Creates new build configuration with given external identifier and name.SBuildType
createBuildType(java.lang.String name, java.lang.String runnerType, int maximumNumberOfBuilds, BuildTypeDescriptor.CheckoutType checkoutType)
Deprecated.since 8.0, usecreateBuildType(String, String)
instead.SBuildType
createBuildType(SBuildType originalBuildType, java.lang.String newName, boolean copyVcsRoots, boolean changeScopeOfLocalVcsRoots)
Deprecated.SBuildType
createBuildType(SBuildType originalBuildType, java.lang.String newName, CopyOptions copyOptions)
Deprecated.SBuildType
createBuildTypeFromTemplate(BuildTypeTemplate template, java.lang.String extId, java.lang.String name)
Creates build configuration on the base of specified template.SBuildType
createBuildTypeFromTemplate(BuildTypeTemplate template, java.lang.String name, CopyOptions copyOptions)
Creates build configuration on the base of specified template.BuildTypeTemplate
createBuildTypeTemplate(java.lang.String name)
Creates new build configuration template.BuildTypeTemplate
createBuildTypeTemplate(java.lang.String extId, java.lang.String name)
Creates new build configuration template with given external identifier an name.BuildTypeTemplate
createBuildTypeTemplate(BuildTypeTemplate originalTemplate, java.lang.String newName, CopyOptions copyOptions)
Deprecated.BuildTypeTemplate
createBuildTypeTemplate(SBuildType originalBuildType, java.lang.String name, CopyOptions copyOptions)
Deprecated.SVcsRoot
createDummyVcsRoot(java.lang.String vcsName, java.util.Map<java.lang.String,java.lang.String> parameters)
Creates a dummy VCS root which cannot be persisted, but can be used in cases when project specific VCS operation must be performed.SProject
createProject(java.lang.String externalId, java.lang.String projectName)
Creates new sub project in this projectSVcsRoot
createVcsRoot(java.lang.String vcsName, java.lang.String externalId, java.lang.String name)
Creates new VCS root in this projectSVcsRoot
createVcsRoot(java.lang.String vcsName, java.lang.String name, java.util.Map<java.lang.String,java.lang.String> params)
Creates new VCS root in this projectBuildTypeTemplate
extractBuildTypeTemplate(SBuildType originalBuildType, java.lang.String extId, java.lang.String name)
Extracts a template from the specified build type.SBuildType
findBuildTypeByExternalId(java.lang.String externalId)
Searches for a build configuration in this and nested projects by the specified external id.SBuildType
findBuildTypeById(java.lang.String internalId)
Searches for a build configuration in this and nested projects by the specified internal id.SBuildType
findBuildTypeByName(java.lang.String name)
Searches for a build configuration with specified name among own build configurations of this project (not in subprojects).BuildTypeIdentity
findBuildTypeIdentityByName(java.lang.String name)
Looks for a build template or a configuration with specified name among own build template and configurations of this project.BuildTypeTemplate
findBuildTypeTemplateByExternalId(java.lang.String extId)
Searches for build type template by given external id in this and nested project.BuildTypeTemplate
findBuildTypeTemplateById(java.lang.String intId)
Searches for build type template by given internal id in this and nested projects.BuildTypeTemplate
findBuildTypeTemplateByName(java.lang.String name)
Searches for a template with specified name in this project (not in subprojects).SProjectFeatureDescriptor
findFeatureById(java.lang.String featureId)
Finds project feature by id.SProject
findProjectByName(java.lang.String projectName)
Returns own sub project with specified name (case insensitive) or null if there is no such project.SVcsRoot
findVcsRootByName(java.lang.String name)
Returns own VCS root with given name or null if project does not have such VCS rootjava.util.Date
getArchivingTime()
Returns the date when the project was archived.User
getArchivingUser()
Returns the user who archived the project.java.io.File
getArtifactsDirectory()
Returns directory containing all of the project artifacts.java.util.Collection<SProjectFeatureDescriptor>
getAvailableFeatures()
java.util.Collection<SProjectFeatureDescriptor>
getAvailableFeaturesOfType(java.lang.String type)
java.util.List<BuildTypeTemplate>
getAvailableTemplates()
java.util.List<SVcsRoot>
getAvailableVcsRoots()
java.util.List<SBuildType>
getBuildTypes()
Returns all build configurations registered in this project and all its subprojects (not only direct subprojects, but all).java.util.List<BuildTypeTemplate>
getBuildTypeTemplates()
Returns all build configuration templates registered in this project and all its subprojects (not only direct).java.io.File
getConfigDirectory()
Returns this project configuration directory, i.e.java.io.File
getConfigurationFile()
Returns this project configuration file, named "project-config.xml" in project configuration directoryCustomDataStorage
getCustomDataStorage(java.lang.String storageId)
Returns a custom data storage for the given storage id associated with this projectBuildTypeTemplate
getDefaultTemplate()
Returns a default template effective in the projectjava.lang.String
getDefaultTemplateId()
Returns an internal id of a default template effective in the projectjava.lang.String
getExtendedFullName()
Returns the full name of the project with additional note if the project is archived, i.e.java.lang.String
getExtendedName()
Returns the name of the project with additional note if the project is archived, i.e.java.util.List<SBuildType>
getOwnBuildTypes()
Returns all build configurations registered in this certain project.java.util.List<BuildTypeTemplate>
getOwnBuildTypeTemplates()
Returns build configuration templates registered in this certain project.BuildTypeTemplate
getOwnDefaultTemplate()
Returns a default template defined in the projectjava.lang.String
getOwnDefaultTemplateId()
Returns an internal id of a default template defined in the projectjava.util.Collection<SProjectFeatureDescriptor>
getOwnFeatures()
java.util.Collection<SProjectFeatureDescriptor>
getOwnFeaturesOfType(java.lang.String type)
java.util.List<SProject>
getOwnProjects()
Returns only own sub projects of this project.java.util.List<SVcsRoot>
getOwnVcsRoots()
Returns VCS roots associated with this certain project.SProject
getParentProject()
Returns the parent of this project.java.io.File
getPluginDataDirectory(java.lang.String pluginName)
Returns plugin data directory for given plugin namejava.io.File
getPluginSettingsFile()
Deprecated.use project features insteadjava.util.List<User>
getPotentiallyResponsibleUsers()
Returns the list of users who potentially can be responsible for failures in this project.java.util.List<SProject>
getProjectPath()
The tree path in project hierarchy from the root project to this one (in other words, all parents of this and this one).java.util.List<SProject>
getProjects()
Returns all sub projects of this project transitively.Status
getStatus(java.lang.String branch)
java.util.List<SVcsRoot>
getUsedVcsRoots()
java.util.List<VcsRootInstance>
getVcsRootInstances()
java.util.List<SVcsRoot>
getVcsRoots()
Returns all VCS roots associated with this project and all its subprojects transitively.boolean
hasBuildTypes()
Returns true if this project contains at least one own build configurationboolean
isArchived()
Returns true if the project is archivedboolean
isInModel()
Return true if this project is attached to the TeamCity project model.boolean
isVirtual()
Returns true for so-called virtual projects.void
moveToProject(ConfigAction cause, SProject target)
Moves this project to the target project.void
moveToProject(SProject target)
Moves this project to the target project.void
persist()
Persists this project configuration on disk.void
removeBuildType(java.lang.String internalBuildTypeId)
Deprecated.since 8.0, useSPersistentEntity.remove()
instead.void
removeBuildTypes()
Deprecated.since 8.0, useSPersistentEntity.remove()
orSPersistentEntity.remove()
methods in order to completely remove build types or templates with their configuration filesvoid
removeBuildTypeTemplate(java.lang.String internalId)
Deprecated.useSPersistentEntity.remove()
instead.SProjectFeatureDescriptor
removeFeature(java.lang.String featureId)
Removes project feature with specified id.void
setArchived(boolean archived, User user)
Sets project's and sub project's archived flags, pauses build configurations.void
setDescription(java.lang.String description)
Sets this project descriptionvoid
setExternalId(java.lang.String newId)
Sets the external project id.void
setExternalId(ConfigAction cause, java.lang.String newId)
Sets the external project id.void
setName(java.lang.String name)
Renames projectboolean
updateFeature(java.lang.String featureId, java.lang.String newType, java.util.Map<java.lang.String,java.lang.String> newParams)
Updates type and parameters of project feature with specified id.-
Methods inherited from interface jetbrains.buildServer.BuildProject
getDescription, getExternalId, getFullName, getName, getParentProjectExternalId, getParentProjectId, getProjectId, getStatus, isRootProject
-
Methods inherited from interface jetbrains.buildServer.serverSide.InheritableUserParametersHolder
getInheritedParametersCollection, getOwnParameter, getOwnParameters, getOwnParametersCollection, getOwnParametersWithoutInheritedSpec, getParameters, getParametersCollection
-
Methods inherited from interface jetbrains.buildServer.serverSide.ParametersSupport
getParametersProvider, getValueResolver
-
Methods inherited from interface jetbrains.buildServer.serverSide.ReadOnlyUserParameters
getParameter, getParameterValue
-
Methods inherited from interface jetbrains.buildServer.serverSide.SPersistentEntity
createConfigAction, getConfigId, getConfigurationFile, getExternalId, getName, getParent, getReadOnlyReason, getVersion, isReadOnly, markPersisted, persist, remove, schedulePersisting, schedulePersisting, scheduleRemove
-
Methods inherited from interface jetbrains.buildServer.serverSide.UserParametersHolder
addParameter, removeParameter
-
-
-
-
Method Detail
-
setExternalId
void setExternalId(@NotNull java.lang.String newId) throws InvalidIdentifierException, DuplicateExternalIdException, ObsoleteEntityException, ReadOnlyEntityException
Sets the external project id.All such project identifiers must be unique case insensitively.
This method performs persisting. You don't need to call persist when this method done.
- Parameters:
newId
- the new external project identifier.- Throws:
ObsoleteEntityException
- when project is not the same as the one in the project model (since 9.1.2)InvalidIdentifierException
DuplicateExternalIdException
ReadOnlyEntityException
- Since:
- 8.0
-
setExternalId
void setExternalId(@NotNull ConfigAction cause, @NotNull java.lang.String newId) throws InvalidIdentifierException, DuplicateExternalIdException, ObsoleteEntityException, ReadOnlyEntityException
Sets the external project id.All such project identifiers must be unique case insensitively.
This method performs persisting and changes the disk structure immediately. You don't need to call persist when this method done.
- Parameters:
newId
- the new external project identifier.- Throws:
ObsoleteEntityException
- when project is not the same as the one in the project model (since 9.1.2)InvalidIdentifierException
DuplicateExternalIdException
ReadOnlyEntityException
- Since:
- 9.0
-
setName
void setName(@NotNull java.lang.String name) throws ReadOnlyEntityException
Renames project- Parameters:
name
- new project name- Throws:
DuplicateProjectNameException
- if there is another project with same nameProjectRenamingFailedException
- if an error prevents from project renamingReadOnlyEntityException
-
setDescription
void setDescription(@Nullable java.lang.String description) throws ReadOnlyEntityException
Sets this project description- Parameters:
description
- new project description- Throws:
ReadOnlyEntityException
-
getDefaultTemplateId
@Nullable java.lang.String getDefaultTemplateId()
Returns an internal id of a default template effective in the project- Returns:
- see above, null if no default template is found
- Since:
- 2017.2
-
getOwnDefaultTemplateId
@Nullable java.lang.String getOwnDefaultTemplateId()
Returns an internal id of a default template defined in the project- Returns:
- see above, null if no default template is found
- Since:
- 2017.2
-
getDefaultTemplate
@Nullable BuildTypeTemplate getDefaultTemplate()
Returns a default template effective in the project- Returns:
- see above, null if no default template is found
- Since:
- 2017.2
-
getOwnDefaultTemplate
@Nullable BuildTypeTemplate getOwnDefaultTemplate()
Returns a default template defined in the project- Returns:
- see above, null if no default template is found
- Since:
- 2017.2
-
getParentProject
@Nullable SProject getParentProject()
Returns the parent of this project.Every project, except root, has a parent.
Note that sometimes during initialization the child project may already exist while the parent project does not exist yet. In this case for some time null could be returned for non-root projects.
- Specified by:
getParentProject
in interfaceBuildProject
- Returns:
- the parent project, or null if this is a root.
- Since:
- 8.0
- See Also:
BuildProject.getParentProjectId()
,BuildProject.getParentProjectExternalId()
-
getOwnProjects
@NotNull java.util.List<SProject> getOwnProjects()
Returns only own sub projects of this project.- Specified by:
getOwnProjects
in interfaceBuildProject
- Returns:
- list of projects sorted by name
- Since:
- 8.0
-
getProjects
@NotNull java.util.List<SProject> getProjects()
Returns all sub projects of this project transitively.- Specified by:
getProjects
in interfaceBuildProject
- Returns:
- list of projects sorted by name
- Since:
- 8.0
-
getProjectPath
@NotNull java.util.List<SProject> getProjectPath()
The tree path in project hierarchy from the root project to this one (in other words, all parents of this and this one).- Returns:
- the tree path; the first node of this list is always the root project, the last node of this list is always this project.
- Since:
- 8.0
-
getOwnVcsRoots
@NotNull java.util.List<SVcsRoot> getOwnVcsRoots()
Returns VCS roots associated with this certain project. Does NOT include VCS roots from subprojects.- Specified by:
getOwnVcsRoots
in interfaceBuildProject
- Returns:
- list of VCS roots sorted by VCS root name
- Since:
- 8.0
-
findProjectByName
@Nullable SProject findProjectByName(@NotNull java.lang.String projectName)
Returns own sub project with specified name (case insensitive) or null if there is no such project.- Parameters:
projectName
- name of the project to look for- Returns:
- a project or null if such a sub project does not exist
- Since:
- 8.0
-
findVcsRootByName
@Nullable SVcsRoot findVcsRootByName(@NotNull java.lang.String name)
Returns own VCS root with given name or null if project does not have such VCS root- Parameters:
name
- name of VCS root- Returns:
- found VCS root or null
- Since:
- 8.0
-
getVcsRoots
@NotNull java.util.List<SVcsRoot> getVcsRoots()
Returns all VCS roots associated with this project and all its subprojects transitively.- Specified by:
getVcsRoots
in interfaceBuildProject
- Returns:
- list of vcs roots
-
getUsedVcsRoots
@NotNull java.util.List<SVcsRoot> getUsedVcsRoots()
- Returns:
- all VCS roots used in this project and subprojects (attached to build types or templates)
- Since:
- 8.0
-
getVcsRootInstances
@NotNull java.util.List<VcsRootInstance> getVcsRootInstances()
- Returns:
- all VCS root instances used in the project and subprojects.
- Since:
- 6.5
-
getConfigDirectory
@NotNull java.io.File getConfigDirectory()
Returns this project configuration directory, i.e. a directory where this project configuration is stored.- Returns:
- this project configuration directory
-
getConfigurationFile
@NotNull java.io.File getConfigurationFile()
Returns this project configuration file, named "project-config.xml" in project configuration directory- Specified by:
getConfigurationFile
in interfaceSPersistentEntity
- Returns:
- this project configuration file
-
getPluginSettingsFile
@Deprecated @NotNull java.io.File getPluginSettingsFile()
Deprecated.use project features insteadReturns the plugin settings file for this project scope settings.- Returns:
- see plugin settings file (an XML file).
-
getArtifactsDirectory
@NotNull java.io.File getArtifactsDirectory()
Returns directory containing all of the project artifacts.- Returns:
- directory containing all of the project artifacts.
-
getPluginDataDirectory
@NotNull java.io.File getPluginDataDirectory(@NotNull java.lang.String pluginName)
Returns plugin data directory for given plugin name- Returns:
- directory containing some plugin data.
- Since:
- 8.0
-
createBuildType
@NotNull SBuildType createBuildType(@NotNull java.lang.String extId, @NotNull java.lang.String name) throws DuplicateExternalIdException, DuplicateBuildTypeNameException, MaxNumberOfBuildTypesReachedException, ReadOnlyEntityException
Creates new build configuration with given external identifier and name.- Parameters:
extId
- external identifier for the new build configuration (must be unique in all build configuration scope, case insensitively).name
- name of the build configuration (must be unique in the project scope).- Returns:
- newly created build configuration.
- Throws:
DuplicateExternalIdException
- when he given external id already belongs to another build template or build type.DuplicateBuildTypeNameException
- if build configuration with such name already exists in this project.MaxNumberOfBuildTypesReachedException
- if maximum number of build configurations is reached.ReadOnlyEntityException
- Since:
- 8.0
-
createBuildType
@NotNull SBuildType createBuildType(@NotNull java.lang.String name) throws DuplicateBuildTypeNameException, MaxNumberOfBuildTypesReachedException, ReadOnlyEntityException
Creates new build configuration with given name- Parameters:
name
- name of the build configuration- Returns:
- newly created build configuration
- Throws:
DuplicateBuildTypeNameException
- if build configuration with such name already exists in this projectMaxNumberOfBuildTypesReachedException
- if maximum number of build configurations is reachedReadOnlyEntityException
- Since:
- 6.0
- See Also:
createBuildType(String, String)
-
createBuildType
@NotNull @Deprecated SBuildType createBuildType(@NotNull java.lang.String name, @NotNull java.lang.String runnerType, int maximumNumberOfBuilds, BuildTypeDescriptor.CheckoutType checkoutType) throws DuplicateBuildTypeNameException, MaxNumberOfBuildTypesReachedException, ReadOnlyEntityException
Deprecated.since 8.0, usecreateBuildType(String, String)
instead.Creates a new build configuration- Parameters:
name
- name of the build configurationrunnerType
- type of the runnermaximumNumberOfBuilds
- maximum number of buildscheckoutType
- type of the checkout- Returns:
- newly created build configuration
- Throws:
DuplicateBuildTypeNameException
- if build configuration with such name already exists in this projectMaxNumberOfBuildTypesReachedException
- if maximum number of build configurations is reachedReadOnlyEntityException
- See Also:
createBuildType(String, String)
-
createBuildTypeTemplate
@NotNull BuildTypeTemplate createBuildTypeTemplate(@NotNull java.lang.String extId, @NotNull java.lang.String name) throws DuplicateTemplateNameException, DuplicateExternalIdException, ReadOnlyEntityException
Creates new build configuration template with given external identifier an name.- Parameters:
extId
- external id (must be unique thru all projects, case insensitively).name
- name for the new template.- Returns:
- newly created template.
- Throws:
DuplicateTemplateNameException
- thrown if template with such name already exists.DuplicateExternalIdException
- if this external identifier belongs to another template.ReadOnlyEntityException
- Since:
- 8.0
-
createBuildTypeTemplate
@NotNull BuildTypeTemplate createBuildTypeTemplate(@NotNull java.lang.String name) throws DuplicateTemplateNameException, ReadOnlyEntityException
Creates new build configuration template.- Parameters:
name
- name of the template- Returns:
- newly created template
- Throws:
DuplicateTemplateNameException
- thrown if template with such name already existsReadOnlyEntityException
- Since:
- 5.0
- See Also:
createBuildTypeTemplate(String, String)
-
copyBuildTypeTemplate
@NotNull BuildTypeTemplate copyBuildTypeTemplate(@NotNull BuildTypeTemplate originalTemplate, @NotNull java.lang.String newExtId, @NotNull java.lang.String newName) throws InvalidVcsRootScopeException, ReadOnlyEntityException
Creates new template by copying settings from the original one.- Parameters:
originalTemplate
- original templatenewExtId
- new external identifier.newName
- new template name- Returns:
- new template
- Throws:
InvalidVcsRootScopeException
- if a VCS root cannot be attached to templateReadOnlyEntityException
- Since:
- 8.0
-
createBuildTypeTemplate
@NotNull @Deprecated BuildTypeTemplate createBuildTypeTemplate(@NotNull BuildTypeTemplate originalTemplate, @NotNull java.lang.String newName, @NotNull CopyOptions copyOptions) throws InvalidVcsRootScopeException, ReadOnlyEntityException
Deprecated.Creates new template by copying settings from the original one.- Parameters:
originalTemplate
- original templatenewName
- new template namecopyOptions
- options to control copy operation- Returns:
- new template
- Throws:
InvalidVcsRootScopeException
- if a VCS root cannot be attached to templateReadOnlyEntityException
- Since:
- 5.0
- See Also:
copyBuildTypeTemplate(BuildTypeTemplate, String, String)
-
extractBuildTypeTemplate
@NotNull BuildTypeTemplate extractBuildTypeTemplate(@NotNull SBuildType originalBuildType, @NotNull java.lang.String extId, @NotNull java.lang.String name) throws InvalidVcsRootScopeException, InvalidIdentifierException, DuplicateExternalIdException
Extracts a template from the specified build type.- Parameters:
originalBuildType
- original template.extId
- new template external identifier.name
- new template name.- Returns:
- new template.
- Throws:
DuplicateExternalIdException
- when the given external identifier belongs to another template.InvalidVcsRootScopeException
- when a VCS root cannot be attached to template.InvalidIdentifierException
- Since:
- 8.0
-
createBuildTypeTemplate
@NotNull @Deprecated BuildTypeTemplate createBuildTypeTemplate(@NotNull SBuildType originalBuildType, @NotNull java.lang.String name, @NotNull CopyOptions copyOptions) throws InvalidVcsRootScopeException, ReadOnlyEntityException
Deprecated.Extracts a template from the specified build type.- Parameters:
originalBuildType
- original templatename
- new template namecopyOptions
- options to control copy operation- Returns:
- new template
- Throws:
InvalidVcsRootScopeException
- if a VCS root cannot be attached to templateReadOnlyEntityException
- Since:
- 5.0
- See Also:
extractBuildTypeTemplate(SBuildType, String, String)
-
copyBuildType
@NotNull SBuildType copyBuildType(@NotNull SBuildType originalBuildType, @NotNull java.lang.String newExtId, @NotNull java.lang.String newName, @NotNull CopyOptions copyOptions) throws MaxNumberOfBuildTypesReachedException, InvalidVcsRootScopeException, DuplicateExternalIdException, ReadOnlyEntityException
Creates a copy of the given build configuration.- Parameters:
originalBuildType
- build configuration to copynewName
- name to use for new configuration. If there exists configuration with same name in the target project then " (1)", " (2)", ... suffix will be added to the specified name.copyOptions
- additional options- Returns:
- build configuration copy
- Throws:
MaxNumberOfBuildTypesReachedException
- if maximum number of build configurations is reachedInvalidVcsRootScopeException
- if a VCS root cannot be attached to build configurationDuplicateExternalIdException
ReadOnlyEntityException
- Since:
- 8.0
-
createBuildType
@NotNull @Deprecated SBuildType createBuildType(@NotNull SBuildType originalBuildType, @NotNull java.lang.String newName, @NotNull CopyOptions copyOptions) throws MaxNumberOfBuildTypesReachedException, InvalidVcsRootScopeException, ReadOnlyEntityException
Deprecated.Creates new build configuration on the base of the specified original build configuration.- Parameters:
originalBuildType
- build configuration to copynewName
- name to use for new configuration. If there exists configuration with same name in the target project then " (1)", " (2)", ... suffix will be added to the specified name.copyOptions
- additional options- Returns:
- build configuration copy
- Throws:
MaxNumberOfBuildTypesReachedException
- if maximum number of build configurations is reachedInvalidVcsRootScopeException
- if a VCS root cannot be attached to build configurationReadOnlyEntityException
- See Also:
copyBuildType(SBuildType, String, String, CopyOptions)
-
createBuildTypeFromTemplate
@NotNull SBuildType createBuildTypeFromTemplate(@NotNull BuildTypeTemplate template, @NotNull java.lang.String extId, @NotNull java.lang.String name) throws MaxNumberOfBuildTypesReachedException, InvalidVcsRootScopeException, DuplicateExternalIdException, ReadOnlyEntityException
Creates build configuration on the base of specified template.- Parameters:
template
- build configuration template.extId
- external identifier for the new build configuration.name
- name for the new build configuration.- Returns:
- new build configuration.
- Throws:
DuplicateExternalIdException
- if the given external identifier belongs to another build type (possible in another project).MaxNumberOfBuildTypesReachedException
- if maximum number of build configurations is reached.InvalidVcsRootScopeException
- if a VCS root cannot be attached to build configuration.ReadOnlyEntityException
- Since:
- 8.0
-
createBuildTypeFromTemplate
@NotNull SBuildType createBuildTypeFromTemplate(@NotNull BuildTypeTemplate template, @NotNull java.lang.String name, @NotNull CopyOptions copyOptions) throws MaxNumberOfBuildTypesReachedException, InvalidVcsRootScopeException, ReadOnlyEntityException
Creates build configuration on the base of specified template.- Parameters:
template
- build configuration templatename
- name to use for build configuration. If there exists configuration with same name in the target project then " (1)", " (2)", ... suffix will be added to the specified name.copyOptions
- options to control copy operation- Returns:
- new build configuration
- Throws:
MaxNumberOfBuildTypesReachedException
- if maximum number of build configurations is reachedInvalidVcsRootScopeException
- if a VCS root cannot be attached to build configurationReadOnlyEntityException
- Since:
- 5.0
- See Also:
createBuildTypeFromTemplate(BuildTypeTemplate, String, String)
-
createBuildType
@Deprecated @NotNull SBuildType createBuildType(SBuildType originalBuildType, java.lang.String newName, boolean copyVcsRoots, boolean changeScopeOfLocalVcsRoots) throws MaxNumberOfBuildTypesReachedException, InvalidVcsRootScopeException, ReadOnlyEntityException
Deprecated.
-
findBuildTypeIdentityByName
@Nullable BuildTypeIdentity findBuildTypeIdentityByName(@NotNull java.lang.String name)
Looks for a build template or a configuration with specified name among own build template and configurations of this project.- Parameters:
name
- name of the build template or configuration to look for, case insensitive.- Returns:
- found build template of configuration, or null if not found.
- See Also:
findBuildTypeTemplateByName(java.lang.String)
,findBuildTypeByName(java.lang.String)
-
findBuildTypeById
@Nullable SBuildType findBuildTypeById(@Nullable java.lang.String internalId)
Searches for a build configuration in this and nested projects by the specified internal id.- Parameters:
internalId
- the internal id of the build configuration to look for; case sensitive.- Returns:
- the found build configuration or null.
- See Also:
findBuildTypeByExternalId(String)
-
findBuildTypeByExternalId
@Nullable SBuildType findBuildTypeByExternalId(@Nullable java.lang.String externalId)
Searches for a build configuration in this and nested projects by the specified external id.- Parameters:
externalId
- the external id of the build configuration to look for; case insensitive.- Returns:
- the found build configuration or null.
- Since:
- 8.1
- See Also:
findBuildTypeById(String)
-
findBuildTypeByName
@Nullable SBuildType findBuildTypeByName(@NotNull java.lang.String name)
Searches for a build configuration with specified name among own build configurations of this project (not in subprojects).- Parameters:
name
- name of the build configuration to look for.- Returns:
- found build configuration or null.
- See Also:
findBuildTypeByExternalId(String)
,findBuildTypeById(String)
-
removeBuildTypes
@Deprecated void removeBuildTypes() throws ReadOnlyEntityException
Deprecated.since 8.0, useSPersistentEntity.remove()
orSPersistentEntity.remove()
methods in order to completely remove build types or templates with their configuration filesUnregisters all of the build templates and configurations stored in this project, does not remove any configuration files from disk- Throws:
ReadOnlyEntityException
-
removeBuildType
@Deprecated void removeBuildType(java.lang.String internalBuildTypeId) throws ReadOnlyEntityException
Deprecated.since 8.0, useSPersistentEntity.remove()
instead.Removes build configuration with specified internal id- Parameters:
internalBuildTypeId
- internal id of the build configuration- Throws:
ReadOnlyEntityException
-
getOwnBuildTypes
@NotNull java.util.List<SBuildType> getOwnBuildTypes()
Returns all build configurations registered in this certain project. Does NOT include build configurations from subprojects.- Specified by:
getOwnBuildTypes
in interfaceBuildProject
- Returns:
- list of build configurations sorted by name
-
getBuildTypes
@NotNull java.util.List<SBuildType> getBuildTypes()
Returns all build configurations registered in this project and all its subprojects (not only direct subprojects, but all).- Specified by:
getBuildTypes
in interfaceBuildProject
- Returns:
- list of build configurations sorted by name
- Since:
- 8.0
-
hasBuildTypes
boolean hasBuildTypes()
Returns true if this project contains at least one own build configuration- Returns:
- true if this project has it's own build configurations
-
containsBuildType
boolean containsBuildType(@NotNull java.lang.String buildTypeId)
Returns true if this project or one of subprojects has own build configuration with specified id.- Parameters:
buildTypeId
- internal id of the build configuration.- Returns:
- true if the build type specified with the given id belongs to this project or its subprojects.
- See Also:
BuildTypeIdentity.belongsTo(SProject)
-
isInModel
boolean isInModel()
Return true if this project is attached to the TeamCity project model.- Returns:
- see above
-
getPotentiallyResponsibleUsers
java.util.List<User> getPotentiallyResponsibleUsers()
Returns the list of users who potentially can be responsible for failures in this project.- Returns:
- users who committed to this project within last 5 days.
- Since:
- 4.0.2
-
persist
void persist() throws PersistFailedException
Persists this project configuration on disk.- Specified by:
persist
in interfaceSPersistentEntity
- Throws:
PersistFailedException
- if project persisting failed
-
isArchived
boolean isArchived()
Returns true if the project is archived- Returns:
- true if the project is archived
- Since:
- 5.0
-
setArchived
void setArchived(boolean archived, @Nullable User user) throws ReadOnlyEntityException
Sets project's and sub project's archived flags, pauses build configurations. Persists configuration changes on disk.- Parameters:
archived
- is the project archiveduser
- the user the performs the action- Throws:
ReadOnlyEntityException
- Since:
- 5.0
-
getArchivingUser
@Nullable User getArchivingUser()
Returns the user who archived the project. Returns null, if project is active, or the action author is unknown.- Returns:
- user who archived the project
- Since:
- 5.0
-
getArchivingTime
@Nullable java.util.Date getArchivingTime()
Returns the date when the project was archived. Returns null, if project is active, or the action author is unknown.- Returns:
- archiving time
- Since:
- 5.0
-
getExtendedName
@NotNull java.lang.String getExtendedName()
Returns the name of the project with additional note if the project is archived, i.e. " (archived)" suffix. Useful when archived projects should be shown together with non-archived.- Returns:
- extended project name
- Since:
- 5.0
- See Also:
BuildProject.getName()
-
getExtendedFullName
@NotNull java.lang.String getExtendedFullName()
Returns the full name of the project with additional note if the project is archived, i.e. " (archived)" suffix. Useful when archived projects should be shown together with non-archived.- Returns:
- extended full project name
- Since:
- 8.0
- See Also:
BuildProject.getFullName()
-
getOwnBuildTypeTemplates
@NotNull java.util.List<BuildTypeTemplate> getOwnBuildTypeTemplates()
Returns build configuration templates registered in this certain project. Does NOT include build configuration templates from subprojects.- Returns:
- list of build configuration templates sorted by name
- Since:
- 5.0
-
getBuildTypeTemplates
@NotNull java.util.List<BuildTypeTemplate> getBuildTypeTemplates()
Returns all build configuration templates registered in this project and all its subprojects (not only direct).- Returns:
- list of build configuration templates sorted by name
- Since:
- 8.0
-
getAvailableTemplates
@NotNull java.util.List<BuildTypeTemplate> getAvailableTemplates()
- Returns:
- list of templates available in this project, i.e. all templates of this project and all templates from parents.
- Since:
- 8.0
-
getAvailableVcsRoots
@NotNull java.util.List<SVcsRoot> getAvailableVcsRoots()
- Returns:
- list of VCS roots available in this project, i.e. all VCS roots of this project and all VCS roots from parents.
- Since:
- 8.0
-
findBuildTypeTemplateById
@Nullable BuildTypeTemplate findBuildTypeTemplateById(@NotNull java.lang.String intId)
Searches for build type template by given internal id in this and nested projects.- Parameters:
intId
- internal id of template to look for.- Returns:
- found template or null.
- Since:
- 5.0
- See Also:
findBuildTypeTemplateByExternalId(java.lang.String)
-
findBuildTypeTemplateByExternalId
@Nullable BuildTypeTemplate findBuildTypeTemplateByExternalId(@NotNull java.lang.String extId)
Searches for build type template by given external id in this and nested project.- Parameters:
extId
- external id of template to look for.- Returns:
- found template or null.
- Since:
- 5.0
- See Also:
findBuildTypeTemplateById(java.lang.String)
-
findBuildTypeTemplateByName
@Nullable BuildTypeTemplate findBuildTypeTemplateByName(@NotNull java.lang.String name)
Searches for a template with specified name in this project (not in subprojects).- Parameters:
name
- name of the template.- Returns:
- see above
- Since:
- 5.0
- See Also:
findBuildTypeTemplateByExternalId(java.lang.String)
,findBuildTypeTemplateById(java.lang.String)
-
removeBuildTypeTemplate
@Deprecated void removeBuildTypeTemplate(@NotNull java.lang.String internalId) throws TemplateCannotBeRemovedException, ReadOnlyEntityException
Deprecated.useSPersistentEntity.remove()
instead.Removes build configuration template- Parameters:
internalId
- internal id of the template- Throws:
TemplateCannotBeRemovedException
- if template cannot be deletedReadOnlyEntityException
- Since:
- 5.0
-
belongsTo
boolean belongsTo(@NotNull SProject project)
Returns true if the specified project is or contains (including transitively) this project.- Parameters:
project
- project- Returns:
- true if the specified project is or contains (including transitively) this project
- Since:
- 8.0
-
moveToProject
void moveToProject(@NotNull SProject target) throws CyclicDependencyException, InvalidVcsRootScopeException, ReadOnlyEntityException
Moves this project to the target project.- Parameters:
target
- new parent project for this project- Throws:
ReadOnlyEntityException
- if target project is read onlyCyclicDependencyException
InvalidVcsRootScopeException
- Since:
- 8.0
-
moveToProject
void moveToProject(@NotNull ConfigAction cause, @NotNull SProject target) throws CyclicDependencyException, InvalidVcsRootScopeException, ReadOnlyEntityException
Moves this project to the target project.- Parameters:
cause
- config action caused the changetarget
- new parent project for this project- Throws:
ReadOnlyEntityException
- if target project is read onlyCyclicDependencyException
InvalidVcsRootScopeException
- Since:
- 9.0
-
copyVcsRoot
@NotNull SVcsRoot copyVcsRoot(@NotNull SVcsRoot originalRoot, @Nullable java.lang.String externalId) throws ReadOnlyEntityException
Creates a copy of original VCS root in this project.- Parameters:
originalRoot
- original VCS root.externalId
- external id for the copy; if null the the external id will be generated automatically.- Returns:
- VCS root copy
- Throws:
ReadOnlyEntityException
- Since:
- 8.0
-
createVcsRoot
@NotNull SVcsRoot createVcsRoot(@NotNull java.lang.String vcsName, @Nullable java.lang.String name, @NotNull java.util.Map<java.lang.String,java.lang.String> params) throws UnknownVcsException, DuplicateVcsRootNameException, ReadOnlyEntityException
Creates new VCS root in this project- Parameters:
vcsName
- name of VCS pluginname
- name of VCS root, if null or empty new name will be generated automaticallyparams
- VCS root parameters- Returns:
- newly created VCS root
- Throws:
UnknownVcsException
- if VCS plugin with specified name does not existDuplicateVcsRootNameException
- if provided VCS root name duplicates name of existing VCS rootReadOnlyEntityException
- Since:
- 8.0
-
createVcsRoot
@NotNull SVcsRoot createVcsRoot(@NotNull java.lang.String vcsName, @NotNull java.lang.String externalId, @NotNull java.lang.String name) throws DuplicateExternalIdException, DuplicateVcsRootNameException, ReadOnlyEntityException
Creates new VCS root in this project- Parameters:
vcsName
- name of VCS pluginexternalId
- VCS root external idname
- VCS root name- Returns:
- newly created VCS root
- Throws:
DuplicateExternalIdException
- if external IDDuplicateVcsRootNameException
- if provided VCS root name duplicates name of existing VCS rootReadOnlyEntityException
-
createDummyVcsRoot
@NotNull SVcsRoot createDummyVcsRoot(@NotNull java.lang.String vcsName, @NotNull java.util.Map<java.lang.String,java.lang.String> parameters)
Creates a dummy VCS root which cannot be persisted, but can be used in cases when project specific VCS operation must be performed.- Parameters:
vcsName
- name of VCS pluginparameters
- VCS root properties- Returns:
- see above
- Since:
- 2018.1.1
-
createProject
@NotNull SProject createProject(@NotNull java.lang.String externalId, @NotNull java.lang.String projectName) throws InvalidIdentifierException, InvalidNameException, DuplicateProjectNameException, DuplicateExternalIdException, ReadOnlyEntityException
Creates new sub project in this project- Parameters:
externalId
- new sub project idprojectName
- new sub project name- Returns:
- newly created sub project
- Throws:
InvalidIdentifierException
InvalidNameException
DuplicateProjectNameException
DuplicateExternalIdException
ReadOnlyEntityException
- Since:
- 8.0
-
addFeature
@NotNull SProjectFeatureDescriptor addFeature(@NotNull java.lang.String type, @NotNull java.util.Map<java.lang.String,java.lang.String> params) throws ReadOnlyEntityException
Adds new project feature.- Parameters:
type
- type of the featureparams
- feature parameters- Returns:
- newly created object representing this project feature
- Throws:
ReadOnlyEntityException
- Since:
- 10.0
-
addFeature
@NotNull SProjectFeatureDescriptor addFeature(@NotNull java.lang.String id, @NotNull java.lang.String type, @NotNull java.util.Map<java.lang.String,java.lang.String> params) throws ReadOnlyEntityException
Adds new project feature with provided ID if auto-generated ID is not desirable- Parameters:
id
- id of the featuretype
- type of the featureparams
- feature parameters- Returns:
- newly created object representing this project feature
- Throws:
ReadOnlyEntityException
- Since:
- 2022.10
-
addFeature
void addFeature(@NotNull SProjectFeatureDescriptor feature) throws ReadOnlyEntityException
Adds project feature. If the project feature doesn't belong to this project - a copy will be created.- Parameters:
feature
- project feature to add- Throws:
ReadOnlyEntityException
- Since:
- 10.0
-
getOwnFeatures
@NotNull java.util.Collection<SProjectFeatureDescriptor> getOwnFeatures()
- Returns:
- own project features.
- Since:
- 10.0
-
getOwnFeaturesOfType
@NotNull java.util.Collection<SProjectFeatureDescriptor> getOwnFeaturesOfType(@NotNull java.lang.String type)
- Parameters:
type
- type of project feature- Returns:
- own project features of specified type.
- Since:
- 10.0
-
getAvailableFeaturesOfType
@NotNull java.util.Collection<SProjectFeatureDescriptor> getAvailableFeaturesOfType(@NotNull java.lang.String type)
- Parameters:
type
- type of project feature- Returns:
- project features of this project and all its ancestors. Own features come first, Root project`s last.
- Since:
- 10.0
-
getAvailableFeatures
@NotNull java.util.Collection<SProjectFeatureDescriptor> getAvailableFeatures()
- Returns:
- project all features of this project and all its ancestors. Own features come first, Root project`s last.
- Since:
- 10.0
-
removeFeature
@Nullable SProjectFeatureDescriptor removeFeature(@NotNull java.lang.String featureId) throws ReadOnlyEntityException
Removes project feature with specified id.- Parameters:
featureId
- feature id- Returns:
- removed feature or null if there was no feature with such id
- Throws:
ReadOnlyEntityException
- Since:
- 10.0
-
updateFeature
boolean updateFeature(@NotNull java.lang.String featureId, @NotNull java.lang.String newType, @NotNull java.util.Map<java.lang.String,java.lang.String> newParams) throws ReadOnlyEntityException
Updates type and parameters of project feature with specified id.- Parameters:
featureId
- feature idnewType
- new feature typenewParams
- new feature parameters- Returns:
- true if feature with specified id was found and updated
- Throws:
ReadOnlyEntityException
- Since:
- 10.0
-
findFeatureById
@Nullable SProjectFeatureDescriptor findFeatureById(@NotNull java.lang.String featureId)
Finds project feature by id.- Parameters:
featureId
- feature id- Returns:
- found feature or null
- Since:
- 10.0
-
getCustomDataStorage
@NotNull CustomDataStorage getCustomDataStorage(@NotNull java.lang.String storageId)
Returns a custom data storage for the given storage id associated with this project- Parameters:
storageId
- storage id of interest- Returns:
- see above
-
getStatus
@NotNull Status getStatus(@NotNull java.lang.String branch)
- Parameters:
branch
- branch name- Returns:
- status of specified branch
-
isVirtual
boolean isVirtual()
Returns true for so-called virtual projects. Virtual projects most likely are created automatically and exist for auxiliary purposes. They can disappear or can be recreated at any point of time. If the project is marked as "virtual", then it is not shown in the lists of projects and is only accessible by direct URL. User data, such as mutes and investigations, should not be assigned with such projects.- Specified by:
isVirtual
in interfaceSPersistentEntity
- Returns:
- true if the project is virtual and false otherwise.
- Since:
- 2022.02
-
-