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


Nested Class Summary
static interface SProject.ProjectUpdater
          Object which updates some project aspect.
 
Field Summary
 
Fields inherited from interface jetbrains.buildServer.BuildProject
ROOT_PROJECT_ID
 
Method Summary
 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 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(SBuildType originalBuildType, java.lang.String newName, boolean copyVcsRoots, boolean changeScopeOfLocalVcsRoots)
          Deprecated. see createBuildType(SBuildType, String, CopyOptions)
 SBuildType createBuildType(SBuildType originalBuildType, java.lang.String newName, CopyOptions copyOptions)
          Deprecated. since 8.0, use copyBuildType(jetbrains.buildServer.serverSide.SBuildType, java.lang.String, java.lang.String, jetbrains.buildServer.serverSide.CopyOptions) instead.
 SBuildType createBuildType(java.lang.String name)
          Creates new build configuration with given name
 SBuildType 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, use createBuildType(String, String) instead.
 SBuildType createBuildTypeFromTemplate(BuildTypeTemplate template, java.lang.String name, CopyOptions copyOptions)
          Creates build configuration on the base of specified template.
 SBuildType createBuildTypeFromTemplate(BuildTypeTemplate template, java.lang.String extId, java.lang.String name)
          Creates build configuration on the base of specified template.
 BuildTypeTemplate createBuildTypeTemplate(BuildTypeTemplate originalTemplate, java.lang.String newName, CopyOptions copyOptions)
          Deprecated. since 8.0, use copyBuildTypeTemplate(jetbrains.buildServer.serverSide.BuildTypeTemplate, java.lang.String, java.lang.String) instead.
 BuildTypeTemplate createBuildTypeTemplate(SBuildType originalBuildType, java.lang.String name, CopyOptions copyOptions)
          Deprecated. since 8.0, use extractBuildTypeTemplate(jetbrains.buildServer.serverSide.SBuildType, java.lang.String, java.lang.String) instead.
 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.
 SProject createProject(java.lang.String externalId, java.lang.String projectName)
          Creates new sub project in this project
 SVcsRoot 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 project
 SVcsRoot createVcsRoot(java.lang.String vcsName, java.lang.String externalId, java.lang.String name)
          Creates new VCS root in this project
 BuildTypeTemplate extractBuildTypeTemplate(SBuildType originalBuildType, java.lang.String extId, java.lang.String name)
          Extracts a template from the specified build type.
 SBuildType findBuildTypeById(java.lang.String internalId)
          Searches for a build configuration in this project 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
 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 id in this project
 BuildTypeTemplate findBuildTypeTemplateById(java.lang.String intId)
          Searches for build type template by given id in this project
 BuildTypeTemplate findBuildTypeTemplateByName(java.lang.String name)
          Searches for a template with specified name in this project
 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 root
 java.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.List<BuildTypeTemplate> getAvailableTemplates()
           
 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 directory
 java.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.
 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 name
 java.io.File getPluginSettingsFile()
          Returns the plugin settings file for this project scope settings.
 java.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.
 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 configuration
 boolean isArchived()
          Returns true if the project is archived
 boolean isInModel()
          Return true if this project is attached to the TeamCity project model.
 void moveToProject(SProject target)
          Moves this project to the target project.
 void persist()
          Persists this project configuration on disk.
 void remove()
          Removes this project.
 void removeBuildType(java.lang.String internalBuildTypeId)
          Deprecated. since 8.0, use BuildTypeIdentity.remove() instead.
 void removeBuildTypes()
          Deprecated. since 8.0, use BuildTypeIdentity.remove() or BuildTypeIdentity.remove() methods in order to completely remove build types or templates with their configuration files
 void removeBuildTypeTemplate(java.lang.String internalId)
          Deprecated. use BuildTypeIdentity.remove() instead.
 void setArchived(boolean archived, User user)
          Sets project's archived flag
 void setDescription(java.lang.String description)
          Sets this project description
 void setExternalId(java.lang.String newId)
          Sets the external project id.
 void setName(java.lang.String name)
          Renames project
 void updateProjectInTransaction(SProject.ProjectUpdater updater)
          Deprecated. use persist()
 
