Package com.atlassian.bamboo.project
Class DefaultProjectManager
java.lang.Object
com.atlassian.bamboo.project.DefaultProjectManager
- All Implemented Interfaces:
ProjectManager
-
Constructor Summary
ConstructorDescriptionDefaultProjectManager
(BambooAclUpdateHelper aclUpdateHelper, HibernateMutableAclService aclService, ProjectDao projectDao, VariableDefinitionDao variableDefinitionDao, CredentialsDao credentialsDao, RepositoryDefinitionDao repositoryDefinitionDao) -
Method Summary
Modifier and TypeMethodDescriptioncreateAndSaveProject
(@NotNull String key, @NotNull String name, @Nullable String description, boolean grantAllUsersAccess) Create new project and store it.@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.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.@NotNull Number
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.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.atlassian.bamboo.project.ProjectManager
createProject
-
Constructor Details
-
DefaultProjectManager
public DefaultProjectManager(BambooAclUpdateHelper aclUpdateHelper, HibernateMutableAclService aclService, ProjectDao projectDao, VariableDefinitionDao variableDefinitionDao, CredentialsDao credentialsDao, RepositoryDefinitionDao repositoryDefinitionDao)
-
-
Method Details
-
createProject
@NotNull public @NotNull Project createProject(@NotNull @NotNull String key, @NotNull @NotNull String name, @NotNull @NotNull String description) Description copied from interface:ProjectManager
Creates a new Project- Specified by:
createProject
in interfaceProjectManager
- Parameters:
key
- project keyname
- project namedescription
- project description- Returns:
- project
-
createAndSaveProject
public Project createAndSaveProject(@NotNull @NotNull String key, @NotNull @NotNull String name, @Nullable @Nullable String description, boolean grantAllUsersAccess) Description copied from interface:ProjectManager
Create new project and store it.- Specified by:
createAndSaveProject
in interfaceProjectManager
- Parameters:
key
- project keyname
- project namedescription
- project descriptiongrantAllUsersAccess
- if anonymous and logged-in users should have READ permission for new project- Returns:
- project
-
getProjects
Description copied from interface:ProjectManager
Returns a collection ofProject
objects- Specified by:
getProjects
in interfaceProjectManager
- Returns:
- all Projects in the system, excluding the ones marked for deletion
-
getNonEmptyProjects
Description copied from interface:ProjectManager
Returns non empty projects.- Specified by:
getNonEmptyProjects
in interfaceProjectManager
- Returns:
- projects not marked for deletion with top level plans
-
getEmptyProjects
Description copied from interface:ProjectManager
Returns empty projects.- Specified by:
getEmptyProjects
in interfaceProjectManager
- Returns:
- projects not marked for deletion without top level plans
-
getSortedProjects
Description copied from interface:ProjectManager
Returns a sorted by name list of projects.- Specified by:
getSortedProjects
in interfaceProjectManager
-
getAllProjects
Description copied from interface:ProjectManager
Returns a collection ofProject
objects- Specified by:
getAllProjects
in interfaceProjectManager
- Returns:
- all Projects in the system, including the ones marked for deletion
-
getProjectCount
Description copied from interface:ProjectManager
Returns the number of projects, including the ones marked for deletion.- Specified by:
getProjectCount
in interfaceProjectManager
-
getNonDeletedProjectCount
Description copied from interface:ProjectManager
Returns the number of projects, excluding the ones marked for deletion.- Specified by:
getNonDeletedProjectCount
in interfaceProjectManager
-
getProjectByKey
Description copied from interface:ProjectManager
Returns the project given a project key. This method returns both not marked and marked for deletion projects, so be careful when using it.- Specified by:
getProjectByKey
in interfaceProjectManager
- Parameters:
key
- - the project key e.g. BAMBOO (not BAMBOO-TRUNK)- Returns:
- A
Project
if the key matches. Otherwise null
-
getProjectById
Description copied from interface:ProjectManager
Returns the project given the id. This method returns both not marked and marked for deletion projects, so be careful when using it.- Specified by:
getProjectById
in interfaceProjectManager
- Parameters:
id
- project id- Returns:
- A
Project
. null if not found.
-
getProjectByOid
Description copied from interface:ProjectManager
Returns project by oid. Only not marked for deletion projects are returned.- Specified by:
getProjectByOid
in interfaceProjectManager
-
getProjectByName
Description copied from interface:ProjectManager
Returns project by name. This method returns both not marked and marked for deletion projects, so be careful when using it.- Specified by:
getProjectByName
in interfaceProjectManager
- Returns:
- project
-
isExistingProjectName
Description copied from interface:ProjectManager
Returns true if the project name already exists- Specified by:
isExistingProjectName
in interfaceProjectManager
- Parameters:
projectName
- to check- Returns:
- true if projectName already exists
-
isExistingProjectKey
Description copied from interface:ProjectManager
Returns true if the project name already exists- Specified by:
isExistingProjectKey
in interfaceProjectManager
- Parameters:
projectKey
- to check- Returns:
- true if projectName already exists
-
saveProject
Description copied from interface:ProjectManager
Saves the project. For new project it creates required ACL records.- Specified by:
saveProject
in interfaceProjectManager
- Parameters:
project
- to be saved
-
deleteProject
Description copied from interface:ProjectManager
Removes the project from the system- Specified by:
deleteProject
in interfaceProjectManager
- Parameters:
project
- project
-
getAllProjectsMarkedForDeletion
- Specified by:
getAllProjectsMarkedForDeletion
in interfaceProjectManager
- Returns:
- all
Project
s that are marked for deletion..
-