jetbrains.buildServer.serverSide
Interface ProjectManager


public interface ProjectManager

Author:
Pavel.Sher Date: 05.05.2006

Method Summary
 SProject createProject(SProject originalProject, java.lang.String newProjectName, boolean changeScopeOfLocalVcsRoots)
          Deprecated. see createProject(SProject, String, CopyOptions)
 SProject createProject(SProject originalProject, java.lang.String newProjectName, CopyOptions options)
          Creates new project by copying all settings from original project.
 SProject createProject(java.lang.String projectName)
          Creates new project with specified name (name is case insensitive).
 SBuildType findBuildTypeById(java.lang.String buildTypeId)
          Searches for a build configuration with specified id.
 SBuildType findBuildTypeIncludeRemote(java.lang.String buildTypeId)
          Deprecated. use findBuildTypeById(String)
 java.util.Collection<SBuildType> findBuildTypes(java.util.Collection<java.lang.String> buildTypeIds)
          Returns collection of build types corresponding to the specified collection of build type ids.
 BuildTypeTemplate findBuildTypeTemplateById(java.lang.String id)
          Searches for build type template by given id
 SProject findProjectById(java.lang.String projectId)
          Searches for a project with specified id.
 SProject findProjectByName(java.lang.String projectName)
          Searches for a project with specified name (case insensitive).
 java.lang.String findProjectId(java.lang.String buildTypeId)
          Searches for a project which contains a build type with the specified build type id.
 java.lang.String findProjectIdForTemplate(java.lang.String buildTypeTemplateId)
          Searches for a project which contains a build type template with the specified id.
 java.util.Collection<SProject> findProjects(java.util.Collection<java.lang.String> projectsIds)
          Returns collection of projects corresponding to the specified ids.
 java.util.List<SBuildType> getActiveBuildTypes()
          Returns the list of build types that belong to non-archived projects only.
 java.util.List<SProject> getActiveProjects()
          Returns the list of active (non-archived) projects.
 java.util.List<SBuildType> getAllBuildTypes()
          Returns the list of all build configurations, including ones from archived projects.
 java.util.List<SBuildType> getAllBuildTypes(User user)
          Returns list of all build configurations sorted by project according to the order specified by user and then by build configuration name.
 java.util.List<BuildTypeTemplate> getAllTemplates()
          Returns list of all of the templates, including ones from archived projects.
 java.util.List<SBuildType> getArchivedBuildTypes()
          Returns list of build configurations from archived projects, sorted by project and build configuration name.
 java.util.List<SProject> getArchivedProjects()
          Returns the list of archived projects.
 java.util.List<SBuildType> getBuildTypesDependingOn(SBuildType type)
          Returns the list of build types that depend on type (by artifacts).
 java.util.SortedMap<SProject,java.util.List<SBuildType>> getFilteredBuildTypes(User user, BuildTypeFilter filter)
          Returns sorted map of build configurations per project.
 int getNumberOfBuildTypes()
          Returns the total number of build configurations including ones from archived projects.
 int getNumberOfProjects()
          Returns total number of projects currently loaded in the server.
 java.util.List<java.lang.String> getProjectIds()
          A helper method which returns the list of all projectID configured on the server.
 java.util.List<SProject> getProjects()
          Returns the list of all projects, including archived.
 java.util.List<SProject> getProjects(User user)
          Returns list of all projects sorted according to the order specified by user
 boolean isProjectExists(java.lang.String projectId)
          Returns true if project with specified id exists.
 void removeProject(java.lang.String projectId)
          Removes project from the current list of projects.
 

Method Detail

getProjects

@NotNull
java.util.List<SProject> getProjects()
Returns the list of all projects, including archived. The order: visible projects come first (sorted by name), then archived projects (sorted by name).

Returns:
list of all projects

getActiveProjects

@NotNull
java.util.List<SProject> getActiveProjects()
Returns the list of active (non-archived) projects. List is sorted by project name.