Methods inherited from interface jetbrains.buildServer.BuildProject
getDescription, getExternalId, getFullName, getName, getParentProjectExternalId, getParentProjectId, getProjectId, getStatus, isRootProject
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface jetbrains.buildServer.serverSide.SPersistentEntity
getExternalId, getName, getParent
 
Methods inherited from interface jetbrains.buildServer.serverSide.InheritableUserParametersHolder
getOwnParameters, getOwnParametersCollection, getParameters, getParametersCollection
 
Methods inherited from interface jetbrains.buildServer.serverSide.UserParametersHolder
addParameter, removeParameter
 
Methods inherited from interface jetbrains.buildServer.serverSide.ParametersSupport
getParametersProvider, getValueResolver
 
Methods inherited from interface jetbrains.buildServer.log.Loggable
describe
 

Method Detail

setExternalId

void setExternalId(@NotNull
                   java.lang.String newId)
                   throws InvalidIdentifierException,
                          DuplicateExternalIdException
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:
InvalidIdentifierException
DuplicateExternalIdException
Since:
8.0

setName

void setName(@NotNull
             java.lang.String name)
Renames project

Parameters:
name - new project name
Throws:
DuplicateProjectNameException - if there is another project with same name
ProjectRenamingFailedException - if an error prevents from project renaming

setDescription

void setDescription(@Nullable
                    java.lang.String description)
Sets this project description

Parameters:
description - new project description

getParentProject

@Nullable
SProject getParentProject()
Returns the parent of this project.

Every project, except root, has a parent.

Specified by:
getParentProject in interface BuildProject
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 interface BuildProject
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 interface BuildProject
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 interface BuildProject
Returns:
list of VCS roots
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 interface BuildProject
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 interface SPersistentEntity
Returns:
this project configuration file

getPluginSettingsFile

@NotNull
java.io.File getPluginSettingsFile()
Returns 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 all of the project artifacts.
Since:
8.0k

createBuildType

@NotNull
SBuildType createBuildType(@NotNull
                                   java.lang.String extId,
                                   @NotNull
                                   java.lang.String name)
                           throws DuplicateExternalIdException,
                                  DuplicateBuildTypeNameException,
                                  MaxNumberOfBuildTypesReachedException
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.
Since:
8.0

createBuildType

@NotNull
SBuildType createBuildType(@NotNull
                                   java.lang.String name)
                           throws DuplicateBuildTypeNameException,
                                  MaxNumberOfBuildTypesReachedException
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 project
MaxNumberOfBuildTypesReachedException - if maximum number of build configurations is reached
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
Deprecated. since 8.0, use createBuildType(String, String) instead.

Creates a new build configuration

Parameters:
name - name of the build configuration
runnerType - type of the runner
maximumNumberOfBuilds - maximum number of builds
checkoutType - type of the checkout
Returns:
newly created build configuration
Throws:
DuplicateBuildTypeNameException - if build configuration with such name already exists in this project
MaxNumberOfBuildTypesReachedException - if maximum number of build configurations is reached
See Also:
createBuildType(String, String)

createBuildTypeTemplate

@NotNull
BuildTypeTemplate createBuildTypeTemplate(@NotNull
                                                  java.lang.String extId,
                                                  @NotNull
                                                  java.lang.String name)
                                          throws DuplicateTemplateNameException,
                                                 DuplicateExternalIdException
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.
Since:
8.0

createBuildTypeTemplate

@NotNull
BuildTypeTemplate createBuildTypeTemplate(@NotNull
                                                  java.lang.String name)
                                          throws DuplicateTemplateNameException
Creates new build configuration template.

Parameters:
name - name of the template
Returns:
newly created template
Throws:
DuplicateTemplateNameException - thrown if template with such name already exists
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
Creates new template by copying settings from the original one.

Parameters:
originalTemplate - original template
newExtId - new external identifier.
newName - new template name
Returns:
new template
Throws:
InvalidVcsRootScopeException - if a VCS root cannot be attached to template
Since:
8.0

createBuildTypeTemplate

