Class AbstractProjectManager
- All Implemented Interfaces:
ProjectManager
- Direct Known Subclasses:
CachingProjectManager,DefaultProjectManager,MockProjectManager
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractProjectManager(UserManager userManager, ApplicationProperties applicationProperties) -
Method Summary
Modifier and TypeMethodDescriptionconvertToOptionalProjectObjects(Collection<Long> projectIds) Converts a collection of projectIds to a list of pairs (project id, optional project).convertToProjectObjects(Collection<Long> projectIds) Converts a collection of projectIds to a list of projects.getDefaultAssignee(Project project, ProjectComponent component) Gets the default assignee for a project and/or component depending on if a component was specified.getDefaultAssignee(Project project, Collection<ProjectComponent> components) Gets the default assignee for an issue given its project and list of Components.getProjectByCurrentKey(String projectKey) Returns theProjectwith the given project key.getProjectCategoryObjectByName(String projectCategoryName) Find a project category by name.getProjectCategoryObjectByNameIgnoreCase(String projectCategoryName) Find a project category by name ignoring the case of the category name.getProjectsByArgs(Collection<String> projectArgs) Resolve project arguments(ID, name or key) into list of project objects.updateProject(Project updatedProject, String name, String description, String lead, String url, Long assigneeType) Updates the project provided with the new attributes passed in.updateProject(Project updatedProject, String name, String description, String lead, String url, Long assigneeType, Long avatarId) Updates the project provided with the new attributes passed in.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.atlassian.jira.project.ProjectManager
clearCreatedByForUserInProjects, clearLastUpdatedByForUserInProjects, createProject, createProjectCategory, getAllProjectCategories, getAllProjectKeys, getArchivedProjects, getCurrentCounterForProject, getNextId, getProjectByCurrentKeyIgnoreCase, getProjectCategory, getProjectCategoryForProject, getProjectCategoryObject, getProjectCount, getProjectObj, getProjectObjByKey, getProjectObjByKeyIgnoreCase, getProjectObjByName, getProjectObjects, getProjectObjectsFromProjectCategory, getProjectObjectsWithNoCategory, getProjects, getProjectsCreatedBy, getProjectsFromProjectCategory, getProjectsLastUpdatedBy, getProjectsLeadBy, isProjectCategoryUnique, refresh, removeProject, removeProjectCategory, removeProjectIssues, removeProjectIssues, removeProjectsCreator, removeProjectsUpdater, setCurrentCounterForProject, setProjectCategory, updateProject, updateProject, updateProjectCategory, updateProjectType
-
Constructor Details
-
AbstractProjectManager
-
-
Method Details
-
getProjectByCurrentKey
Description copied from interface:ProjectManagerReturns theProjectwith 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:
getProjectByCurrentKeyin interfaceProjectManager- Parameters:
projectKey- the Project key.- Returns:
- the
Projectwith the given project key. - See Also:
-
getProjectCategoryObjectByName
public ProjectCategory getProjectCategoryObjectByName(String projectCategoryName) throws DataAccessException Description copied from interface:ProjectManagerFind a project category by name.- Specified by:
getProjectCategoryObjectByNamein interfaceProjectManager- 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:ProjectManagerFind a project category by name ignoring the case of the category name.- Specified by:
getProjectCategoryObjectByNameIgnoreCasein interfaceProjectManager- Parameters:
projectCategoryName- Name of the Project Category- Returns:
- The ProjectCategory or null if none found
- Throws:
DataAccessException
-
getProjectsByArgs
Description copied from interface:ProjectManagerResolve project arguments(ID, name or key) into list of project objects.- Specified by:
getProjectsByArgsin interfaceProjectManager- Parameters:
projectArgs- set of arguments: ID, key or name- Returns:
- the collection of projects
-
convertToProjectObjects
Description copied from interface:ProjectManagerConverts 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:
convertToProjectObjectsin interfaceProjectManager- 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:ProjectManagerConverts 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:
convertToOptionalProjectObjectsin interfaceProjectManager- Parameters:
projectIds- a Collection of Project IDs- Returns:
- List of Pairs (Project ID, Optional Project), or empty list if input is null
-
getDefaultAssignee
Description copied from interface:ProjectManagerGets the default assignee for a project and/or component depending on if a component was specified.- Specified by:
getDefaultAssigneein interfaceProjectManager- Parameters:
project- projectcomponent- component- Returns:
- the default assignee for this project/component
-
getDefaultAssignee
public ApplicationUser getDefaultAssignee(Project project, Collection<ProjectComponent> components) throws DefaultAssigneeException Description copied from interface:ProjectManagerGets 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:
getDefaultAssigneein interfaceProjectManager- Parameters:
project- projectcomponents- 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:ProjectManagerUpdates the project provided with the new attributes passed in. This method is responsible for persisting any changes to the database.- Specified by:
updateProjectin interfaceProjectManager- Parameters:
updatedProject- The project to be updated.name- The name for the updated projectdescription- An optional description for the projectlead- The userkey of the lead developer for the projecturl- An optional URL for the updated projectassigneeType- 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:ProjectManagerUpdates the project provided with the new attributes passed in. This method is responsible for persisting any changes to the database.- Specified by:
updateProjectin interfaceProjectManager- Parameters:
updatedProject- The project to be updated.name- The name for the updated projectdescription- An optional description for the projectlead- The userkey of the lead developer for the projecturl- An optional URL for the updated projectassigneeType- 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
-