Class AbstractProjectManager

java.lang.Object
com.atlassian.jira.project.AbstractProjectManager
All Implemented Interfaces:
ProjectManager
Direct Known Subclasses:
CachingProjectManager, DefaultProjectManager, MockProjectManager

public abstract class AbstractProjectManager extends Object implements ProjectManager
  • Constructor Details

  • Method Details

    • getProjectByCurrentKey

      public Project getProjectByCurrentKey(String projectKey)
      Description copied from interface: ProjectManager
      Returns the Project with the given project key.

      This method will strictly only return the project whose current project key is the one given.

      This method is added to the API in anticipation of being able to edit the project key, but this feature has not actually been added in 6.0.

      Specified by:
      getProjectByCurrentKey in interface ProjectManager
      Parameters:
      projectKey - the Project key.
      Returns:
      the Project with the given project key.
      See Also:
    • getProjectCategoryObjectByName

      public ProjectCategory getProjectCategoryObjectByName(String projectCategoryName) throws DataAccessException
      Description copied from interface: ProjectManager
      Find a project category by name.
      Specified by:
      getProjectCategoryObjectByName in interface ProjectManager
      Parameters:
      projectCategoryName - Name of the Project Category
      Returns:
      The ProjectCategory or null if none found
      Throws:
      DataAccessException
    • getProjectCategoryObjectByNameIgnoreCase

      public ProjectCategory getProjectCategoryObjectByNameIgnoreCase(String projectCategoryName) throws DataAccessException
      Description copied from interface: ProjectManager
      Find a project category by name ignoring the case of the category name.
      Specified by:
      getProjectCategoryObjectByNameIgnoreCase in interface ProjectManager
      Parameters:
      projectCategoryName - Name of the Project Category
      Returns:
      The ProjectCategory or null if none found
      Throws:
      DataAccessException
    • getProjectsByArgs

      @Nonnull public Collection<Project> getProjectsByArgs(@Nonnull Collection<String> projectArgs)
      Description copied from interface: ProjectManager
      Resolve project arguments(ID, name or key) into list of project objects.
      Specified by:
      getProjectsByArgs in interface ProjectManager
      Parameters:
      projectArgs - set of arguments: ID, key or name
      Returns:
      the collection of projects
    • convertToProjectObjects

      public List<Project> convertToProjectObjects(Collection<Long> projectIds)
      Description copied from interface: ProjectManager
      Converts a collection of projectIds to a list of projects.

      Will return null if incoming collection is null.

      The returned list of Project Objects will have the same sort order as the incoming collection of IDs.

      Specified by:
      convertToProjectObjects in interface ProjectManager
      Parameters:
      projectIds - a Collection of Project IDs
      Returns:
      List of Projects, or null if input is null
    • convertToOptionalProjectObjects

      public List<Pair<Long,Optional<Project>>> convertToOptionalProjectObjects(Collection<Long> projectIds)
      Description copied from interface: ProjectManager
      Converts a collection of projectIds to a list of pairs (project id, optional project).

      Will return empty list if incoming collection is null.

      The returned list of Project Objects will have the same sort order as the incoming collection of IDs.

      Specified by:
      convertToOptionalProjectObjects in interface ProjectManager
      Parameters:
      projectIds - a Collection of Project IDs
      Returns:
      List of Pairs (Project ID, Optional Project), or empty list if input is null
    • getDefaultAssignee

      public ApplicationUser getDefaultAssignee(Project project, ProjectComponent component)
      Description copied from interface: ProjectManager
      Gets the default assignee for a project and/or component depending on if a component was specified.
      Specified by:
      getDefaultAssignee in interface ProjectManager
      Parameters:
      project - project
      component - component
      Returns:
      the default assignee for this project/component
    • getDefaultAssignee

      public ApplicationUser getDefaultAssignee(Project project, Collection<ProjectComponent> components) throws DefaultAssigneeException
      Description copied from interface: ProjectManager
      Gets the default assignee for an issue given its project and list of Components.

      If the default assignee configuration is invalid, then a DefaultAssigneeException is thrown. This could be because the default is unassigned, and unassigned issues are not allowed, or because the default user does not have permission to be assigned to issues in this project.

      Specified by:
      getDefaultAssignee in interface ProjectManager
      Parameters:
      project - project
      components - The components
      Returns:
      the default assignee for this project/components
      Throws:
      DefaultAssigneeException - If the default assignee is invalid (eg user does not have assign permission) .
    • updateProject

      public Project updateProject(Project updatedProject, String name, String description, String lead, String url, Long assigneeType)
      Description copied from interface: ProjectManager
      Updates the project provided with the new attributes passed in. This method is responsible for persisting any changes to the database.
      Specified by:
      updateProject in interface ProjectManager
      Parameters:
      updatedProject - The project to be updated.
      name - The name for the updated project
      description - An optional description for the project
      lead - The userkey of the lead developer for the project
      url - An optional URL for the updated project
      assigneeType - The default assignee for issues created in this project. May be either project lead, or unassigned if unassigned issues are enabled.
      Returns:
      The updated project
    • updateProject

      public Project updateProject(Project updatedProject, String name, String description, String lead, String url, Long assigneeType, Long avatarId)
      Description copied from interface: ProjectManager
      Updates the project provided with the new attributes passed in. This method is responsible for persisting any changes to the database.
      Specified by:
      updateProject in interface ProjectManager
      Parameters:
      updatedProject - The project to be updated.
      name - The name for the updated project
      description - An optional description for the project
      lead - The userkey of the lead developer for the project
      url - An optional URL for the updated project
      assigneeType - The default assignee for issues created in this project. May be either project lead, or unassigned if unassigned issues are enabled.
      avatarId - the id of an existing avatar.
      Returns:
      The updated project