Interface ProjectManager

    • Method Detail

      • createProject

        @NotNull
        default @NotNull Project createProject​(@NotNull
                                               @NotNull String key,
                                               @NotNull
                                               @NotNull String name)
        Creates a new Project Note that this method will not save the project
        Parameters:
        key - project key
        name - project name
        Returns:
        project
      • createProject

        @NotNull
        @NotNull Project createProject​(@NotNull
                                       @NotNull String key,
                                       @NotNull
                                       @NotNull String name,
                                       @NotNull
                                       @NotNull String description)
        Creates a new Project
        Parameters:
        key - project key
        name - project name
        description - project description
        Returns:
        project
      • createAndSaveProject

        Project createAndSaveProject​(@NotNull
                                     @NotNull String key,
                                     @NotNull
                                     @NotNull String name,
                                     @Nullable
                                     @Nullable String description,
                                     boolean grantAllUsersAccess)
        Create new project and store it.
        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
        @NotNull Set<Project> getProjects()
        Returns a collection of Project objects
        Returns:
        all Projects in the system, excluding the ones marked for deletion
      • getNonEmptyProjects

        @NotNull
        @NotNull List<Project> getNonEmptyProjects()
        Returns non empty projects.
        Returns:
        projects not marked for deletion with top level plans
      • getEmptyProjects

        @NotNull
        @NotNull List<Project> getEmptyProjects()
        Returns empty projects.
        Returns:
        projects not marked for deletion without top level plans
      • getSortedProjects

        @NotNull
        @NotNull List<Project> getSortedProjects()
        Returns a sorted by name list of projects.
      • getAllProjects

        @NotNull
        @NotNull Set<Project> getAllProjects()
        Returns a collection of Project objects
        Returns:
        all Projects in the system, including the ones marked for deletion
      • getProjectCount

        Number getProjectCount()
        Returns the number of projects, including the ones marked for deletion.
      • getNonDeletedProjectCount

        Number getNonDeletedProjectCount()
        Returns the number of projects, excluding the ones marked for deletion.
      • getProjectByKey

        @Nullable
        @Nullable Project getProjectByKey​(@NotNull
                                          @NotNull String key)
        Returns the project given a project key. This method returns both not marked and marked for deletion projects, so be careful when using it.
        Parameters:
        key - - the project key e.g. BAMBOO (not BAMBOO-TRUNK)
        Returns:
        A Project if the key matches. Otherwise null
      • getProjectById

        @Nullable
        @Nullable Project getProjectById​(long id)
        Returns the project given the id. This method returns both not marked and marked for deletion projects, so be careful when using it.
        Parameters:
        id - project id
        Returns:
        A Project. null if not found.
      • getProjectByOid

        @Nullable
        @Nullable Project getProjectByOid​(@NotNull
                                          @NotNull BambooEntityOid oid)
        Returns project by oid. Only not marked for deletion projects are returned.
        Since:
        5.15
      • getProjectByName

        Project getProjectByName​(@NotNull
                                 @NotNull String projectName)
        Returns project by name. This method returns both not marked and marked for deletion projects, so be careful when using it.
        Parameters:
        projectName -
        Returns:
        project
      • isExistingProjectKey

        boolean isExistingProjectKey​(@NotNull
                                     @NotNull String projectKey)
        Returns true if the project name already exists
        Parameters:
        projectKey - to check
        Returns:
        true if projectName already exists
      • isExistingProjectName

        boolean isExistingProjectName​(@NotNull
                                      @NotNull String projectName)
        Returns true if the project name already exists
        Parameters:
        projectName - to check
        Returns:
        true if projectName already exists
      • saveProject

        void saveProject​(@NotNull
                         @NotNull Project project)
        Saves the project. For new project it creates required ACL records.
        Parameters:
        project - to be saved
      • deleteProject

        void deleteProject​(@NotNull
                           @NotNull Project project)
        Removes the project from the system
        Parameters:
        project - project
      • getAllProjectsMarkedForDeletion

        @NotNull
        @NotNull Collection<Project> getAllProjectsMarkedForDeletion()
        Returns:
        all Projects that are marked for deletion..