Package com.atlassian.bamboo.project
Interface ProjectManager
- All Known Implementing Classes:
DefaultProjectManager
public interface ProjectManager
Manager for
Project
-
Method Summary
Modifier and TypeMethodDescriptioncreateAndSaveProject
(@NotNull String key, @NotNull String name, @Nullable String description, boolean grantAllUsersAccess) Create new project and store it.default @NotNull Project
createProject
(@NotNull String key, @NotNull String name) Creates a new Project Note that this method will not save the project@NotNull Project
createProject
(@NotNull String key, @NotNull String name, @NotNull String description) Creates a new Projectvoid
deleteProject
(@NotNull Project project) Removes the project from the systemReturns a collection ofProject
objects@NotNull Collection<Project>
Returns empty projects.Returns the number of projects, excluding the ones marked for deletion.Returns non empty projects.@Nullable Project
getProjectById
(long id) Returns the project given the id.@Nullable Project
getProjectByKey
(@NotNull String key) Returns the project given a project key.getProjectByName
(@NotNull String projectName) Returns project by name.@Nullable Project
getProjectByOid
(@NotNull BambooEntityOid oid) Returns project by oid.Returns the number of projects, including the ones marked for deletion.Returns a collection ofProject
objectsReturns a sorted by name list of projects.boolean
isExistingProjectKey
(@NotNull String projectKey) Returns true if the project name already existsboolean
isExistingProjectName
(@NotNull String projectName) Returns true if the project name already existsvoid
saveProject
(@NotNull Project project) Saves the project.
-
Method Details
-
createProject
@NotNull default @NotNull Project createProject(@NotNull @NotNull String key, @NotNull @NotNull String name) Creates a new Project Note that this method will not save the project- Parameters:
key
- project keyname
- project name- Returns:
- project
-
createProject
@NotNull @NotNull Project createProject(@NotNull @NotNull String key, @NotNull @NotNull String name, @NotNull @NotNull String description) Creates a new Project- Parameters:
key
- project keyname
- project namedescription
- project description- Returns:
- project
-
createAndSaveProject
Project createAndSaveProject(@NotNull @NotNull String key, @NotNull @NotNull String name, @Nullable @Nullable String description, boolean grantAllUsersAccess) Create new project and store it.- Parameters:
key
- project keyname
- project namedescription
- project descriptiongrantAllUsersAccess
- if anonymous and logged-in users should have READ permission for new project- Returns:
- project
-
getProjects
Returns a collection ofProject
objects- Returns:
- all Projects in the system, excluding the ones marked for deletion
-
getNonEmptyProjects
Returns non empty projects.- Returns:
- projects not marked for deletion with top level plans
-
getEmptyProjects
Returns empty projects.- Returns:
- projects not marked for deletion without top level plans
-
getSortedProjects
Returns a sorted by name list of projects. -
getAllProjects
Returns a collection ofProject
objects- Returns:
- all Projects in the system, including the ones marked for deletion
-
getProjectCount
Number getProjectCount()Returns the number of projects, including the ones marked for deletion. -
getNonDeletedProjectCount
Number getNonDeletedProjectCount()Returns the number of projects, excluding the ones marked for deletion. -
getProjectByKey
Returns the project given a project key. This method returns both not marked and marked for deletion projects, so be careful when using it.- Parameters:
key
- - the project key e.g. BAMBOO (not BAMBOO-TRUNK)- Returns:
- A
Project
if the key matches. Otherwise null
-
getProjectById
Returns the project given the id. This method returns both not marked and marked for deletion projects, so be careful when using it.- Parameters:
id
- project id- Returns:
- A
Project
. null if not found.
-
getProjectByOid
Returns project by oid. Only not marked for deletion projects are returned.- Since:
- 5.15
-
getProjectByName
Returns project by name. This method returns both not marked and marked for deletion projects, so be careful when using it.- Parameters:
projectName
-- Returns:
- project
-
isExistingProjectKey
Returns true if the project name already exists- Parameters:
projectKey
- to check- Returns:
- true if projectName already exists
-
isExistingProjectName
Returns true if the project name already exists- Parameters:
projectName
- to check- Returns:
- true if projectName already exists
-
saveProject
Saves the project. For new project it creates required ACL records.- Parameters:
project
- to be saved
-
deleteProject
Removes the project from the system- Parameters:
project
- project
-
getAllProjectsMarkedForDeletion
- Returns:
- all
Project
s that are marked for deletion..
-