Returns:
list of non-archived projects

getArchivedProjects

@NotNull
java.util.List<SProject> getArchivedProjects()
Returns the list of archived projects. List is sorted by project name.

Returns:
list of archived projects

getNumberOfProjects

int getNumberOfProjects()
Returns total number of projects currently loaded in the server. The value always equals to getProjects().size().

Returns:
total number of projects

getProjects

@NotNull
java.util.List<SProject> getProjects(@NotNull
                                             User user)
Returns list of all projects sorted according to the order specified by user

Parameters:
user - the user
Returns:
see above

createProject

@NotNull
SProject createProject(@NotNull
                               java.lang.String projectName)
                       throws DuplicateProjectNameException
Creates new project with specified name (name is case insensitive).

Parameters:
projectName - name of the new project
Returns:
newly created project
Throws:
DuplicateProjectNameException - if project with specified name already exists

createProject

@NotNull
SProject createProject(@NotNull
                               SProject originalProject,
                               @NotNull
                               java.lang.String newProjectName,
                               @NotNull
                               CopyOptions options)
                       throws MaxNumberOfBuildTypesReachedException
Creates new project by copying all settings from original project.

Parameters:
originalProject - original project
newProjectName - name for new project. If there exists project with same name then " (1)", " (2)", ... suffix will be added to the specified name.
options - additional options
Returns:
newly created project
Throws:
MaxNumberOfBuildTypesReachedException - if original project build configurations cannot be copied because maximum number of build configurations is reached or will be exceeded if project will be copied

createProject

@NotNull
SProject createProject(@NotNull
                               SProject originalProject,
                               @NotNull
                               java.lang.String newProjectName,
                               boolean changeScopeOfLocalVcsRoots)
                       throws MaxNumberOfBuildTypesReachedException
Deprecated. see createProject(SProject, String, CopyOptions)

Throws:
MaxNumberOfBuildTypesReachedException

findProjectByName

@Nullable
SProject findProjectByName(@NotNull
                                    java.lang.String projectName)
Searches for a project with specified name (case insensitive). The search includes archived projects.

Parameters:
projectName - name of the project to search for
Returns:
a project or null if such a project does not exist

findProjectById

@Nullable
SProject findProjectById(@Nullable
                                  java.lang.String projectId)
                         throws AccessDeniedException
Searches for a project with specified id. The search includes archived projects.

Parameters:
projectId - id of the project to search for
Returns:
a project or null if project with such id does not exist
Throws:
AccessDeniedException - no access rights for the current user

findProjects

@NotNull
java.util.Collection<SProject> findProjects(java.util.Collection<java.lang.String> projectsIds)
Returns collection of projects corresponding to the specified ids. Only exsiting projects will be returned.

Parameters:
projectsIds - collection of project identifiers to be searched for
Returns:
see above

findBuildTypeById

@Nullable
SBuildType findBuildTypeById(@Nullable
                                      java.lang.String buildTypeId)
                             throws AccessDeniedException
Searches for a build configuration with specified id.

Parameters:
buildTypeId - id of the build configuration to search for
Returns:
a build configuration or null if build configuration with given id does not exist
Throws:
AccessDeniedException - if current authority holder doesn't have access to build configuration with given ID
Since:
6.5 also finds personal build configurations

findBuildTypes

@NotNull
java.util.Collection<SBuildType> findBuildTypes(@NotNull
                                                        java.util.Collection<java.lang.String> buildTypeIds)
Returns collection of build types corresponding to the specified collection of build type ids. The returned collection will contain existing build types only.

Parameters:
buildTypeIds - collection of build type ids
Returns:
collection of existing build types
Since:
6.5 also returns personal build configurations

findBuildTypeIncludeRemote

@Nullable
SBuildType findBuildTypeIncludeRemote(java.lang.String buildTypeId)
Deprecated. use findBuildTypeById(String)

