Class DefaultProjectManager

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

public class DefaultProjectManager extends Object implements ProjectManager
  • Constructor Details

  • 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 interface ProjectManager
      Parameters:
      key - project key
      name - project name
      description - 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 interface ProjectManager
      Parameters:
      key - project key
      name - project name
      description - project description
      grantAllUsersAccess - if anonymous and logged-in users should have READ permission for new project
      Returns:
      project
    • getProjects

      @NotNull public @NotNull 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
    • getNonEmptyProjects

      @NotNull public @NotNull List<Project> getNonEmptyProjects()
      Description copied from interface: ProjectManager
      Returns non empty projects.
      Specified by:
      getNonEmptyProjects in interface ProjectManager
      Returns:
      projects not marked for deletion with top level plans
    • getEmptyProjects

      @NotNull public @NotNull List<Project> getEmptyProjects()
      Description copied from interface: ProjectManager
      Returns empty projects.
      Specified by:
      getEmptyProjects in interface ProjectManager
      Returns:
      projects not marked for deletion without top level plans
    • getSortedProjects

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

      @NotNull public @NotNull 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 @NotNull Number getProjectCount()
      Description copied from interface: ProjectManager
      Returns the number of projects, including the ones marked for deletion.
      Specified by:
      getProjectCount in interface ProjectManager
    • getNonDeletedProjectCount

      public Number getNonDeletedProjectCount()
      Description copied from interface: ProjectManager
      Returns the number of projects, excluding the ones marked for deletion.
      Specified by:
      getNonDeletedProjectCount in interface ProjectManager
    • getProjectByKey

      public Project getProjectByKey(@NotNull @NotNull String key)
      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 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 @Nullable Project getProjectById(long id)
      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 interface ProjectManager
      Parameters:
      id - project id
      Returns:
      A Project. null if not found.
    • getProjectByOid

      @Nullable public @Nullable Project getProjectByOid(@NotNull @NotNull BambooEntityOid oid)
      Description copied from interface: ProjectManager
      Returns project by oid. Only not marked for deletion projects are returned.
      Specified by:
      getProjectByOid in interface ProjectManager
    • getProjectByName

      public Project getProjectByName(@NotNull @NotNull String projectName)
      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 interface ProjectManager
      Returns:
      project
    • isExistingProjectName

      public boolean isExistingProjectName(@NotNull @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 @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 @NotNull Project project)
      Description copied from interface: ProjectManager
      Saves the project. For new project it creates required ACL records.
      Specified by:
      saveProject in interface ProjectManager
      Parameters:
      project - to be saved
    • deleteProject

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