Package com.atlassian.bamboo.project
Interface ProjectManager
-
- All Known Implementing Classes:
DefaultProjectManager
public interface ProjectManager
Manager forProject
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Project
createAndSaveProject(@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 system@NotNull Set<Project>
getAllProjects()
Returns a collection ofProject
objects@NotNull Collection<Project>
getAllProjectsMarkedForDeletion()
@NotNull List<Project>
getEmptyProjects()
Returns empty projects.Number
getNonDeletedProjectCount()
Returns the number of projects, excluding the ones marked for deletion.@NotNull List<Project>
getNonEmptyProjects()
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.Project
getProjectByName(@NotNull String projectName)
Returns project by name.@Nullable Project
getProjectByOid(@NotNull BambooEntityOid oid)
Returns project by oid.Number
getProjectCount()
Returns the number of projects, including the ones marked for deletion.@NotNull Set<Project>
getProjects()
Returns a collection ofProject
objects@NotNull List<Project>
getSortedProjects()
Returns 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 Detail
-
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
@NotNull @NotNull Set<Project> getProjects()
Returns a collection ofProject
objects- Returns:
- all Projects in the system, excluding the ones marked for deletion
-
getNonEmptyProjects
@NotNull @NotNull List<Project> getNonEmptyProjects()
Returns non empty projects.- Returns:
- projects not marked for deletion with top level plans
-
getEmptyProjects
@NotNull @NotNull List<Project> getEmptyProjects()
Returns empty projects.- Returns:
- projects not marked for deletion without top level plans
-
getSortedProjects
@NotNull @NotNull List<Project> getSortedProjects()
Returns a sorted by name list of projects.
-
getAllProjects
@NotNull @NotNull Set<Project> 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
@Nullable @Nullable Project getProjectByKey(@NotNull @NotNull String key)
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
@Nullable @Nullable Project getProjectById(long id)
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
@Nullable @Nullable Project getProjectByOid(@NotNull @NotNull BambooEntityOid oid)
Returns project by oid. Only not marked for deletion projects are returned.- Since:
- 5.15
-
getProjectByName
Project getProjectByName(@NotNull @NotNull String projectName)
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
boolean isExistingProjectKey(@NotNull @NotNull String projectKey)
Returns true if the project name already exists- Parameters:
projectKey
- to check- Returns:
- true if projectName already exists
-
isExistingProjectName
boolean isExistingProjectName(@NotNull @NotNull String projectName)
Returns true if the project name already exists- Parameters:
projectName
- to check- Returns:
- true if projectName already exists
-
saveProject
void saveProject(@NotNull @NotNull Project project)
Saves the project. For new project it creates required ACL records.- Parameters:
project
- to be saved
-
deleteProject
void deleteProject(@NotNull @NotNull Project project)
Removes the project from the system- Parameters:
project
- project
-
getAllProjectsMarkedForDeletion
@NotNull @NotNull Collection<Project> getAllProjectsMarkedForDeletion()
- Returns:
- all
Project
s that are marked for deletion..
-
-