com.atlassian.bamboo.project
Class DefaultProjectManager

java.lang.Object
  extended by com.atlassian.bamboo.project.DefaultProjectManager
All Implemented Interfaces:
ProjectManager

public class DefaultProjectManager
extends Object
implements ProjectManager


Constructor Summary
DefaultProjectManager(ProjectDao projectDao)
           
 
Method Summary
 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 build given the id
 Project getProjectByKey(String key)
          Returns the project given a project key
 Project getProjectByName(String projectName)
          Returns project by name
 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultProjectManager

public DefaultProjectManager(ProjectDao projectDao)
Method Detail

createProject

@NotNull
public Project createProject(@NotNull
                                     String key,
                                     @NotNull
                                     String name,
                                     @NotNull
                                     String description)
Description copied from interface: ProjectManager
Creates a new Project

Specified by:
createProject in interface ProjectManager
Returns:
project

createProject

@NotNull
public Project createProject(@NotNull
                                     String key,
                                     @NotNull
                                     String name)
Description copied from interface: ProjectManager
Creates a new Project Note that this method will not save the project

Specified by:
createProject in interface ProjectManager
Returns:
project

getProjects

@NotNull
public Set<Project> getProjects()
Description copied from interface: ProjectManager
Returns a collection of Project objects

Specified by:
getProjects in interface ProjectManager
Returns:
all Projects in the system, excluding the ones marked for deletion

getSortedProjects

@NotNull
public List<Project> getSortedProjects()
Description copied from interface: ProjectManager
Returns a sorted by name list of projects.

Specified by:
getSortedProjects in interface ProjectManager
Returns:

getAllProjects

@NotNull
public Set<Project> getAllProjects()
Description copied from interface: ProjectManager
Returns a collection of Project objects

Specified by:
getAllProjects in interface ProjectManager
Returns:
all Projects in the system, including the ones marked for deletion

getProjectCount

@NotNull
public Number getProjectCount()
Specified by:
getProjectCount in interface ProjectManager

getProjectByKey

public Project getProjectByKey(@NotNull
                               String key)
Description copied from interface: ProjectManager
Returns the project given a project key

Specified by:
getProjectByKey in interface ProjectManager
Parameters:
key - - the project key e.g. BAMBOO (not BAMBOO-TRUNK)
Returns:
A Project if the key matches. Otherwise null

getProjectById

@Nullable
public Project getProjectById(long id)
Description copied from interface: ProjectManager
Returns the build given the id

Specified by:
getProjectById in interface ProjectManager
Returns:
A Project. null if not found.

getProjectByName

public Project getProjectByName(@NotNull
                                String projectName)
Description copied from interface: ProjectManager
Returns project by name

Specified by:
getProjectByName in interface ProjectManager
Returns:
project

isExistingProjectName

public boolean isExistingProjectName(@NotNull
                                     String projectName)
Description copied from interface: ProjectManager
Returns true if the project name already exists

Specified by:
isExistingProjectName in interface ProjectManager
Parameters:
projectName - to check
Returns:
true if projectName already exists

isExistingProjectKey

public boolean isExistingProjectKey(@NotNull
                                    String projectKey)
Description copied from interface: ProjectManager
Returns true if the project name already exists

Specified by:
isExistingProjectKey in interface ProjectManager
Parameters:
projectKey - to check
Returns:
true if projectName already exists

saveProject

public void saveProject(@NotNull
                        Project project)
Description copied from interface: ProjectManager
Saves the project

Specified by:
saveProject in interface ProjectManager

deleteProject

public void deleteProject(@NotNull
                          Project project)
Description copied from interface: ProjectManager
Removes the project from the system

Specified by:
deleteProject in interface ProjectManager
Parameters:
project - project

getAllProjectsMarkedForDeletion

@NotNull
public Collection<Project> getAllProjectsMarkedForDeletion()
Specified by:
getAllProjectsMarkedForDeletion in interface ProjectManager
Returns:
all Projects that are marked for deletion..


Copyright © 2015 Atlassian Software Systems Pty Ltd. All rights reserved.