jetbrains.buildServer.serverSide
Interface SProject

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

public interface SProject
extends XmlExternalizable, BuildProject

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, java.lang.String runnerType, int maximumNumberOfBuilds, BuildTypeDescriptor.CheckoutType checkoutType)
          Creates a new build configuration
 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
 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.io.File getConfigDirectory()
          Returns this project configuration directory, i.e. a directory where this project configuration is stored.
 java.io.File getConfigurationFile()
          Returns this project configuration file, named "project-config.xml" in project configuration directory
 java.util.List<User> getPotentiallyResponsibleUsers()
          Returns the list of users who potentially can be responsible for configurations of this project (users who has TAKE_RESPONSIBILITY permission)
 java.util.List<SVcsRoot> getVcsRoots()
          Returns all VCS roots used by build configurations of this project.
 boolean hasBuildTypes()
          Returns true if this project contains at least one build configuration
 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 setDescription(java.lang.String description)
          Sets this project description
 void setName(java.lang.String name)
          Renames project
 void updateProjectInTransaction(SProject.ProjectUpdater updater)
          Runs the specified updater in the project update transaction.
 
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
 

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 of this project.

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

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,
                                   @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

createBuildType

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

createBuildType

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

Throws:
MaxNumberOfBuildTypesReachedException

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
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 configurations of this project (users who has TAKE_RESPONSIBILITY permission)

Returns:
the list of users who potentially can be responsible for configurations of this project
Since:
4.0.2

persist

void persist()
             throws PersistFailedException
Persists this project configuration on disk.

Throws:
PersistFailedException - if project persisting failed