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)
          Searches for a build configuration with specified id.
 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.
 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.util.Collection<SProject> findProjects(java.util.Collection<java.lang.String> projectsIds)
          Returns collection of projects corresponding to the specified ids.
 java.util.List<SBuildType> getAllBuildTypes()
          Returns list of all build configurations sorted by project and build configuration name.
 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.SortedMap<SProject,java.util.List<SBuildType>> getFilteredBuildTypes(User user, BuildTypeFilter filter)
          Returns sorted map of build configurations per project.
 int getNumberOfBuildTypes()
          Returns total number of build configurations currently loaded in the server
 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 list of all projects.
 java.util.List<SProject> getProjects(User user)
          Returns list of all projects sorted according to the order specified by user
 void removeProject(java.lang.String projectId)
          Removes project from the current list of projects.
 

Method Detail

getProjects

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

Returns:
list of all projects

getNumberOfProjects

int getNumberOfProjects()
Returns total number of projects currently loaded in the server

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).

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.

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. Personal builds (there is a separate build configuration for each personal build) are not considered here.

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
See Also:
findBuildTypeIncludeRemote(String)

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

findBuildTypeIncludeRemote

@Nullable
SBuildType findBuildTypeIncludeRemote(java.lang.String buildTypeId)
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
See Also:
findBuildTypeById(String)

getAllBuildTypes

@NotNull
java.util.List<SBuildType> getAllBuildTypes()
Returns list of all build configurations sorted by project and build configuration name.

Returns:
list of all build configurations.

getNumberOfBuildTypes

int getNumberOfBuildTypes()
Returns total number of build configurations currently loaded in the server

Returns:
total 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.

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