public class DefaultProjectManager extends Object implements ProjectManager
Constructor and Description |
---|
DefaultProjectManager(ProjectDao projectDao) |
Modifier and Type | Method and Description |
---|---|
Project |
createProject(String key,
String name)
Creates a new Project
Note that this method will not save the project
|
Project |
createProject(String key,
String name,
String description)
Creates a new Project
|
void |
deleteProject(Project project)
Removes the project from the system
|
Set<Project> |
getAllProjects()
Returns a collection of
Project objects |
Collection<Project> |
getAllProjectsMarkedForDeletion() |
Project |
getProjectById(long id)
Returns the project given the id
|
Project |
getProjectByKey(String key)
Returns the project given a project key
|
Project |
getProjectByName(String projectName)
Returns project by name
|
Project |
getProjectByOid(BambooEntityOid oid)
Returns project by oid
|
Number |
getProjectCount() |
Set<Project> |
getProjects()
Returns a collection of
Project objects |
List<Project> |
getSortedProjects()
Returns a sorted by name list of projects.
|
boolean |
isExistingProjectKey(String projectKey)
Returns true if the project name already exists
|
boolean |
isExistingProjectName(String projectName)
Returns true if the project name already exists
|
void |
saveProject(Project project)
Saves the project
|
public DefaultProjectManager(ProjectDao projectDao)
@NotNull public Project createProject(@NotNull String key, @NotNull String name, @NotNull String description)
ProjectManager
createProject
in interface ProjectManager
@NotNull public Project createProject(@NotNull String key, @NotNull String name)
ProjectManager
createProject
in interface ProjectManager
@NotNull public Set<Project> getProjects()
ProjectManager
Project
objectsgetProjects
in interface ProjectManager
@NotNull public List<Project> getSortedProjects()
ProjectManager
getSortedProjects
in interface ProjectManager
@NotNull public Set<Project> getAllProjects()
ProjectManager
Project
objectsgetAllProjects
in interface ProjectManager
@NotNull public Number getProjectCount()
getProjectCount
in interface ProjectManager
public Project getProjectByKey(@NotNull String key)
ProjectManager
getProjectByKey
in interface ProjectManager
key
- - the project key e.g. BAMBOO (not BAMBOO-TRUNK)Project
if the key matches. Otherwise null@Nullable public Project getProjectById(long id)
ProjectManager
getProjectById
in interface ProjectManager
Project
. null if not found.@Nullable public Project getProjectByOid(@NotNull BambooEntityOid oid)
ProjectManager
getProjectByOid
in interface ProjectManager
public Project getProjectByName(@NotNull String projectName)
ProjectManager
getProjectByName
in interface ProjectManager
public boolean isExistingProjectName(@NotNull String projectName)
ProjectManager
isExistingProjectName
in interface ProjectManager
projectName
- to checkpublic boolean isExistingProjectKey(@NotNull String projectKey)
ProjectManager
isExistingProjectKey
in interface ProjectManager
projectKey
- to checkpublic void saveProject(@NotNull Project project)
ProjectManager
saveProject
in interface ProjectManager
public void deleteProject(@NotNull Project project)
ProjectManager
deleteProject
in interface ProjectManager
project
- project@NotNull public Collection<Project> getAllProjectsMarkedForDeletion()
getAllProjectsMarkedForDeletion
in interface ProjectManager
Project
s that are marked for deletion..Copyright © 2017 Atlassian Software Systems Pty Ltd. All rights reserved.