jetbrains.buildServer.serverSide
Interface SProject

All Superinterfaces:
BuildProject, java.lang.Comparable<BuildProject>, UserParametersHolder, XmlExternalizable

public interface SProject
extends XmlExternalizable, BuildProject, UserParametersHolder

Represents a server side project


Nested Class Summary
static interface SProject.ProjectUpdater
          Object which updates some project aspect.
 
Method Summary
 boolean containsBuildType(java.lang.String buildTypeId)
          Returns true if this project contains build configuration with specified id
 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)
          Creates new build configuration on the base of the specified original build configuration.
 SBuildType createBuildType(java.lang.String name)
          Creates new build configuration with given name
 SBuildType createBuildType(java.lang.String name, java.lang.String runnerType, int maximumNumberOfBuilds, BuildTypeDescriptor.CheckoutType checkoutType)
          Creates a new build configuration
 SBuildType createBuildTypeFromTemplate(BuildTypeTemplate template, java.lang.String name, CopyOptions copyOptions)
          Creates build configuration on the base of specified template.
 BuildTypeTemplate createBuildTypeTemplate(BuildTypeTemplate originalTemplate, java.lang.String newName, CopyOptions copyOptions)
          Creates new template by copying settings from the original one.
 BuildTypeTemplate createBuildTypeTemplate(SBuildType originalBuildType, java.lang.String name, CopyOptions copyOptions)
          Creates new template by copying settings from the specified build type.
 BuildTypeTemplate createBuildTypeTemplate(java.lang.String name)
          Creates new build configuration template.
 SBuildType findBuildTypeById(java.lang.String buildTypeId)
          Searches for a build configuration in this project by the specified id
 SBuildType findBuildTypeByName(java.lang.String name)
          Searches for a build configuration in this project by the specified name
 BuildTypeTemplate findBuildTypeTemplateById(java.lang.String id)
          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
 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<SBuildType> getBuildTypes()
          Returns all of the build configurations containing in this project
 java.util.List<BuildTypeTemplate> getBuildTypeTemplates()
          Returns collection of build configuration templates sorted by name
 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 getExtendedName()
          Returns the name of the project with additional note if the project is archived, i.e.
 java.util.List<User> getPotentiallyResponsibleUsers()
          Returns the list of users who potentially can be responsible for failures in this project.
 java.util.List<VcsRootInstance> getVcsRootInstances()
           
 java.util.List<SVcsRoot> getVcsRoots()
          Returns all VCS roots used by build configurations or templates in this project.
 boolean hasBuildTypes()
          Returns true if this project contains at least one 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 persist()
          Persists this project configuration on disk.
 void removeBuildType(java.lang.String buildTypeId)
          Removes build configuration with specified id
 void removeBuildTypes()
          Removes all of the build configurations stored in this project
 void removeBuildTypeTemplate(java.lang.String id)
          Removes build configuration template
 void setArchived(boolean archived, User user)
          Sets project's archived flag
 void setDescription(java.lang.String description)
          Sets this project description
 void setName(java.lang.String name)
          Renames project
 void updateProjectInTransaction(SProject.ProjectUpdater updater)
          Deprecated. use persist()
 
Methods inherited from interface jetbrains.buildServer.XmlExternalizable
writeTo
 
Methods inherited from interface jetbrains.buildServer.BuildProject
getDescription, getName, getProjectId, getStatus
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface jetbrains.buildServer.serverSide.UserParametersHolder
addParameter, getParameters, getParametersCollection, removeParameter
 

Method Detail

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

getVcsRoots

@NotNull
java.util.List<SVcsRoot> getVcsRoots()
Returns all VCS roots used by build configurations or templates in this project.

Specified by:
getVcsRoots in interface BuildProject
Returns:
all VCS roots used by build configurations of this project.

getVcsRootInstances

@NotNull
java.util.List<VcsRootInstance> getVcsRootInstances()
Returns:
all VCS root instances used in the project.
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

Returns:
this project configuration file

getArtifactsDirectory

@NotNull
java.io.File getArtifactsDirectory()
Returns directory containing all of the project artifacts.

Returns:
directory containing all of the project artifacts.

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

createBuildType

@NotNull
SBuildType createBuildType(@NotNull
                                   java.lang.String name,
                                   @NotNull
                                   java.lang.String runnerType,
                                   int maximumNumberOfBuilds,
                                   BuildTypeDescriptor.CheckoutType checkoutType)
                           throws DuplicateBuildTypeNameException,
                                  MaxNumberOfBuildTypesReachedException
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

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

createBuildTypeTemplate

@NotNull
BuildTypeTemplate createBuildTypeTemplate(@NotNull
                                                  BuildTypeTemplate originalTemplate,
                                                  @NotNull
                                                  java.lang.String newName,
                                                  @NotNull
                                                  CopyOptions copyOptions)
                                          throws InvalidVcsRootScopeException
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

createBuildTypeTemplate

@NotNull
BuildTypeTemplate createBuildTypeTemplate(@NotNull
                                                  SBuildType originalBuildType,
                                                  @NotNull
                                                  java.lang.String name,
                                                  @NotNull
                                                  CopyOptions copyOptions)
                                          throws InvalidVcsRootScopeException
Creates new template by copying settings 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

createBuildType

@NotNull
SBuildType createBuildType(@NotNull
                                   SBuildType originalBuildType,
                                   @NotNull
                                   java.lang.String newName,
                                   @NotNull
                                   CopyOptions copyOptions)
                           throws MaxNumberOfBuildTypesReachedException,
                                  InvalidVcsRootScopeException
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

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

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

findBuildTypeByName

@Nullable
SBuildType findBuildTypeByName(@NotNull
                                        java.lang.String name)
Searches for a build configuration in this project by the specified name

Parameters:
name - name of the build configuration
Returns:
found build configuration or null

findBuildTypeById

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

Parameters:
buildTypeId - id of the build configuration
Returns:
found build configuration or null

removeBuildTypes

void removeBuildTypes()
Removes all of the build configurations stored in this project


removeBuildType

void removeBuildType(java.lang.String buildTypeId)
Removes build configuration with specified id

Parameters:
buildTypeId - id of the build configuration

getBuildTypes

java.util.List<SBuildType> getBuildTypes()
Returns all of the build configurations containing in this project

Specified by:
getBuildTypes in interface BuildProject
Returns:
all of the build configurations containing in this project

hasBuildTypes

boolean hasBuildTypes()
Returns true if this project contains at least one build configuration

Returns:
true if this project contains a build configuration

containsBuildType

boolean containsBuildType(@NotNull
                          java.lang.String buildTypeId)
Returns true if this project contains build configuration with specified id

Parameters:
buildTypeId - id of the build configuration
Returns:
true if this project contains 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.

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)
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:
full project name
Since:
5.0

getBuildTypeTemplates

@NotNull
java.util.List<BuildTypeTemplate> getBuildTypeTemplates()
Returns collection of build configuration templates sorted by name

Returns:
see above
Since:
5.0

findBuildTypeTemplateById

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

Parameters:
id - 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 id)
                             throws TemplateCannotBeRemovedException
Removes build configuration template

Parameters:
id - id of the template
Throws:
TemplateCannotBeRemovedException - if template cannot be deleted
Since:
5.0