@NotNull
@Deprecated
BuildTypeTemplate createBuildTypeTemplate(@NotNull
                                                             BuildTypeTemplate originalTemplate,
                                                             @NotNull
                                                             java.lang.String newName,
                                                             @NotNull
                                                             CopyOptions copyOptions)
                                          throws InvalidVcsRootScopeException
Deprecated. since 8.0, use copyBuildTypeTemplate(jetbrains.buildServer.serverSide.BuildTypeTemplate, java.lang.String, java.lang.String) instead.

Creates new template by copying settings from the original one.

Parameters:
originalTemplate - original template
newName - new template name
copyOptions - options to control copy operation
Returns:
new template
Throws:
InvalidVcsRootScopeException - if a VCS root cannot be attached to template
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
Deprecated. since 8.0, use extractBuildTypeTemplate(jetbrains.buildServer.serverSide.SBuildType, java.lang.String, java.lang.String) instead.

Extracts a template from the specified build type.

Parameters:
originalBuildType - original template
name - new template name
copyOptions - options to control copy operation
Returns:
new template
Throws:
InvalidVcsRootScopeException - if a VCS root cannot be attached to template
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
Creates a copy of the given build configuration.

Parameters:
originalBuildType - build configuration to copy
newName - 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 reached
InvalidVcsRootScopeException - if a VCS root cannot be attached to build configuration
DuplicateExternalIdException
Since:
8.0

createBuildType

@NotNull
@Deprecated
SBuildType createBuildType(@NotNull
                                              SBuildType originalBuildType,
                                              @NotNull
                                              java.lang.String newName,
                                              @NotNull
                                              CopyOptions copyOptions)
                           throws MaxNumberOfBuildTypesReachedException,
                                  InvalidVcsRootScopeException
Deprecated. since 8.0, use copyBuildType(jetbrains.buildServer.serverSide.SBuildType, java.lang.String, java.lang.String, jetbrains.buildServer.serverSide.CopyOptions) instead.

Creates new build configuration on the base of the specified original build configuration.

Parameters:
originalBuildType - build configuration to copy
newName - 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 reached
InvalidVcsRootScopeException - if a VCS root cannot be attached to build configuration
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
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.
Since:
8.0

createBuildTypeFromTemplate

@NotNull
SBuildType createBuildTypeFromTemplate(@NotNull
                                               BuildTypeTemplate template,
                                               @NotNull
                                               java.lang.String name,
                                               @NotNull
                                               CopyOptions copyOptions)
                                       throws MaxNumberOfBuildTypesReachedException,
                                              InvalidVcsRootScopeException
Creates build configuration on the base of specified template.

Parameters:
template - build configuration template
name - 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 reached
InvalidVcsRootScopeException - if a VCS root cannot be attached to build configuration
Since:
5.0
See Also:
createBuildTypeFromTemplate(BuildTypeTemplate, String, String)

createBuildType

@NotNull
SBuildType createBuildType(SBuildType originalBuildType,
                                   java.lang.String newName,
                                   boolean copyVcsRoots,
                                   boolean changeScopeOfLocalVcsRoots)
                           throws MaxNumberOfBuildTypesReachedException,
                                  InvalidVcsRootScopeException
Deprecated. see createBuildType(SBuildType, String, CopyOptions)

Throws:
MaxNumberOfBuildTypesReachedException
InvalidVcsRootScopeException

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)

findBuildTypeByName

@Nullable
SBuildType findBuildTypeByName(@NotNull
                                        java.lang.String name)
Searches for a build configuration with specified name among own build configurations of this project

Parameters:
name - name of the build configuration
Returns:
found build configuration or null
See Also:
findBuildTypeById(String)

findBuildTypeById

@Nullable
SBuildType findBuildTypeById(@Nullable
                                      java.lang.String internalId)
Searches for a build configuration in this project by the specified internal id.

Parameters:
buildTypeId - the internal id of the build configuration to look for; case sensitive.
Returns:
the found build configuration or null

removeBuildTypes

void removeBuildTypes()
Deprecated. since 8.0, use BuildTypeIdentity.remove() or BuildTypeIdentity.remove() methods in order to completely remove build types or templates with their configuration files

