com.atlassian.bamboo.project
Class DefaultProjectManager

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

public class DefaultProjectManager
extends java.lang.Object
implements ProjectManager


Constructor Summary
DefaultProjectManager(ProjectDao projectDao)
           
 
Method Summary
 Project createProject(java.lang.String key, java.lang.String name)
          Creates a new Project Note that this method will not save the project
 Project createProject(java.lang.String key, java.lang.String name, java.lang.String description)
          Creates a new Project
 void deleteProject(Project project)
          Removes the project from the system
 java.util.Set<Project> getAllProjects()
          Returns a collection of Project objects
 java.util.Collection<Project> getAllProjectsMarkedForDeletion()
           
 Project getProjectById(long id)
          Returns the build given the id
 Project getProjectByKey(java.lang.String key)
          Returns the prokect given a project key
 Project getProjectByName(java.lang.String projectName)
          Returns project by name
 java.util.Set<Project> getProjects()
          Returns a collection of Project objects
 java.util.List<Project> getSortedProjects()
          Returns a sorted by name list of projects.
 boolean isExistingProjectKey(java.lang.String projectKey)
          Returns true if the project name already exists
 boolean isExistingProjectName(java.lang.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
                                     java.lang.String key,
                                     @NotNull
                                     java.lang.String name,
                                     @NotNull
                                     java.lang.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
                                     java.lang.String key,
                                     @NotNull
                                     java.lang.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 java.util.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 java.util.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 java.util.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

getProjectByKey

public Project getProjectByKey(@NotNull
                               java.lang.String key)
Description copied from interface: ProjectManager
Returns the prokect 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
                                java.lang.String projectName)
Description copied from interface: ProjectManager
Returns project by name

Specified by:
getProjectByName in interface ProjectManager
Returns:
project

isExistingProjectName

public boolean isExistingProjectName(@NotNull
                                     java.lang.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
                                    java.lang.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 java.util.Collection<Project> getAllProjectsMarkedForDeletion()
Specified by:
getAllProjectsMarkedForDeletion in interface ProjectManager
Returns:
all Projects that are marked for deletion..


Copyright © 2011 Atlassian. All Rights Reserved.