Package com.atlassian.jira.config
Class MockSubTaskManager
java.lang.Object
com.atlassian.jira.config.MockSubTaskManager
- All Implemented Interfaces:
SubTaskManager
- Since:
- v4.0
-
Field Summary
Fields inherited from interface com.atlassian.jira.config.SubTaskManager
SUB_TASK_ISSUE_TYPE_STYLE, SUB_TASK_LINK_TYPE_INWARD_NAME, SUB_TASK_LINK_TYPE_NAME, SUB_TASK_LINK_TYPE_OUTWARD_NAME, SUB_TASK_LINK_TYPE_STYLE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionchangeParent
(Issue subTask, Issue parentIssue, ApplicationUser currentUser) Change the parent of the given subtask to the given new parent on behalf of the given user.void
createSubTaskIssueLink
(Issue parentIssue, Issue subTaskIssue, ApplicationUser remoteUser) void
void
Enables sub-tasks on the instance.void
enableSubTasks
(boolean createDefaultIfMissing) Enables sub-tasks on the instance.getParentIssueId
(Issue issue) Returns the parent issue ID of this the given issue.getParentIssueId
(Long issue) Returns the parent issue ID of this the given issue.getParentIssueId
(org.ofbiz.core.entity.GenericValue issue) Returns the parent issue ID of this the given issue.getSubTaskBean
(Issue issue, ApplicationUser remoteUser) Returns the SubTaskBean for the given parent issue in the context of the given user.getSubTaskIssueLinks
(Long issueId) Returns a list of issue links associated with the issueReturns the SubTask IssueType with the given ID.Returns the SubTask IssueType with the given ID.Retrieves all the sub-task issue typesgetSubTaskObjects
(Issue issue) insertSubTaskIssueType
(String name, Long sequence, String description, Long avatarId) Create new issue type and adds it to default scheme.boolean
Return true if the given issue is a subtask.boolean
boolean
boolean
issueTypeExistsByName
(String name) void
moveSubTask
(Issue issue, Long currentSequence, Long sequence) void
void
void
removeSubTaskIssueType
(String name) void
resetSequences
(Issue issue) void
Update existing sub-task issue type.
-
Constructor Details
-
MockSubTaskManager
public MockSubTaskManager()
-
-
Method Details
-
enableSubTasks
Description copied from interface:SubTaskManager
Enables sub-tasks on the instance. If there are no sub-task issue types present, then the default sub-task issue type will be created.- Specified by:
enableSubTasks
in interfaceSubTaskManager
- Throws:
CreateException
- if the default sub-task issue type creation failed.
-
enableSubTasks
Description copied from interface:SubTaskManager
Enables sub-tasks on the instance.- Specified by:
enableSubTasks
in interfaceSubTaskManager
- Parameters:
createDefaultIfMissing
- iftrue
and there are no sub-task issue types present, then the default sub-task issue type will be created.- Throws:
CreateException
- if the default sub-task issue type creation failed.
-
isSubTasksEnabled
public boolean isSubTasksEnabled()- Specified by:
isSubTasksEnabled
in interfaceSubTaskManager
-
disableSubTasks
public void disableSubTasks()- Specified by:
disableSubTasks
in interfaceSubTaskManager
-
isSubTask
Description copied from interface:SubTaskManager
Return true if the given issue is a subtask.- Specified by:
isSubTask
in interfaceSubTaskManager
- Parameters:
issue
- the issue- Returns:
- true if the given issue is a subtask.
-
getParentIssueId
Description copied from interface:SubTaskManager
Returns the parent issue ID of this the given issue. Will return null if the given issue is not a subtask.- Specified by:
getParentIssueId
in interfaceSubTaskManager
- Parameters:
issue
- the issue- Returns:
- the parent issue ID of this the given issue, or null.
-
getParentIssueId
Description copied from interface:SubTaskManager
Returns the parent issue ID of this the given issue. Will return null if the given issue is not a subtask.- Specified by:
getParentIssueId
in interfaceSubTaskManager
- Parameters:
issue
- the issue- Returns:
- the parent issue ID of this the given issue, or null.
- See Also:
-
getParentIssueId
Description copied from interface:SubTaskManager
Returns the parent issue ID of this the given issue. Will return null if the given issue is not a subtask.- Specified by:
getParentIssueId
in interfaceSubTaskManager
- Parameters:
issue
- the issue ID of the subtask- Returns:
- the parent issue ID of this the given issue, or null.
- See Also:
-
getSubTaskBean
Description copied from interface:SubTaskManager
Returns the SubTaskBean for the given parent issue in the context of the given user.- Specified by:
getSubTaskBean
in interfaceSubTaskManager
- Parameters:
issue
- the IssueremoteUser
- the user- Returns:
- the SubTaskBean for the given parent issue in the context of the given user.
-
moveSubTask
- Specified by:
moveSubTask
in interfaceSubTaskManager
-
resetSequences
- Specified by:
resetSequences
in interfaceSubTaskManager
-
insertSubTaskIssueType
public IssueType insertSubTaskIssueType(String name, Long sequence, String description, Long avatarId) throws CreateException Description copied from interface:SubTaskManager
Create new issue type and adds it to default scheme.- Specified by:
insertSubTaskIssueType
in interfaceSubTaskManager
- Throws:
CreateException
-
updateSubTaskIssueType
public void updateSubTaskIssueType(String id, String name, Long sequence, String description, Long avatarId) throws DataAccessException Description copied from interface:SubTaskManager
Update existing sub-task issue type.- Specified by:
updateSubTaskIssueType
in interfaceSubTaskManager
- Throws:
DataAccessException
-
removeSubTaskIssueType
- Specified by:
removeSubTaskIssueType
in interfaceSubTaskManager
- Throws:
RemoveException
-
getSubTaskIssueTypeObjects
Description copied from interface:SubTaskManager
Retrieves all the sub-task issue types- Specified by:
getSubTaskIssueTypeObjects
in interfaceSubTaskManager
- Returns:
- A Collection of all sub-task
IssueType
s.
-
issueTypeExistsById
- Specified by:
issueTypeExistsById
in interfaceSubTaskManager
-
issueTypeExistsByName
- Specified by:
issueTypeExistsByName
in interfaceSubTaskManager
-
moveSubTaskIssueTypeUp
- Specified by:
moveSubTaskIssueTypeUp
in interfaceSubTaskManager
-
moveSubTaskIssueTypeDown
- Specified by:
moveSubTaskIssueTypeDown
in interfaceSubTaskManager
-
getSubTaskIssueTypeById
Description copied from interface:SubTaskManager
Returns the SubTask IssueType with the given ID.- Specified by:
getSubTaskIssueTypeById
in interfaceSubTaskManager
- Parameters:
id
- the ID- Returns:
- SubTask IssueType with the given ID.
-
getSubTaskIssueType
Description copied from interface:SubTaskManager
Returns the SubTask IssueType with the given ID.- Specified by:
getSubTaskIssueType
in interfaceSubTaskManager
- Parameters:
id
- the ID- Returns:
- SubTask IssueType with the given ID.
-
createSubTaskIssueLink
public void createSubTaskIssueLink(Issue parentIssue, Issue subTaskIssue, ApplicationUser remoteUser) throws CreateException - Specified by:
createSubTaskIssueLink
in interfaceSubTaskManager
- Throws:
CreateException
-
getAllSubTaskIssueIds
- Specified by:
getAllSubTaskIssueIds
in interfaceSubTaskManager
-
getSubTaskIssueLinks
Description copied from interface:SubTaskManager
Returns a list of issue links associated with the issue- Specified by:
getSubTaskIssueLinks
in interfaceSubTaskManager
- Parameters:
issueId
- issue id- Returns:
- a list of issue links
-
getSubTaskObjects
- Specified by:
getSubTaskObjects
in interfaceSubTaskManager
-
changeParent
public IssueUpdateBean changeParent(Issue subTask, Issue parentIssue, ApplicationUser currentUser) throws RemoveException, CreateException Description copied from interface:SubTaskManager
Change the parent of the given subtask to the given new parent on behalf of the given user.- Specified by:
changeParent
in interfaceSubTaskManager
- Parameters:
subTask
- The SubTaskparentIssue
- The parent IssuecurrentUser
- The user- Returns:
- an IssueUpdateBean representing the change action.
- Throws:
RemoveException
- if there's a problem unlinking original parent.CreateException
- if there's a problem linking new parent.
-