Unregisters all of the build templates and configurations stored in this project, does not remove any configuration files from disk


removeBuildType

void removeBuildType(java.lang.String internalBuildTypeId)
Deprecated. since 8.0, use BuildTypeIdentity.remove() instead.

Removes build configuration with specified internal id

Parameters:
buildTypeId - id of the build configuration

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 interface BuildProject
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 interface BuildProject
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 has own build configuration with specified id

Parameters:
buildTypeId - id of the build configuration
Returns:
true if this project has own build configuration with specified id

updateProjectInTransaction

void updateProjectInTransaction(@NotNull
                                SProject.ProjectUpdater updater)
                                throws PersistFailedException
Deprecated. use persist()

Runs the specified updater in the project update transaction. If updater finishes successfully, then project will be persisted automatically. If updater finishes unsuccessfully or project persistence failed then original (before this method call) project state will be restored.

Parameters:
updater - updater
Throws:
PersistFailedException - if project persistence failed

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 interface SPersistentEntity
Throws:
PersistFailedException - if project persisting failed

remove

void remove()
Removes this project.

Since:
8.0

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)
Sets project's archived flag

Parameters:
archived - is the project archived
user - the user the performs the action
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

findBuildTypeTemplateById

@Nullable
BuildTypeTemplate findBuildTypeTemplateById(@NotNull
                                                     java.lang.String intId)
Searches for build type template by given id in this project

Parameters:
intId - id of template
Returns:
found template or null
Since:
5.0

findBuildTypeTemplateByExternalId

@Nullable
BuildTypeTemplate findBuildTypeTemplateByExternalId(@NotNull
                                                             java.lang.String extId)
Searches for build type template by given id in this project

Parameters:
extId - id of template
Returns:
found template or null
Since:
5.0

findBuildTypeTemplateByName

@Nullable
BuildTypeTemplate findBuildTypeTemplateByName(@NotNull
                                                       java.lang.String name)
Searches for a template with specified name in this project

Parameters:
name - name of the template
Returns:
see above
Since:
5.0

removeBuildTypeTemplate

void removeBuildTypeTemplate(@NotNull
                             java.lang.String internalId)
                             throws TemplateCannotBeRemovedException
Deprecated. use BuildTypeIdentity.remove() instead.

Removes build configuration template

Parameters:
id - internal id of the template
Throws:
TemplateCannotBeRemovedException - if template cannot be deleted
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:
Since:
8.0

moveToProject

void moveToProject(@NotNull
                   SProject target)
                   throws CyclicDependencyException,
                          InvalidVcsRootScopeException
Moves this project to the target project.

Parameters:
target - new parent project for this project
Throws:
CyclicDependencyException
InvalidVcsRootScopeException
Since:
8.0

copyVcsRoot

@NotNull
SVcsRoot copyVcsRoot(@NotNull
                             SVcsRoot originalRoot,
                             @Nullable
                             java.lang.String externalId)
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
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
Creates new VCS root in this project

Parameters:
vcsName - name of VCS plugin
name - name of VCS root, if null or empty new name will be generated automatically
params - VCS root parameters
Returns:
newly created VCS root
Throws:
UnknownVcsException - if VCS plugin with specified name does not exist
DuplicateVcsRootNameException - if provided VCS root name duplicates name of existing VCS root
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
Creates new VCS root in this project

Parameters:
vcsName - name of VCS plugin
externalId - VCS root external id
name - VCS root name
Returns:
newly created VCS root
Throws:
DuplicateExternalIdException - if external ID
DuplicateVcsRootNameException

createProject

@NotNull
SProject createProject(@NotNull
                               java.lang.String externalId,
                               @NotNull
                               java.lang.String projectName)
                       throws InvalidIdentifierException,
                              InvalidNameException,
                              DuplicateProjectNameException,
                              DuplicateExternalIdException
Creates new sub project in this project

Parameters:
externalId - new sub project id
projectName - new sub project name
Returns:
newly created sub project
Throws:
InvalidIdentifierException
InvalidNameException
DuplicateProjectNameException
DuplicateExternalIdException
Since:
8.0