Searches for a build configuration with specified id. If there is no simple build configuration with specified ID, personal builds are searched (there is a separate build configuration for each personal build).

Parameters:
buildTypeId - id of the build configuration to search for
Returns:
a build configuration or null if build configuration with given id does not exist

getAllBuildTypes

@NotNull
java.util.List<SBuildType> getAllBuildTypes()
Returns the list of all build configurations, including ones from archived projects. The order: build configurations from visible projects come first, then from archived projects.

Returns:
list of all build configurations

getAllTemplates

@NotNull
java.util.List<BuildTypeTemplate> getAllTemplates()
Returns list of all of the templates, including ones from archived projects. Ordering is the same as for build configurations.

Returns:
see above
Since:
5.0

getActiveBuildTypes

@NotNull
java.util.List<SBuildType> getActiveBuildTypes()
Returns the list of build types that belong to non-archived projects only.

Returns:
list of non-archived build types

getArchivedBuildTypes

@NotNull
java.util.List<SBuildType> getArchivedBuildTypes()
Returns list of build configurations from archived projects, sorted by project and build configuration name.

Returns:
list of archived build configurations.

getNumberOfBuildTypes

int getNumberOfBuildTypes()
Returns the total number of build configurations including ones from archived projects.

Returns:
number of build configurations

getAllBuildTypes

@NotNull
java.util.List<SBuildType> getAllBuildTypes(@NotNull
                                                    User user)
Returns list of all build configurations sorted by project according to the order specified by user and then by build configuration name.

Parameters:
user - user whose settings to use to sort build types
Returns:
list of all build configurations.

removeProject

void removeProject(@NotNull
                   java.lang.String projectId)
                   throws ProjectRemoveFailedException
Removes project from the current list of projects. Project directory will be placed into the '_trash' folder.

Parameters:
projectId - id of project to remove
Throws:
ProjectRemoveFailedException - if remove failed

getProjectIds

java.util.List<java.lang.String> getProjectIds()
A helper method which returns the list of all projectID configured on the server.

Returns:
the list of all projectID configured on the server.

getFilteredBuildTypes

java.util.SortedMap<SProject,java.util.List<SBuildType>> getFilteredBuildTypes(@NotNull
                                                                               User user,
                                                                               @Nullable
                                                                               BuildTypeFilter filter)
Returns sorted map of build configurations per project. Build types can be filtered by specified BuildTypeFilter. Projects in the map are sorted according to the projects order specified by user.

Parameters:
user - the user
filter - filter of build configurations, can be null
Returns:
sorted map of build types per project

findProjectId

@Nullable
java.lang.String findProjectId(@NotNull
                                        java.lang.String buildTypeId)
Searches for a project which contains a build type with the specified build type id. Returns id of this project or null if such project does not exist. The search includes archived projects.

Parameters:
buildTypeId - id of a build type
Returns:
project id of a project containing specified build type

findProjectIdForTemplate

@Nullable
java.lang.String findProjectIdForTemplate(@NotNull
                                                   java.lang.String buildTypeTemplateId)
Searches for a project which contains a build type template with the specified id. Returns id of this project or null if such project does not exist. The search includes archived projects.

Parameters:
buildTypeTemplateId - id of a build type template
Returns:
project id of a project containing specified build type template
Since:
6.5

isProjectExists

boolean isProjectExists(@NotNull
                        java.lang.String projectId)
Returns true if project with specified id exists. In contrast to findProjectById(String) this method does not check permissions and will return true if project exists even if user does not have permissions to access this project.

Parameters:
projectId - id of the project
Returns:
see above
Since:
5.0

getBuildTypesDependingOn

java.util.List<SBuildType> getBuildTypesDependingOn(@NotNull
                                                    SBuildType type)
Returns the list of build types that depend on type (by artifacts).

Parameters:
type - build type
Returns:
list of build types depending on type

findBuildTypeTemplateById

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

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