public class

DefaultIssueLinkManager

extends Object
implements IssueLinkManager
java.lang.Object
   ↳ com.atlassian.jira.issue.link.DefaultIssueLinkManager

Summary

Public Constructors
DefaultIssueLinkManager(OfBizDelegator genericDelegator, DbConnectionManager dbConnectionManager, IssueLinkCreator issueLinkCreator, IssueLinkTypeManager issueLinkTypeManager, IssueUpdater issueUpdater, IssueIndexingService issueIndexingService, ApplicationProperties applicationProperties)
Public Methods
void changeIssueLinkType(IssueLink issueLink, IssueLinkType swapLinkType, ApplicationUser remoteUser)
Changes the type of an issue link.
void createIssueLink(Long sourceId, Long destinationId, Long issueLinkTypeId, Long sequence, ApplicationUser remoteUser)
Constructs a new issuelink from the sourceIssueId to the destinationId and persists it.
List<IssueLink> getInwardLinks(Long destinationId)
Get links to an issue.
IssueLink getIssueLink(Long issueLinkId)
Returns the IssueLink with the specified id.
IssueLink getIssueLink(Long sourceId, Long destinationId, Long issueLinkTypeId)
Retrieves an issue link given a source, destination and a link type.
Collection<IssueLink> getIssueLinks(Long issueLinkTypeId)
Returns a collection of all IssueLinks for a particular issue link type
LinkCollection getLinkCollection(Issue issue, ApplicationUser remoteUser, boolean excludeSystemLinks)
LinkCollection getLinkCollection(GenericValue issue, ApplicationUser remoteUser)
Constructs a LinkCollection for a given issue.
LinkCollection getLinkCollection(Issue issue, ApplicationUser remoteUser)
Constructs a LinkCollection for a given issue.
LinkCollection getLinkCollectionOverrideSecurity(Issue issue)
Constructs a LinkCollection for a given issue, ignoring security.
List<IssueLink> getOutwardLinks(Long sourceId)
Get links from an issue.
boolean isLinkingEnabled()
Returns whether Issue Linking is currently enabled in JIRA.
void moveIssueLink(List<IssueLink> issueLinks, Long currentSequence, Long sequence)
Moves an issue link to a different position in the list of issuelink.
void removeIssueLink(IssueLink issueLink, ApplicationUser remoteUser)
Removes a single issue link We do not check for permission here.
int removeIssueLinks(Issue issue, ApplicationUser remoteUser)
Removes ALL incoming and outgoing issuelinks from the issue supplied.
int removeIssueLinks(GenericValue issue, ApplicationUser remoteUser)
Removes ALL incoming and outgoing issuelinks from the issue supplied.
int removeIssueLinksNoChangeItems(Issue issue)
Removes ALL incoming and outgoing issuelinks from the issue supplied without creating ChangeItems for the Change History.
void resetSequences(List<IssueLink> issueLinks)
Sets the sequence number for each issueLink in the List of issueLinks provided according to its position in the List.
Protected Methods
void reindexLinkedIssues(IssueLink issueLink)
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.issue.link.IssueLinkManager

Public Constructors

public DefaultIssueLinkManager (OfBizDelegator genericDelegator, DbConnectionManager dbConnectionManager, IssueLinkCreator issueLinkCreator, IssueLinkTypeManager issueLinkTypeManager, IssueUpdater issueUpdater, IssueIndexingService issueIndexingService, ApplicationProperties applicationProperties)

Public Methods

public void changeIssueLinkType (IssueLink issueLink, IssueLinkType swapLinkType, ApplicationUser remoteUser)

Changes the type of an issue link. NOTE: It is not possible to convert a system link type to a non-system link type and vice versa.

Parameters
issueLink the issue link
swapLinkType the new link type
remoteUser the user requesting this change

public void createIssueLink (Long sourceId, Long destinationId, Long issueLinkTypeId, Long sequence, ApplicationUser remoteUser)

Constructs a new issuelink from the sourceIssueId to the destinationId and persists it. This operation will cause a re-index of the associated issues.

Parameters
sourceId The source issue.
destinationId The destination issue.
issueLinkTypeId The type of issuelink
sequence In which order the link will appear in the UI
remoteUser Needed for creation of change items.

public List<IssueLink> getInwardLinks (Long destinationId)

Get links to an issue.

Parameters
destinationId Eg. from getId()
Returns
  • List of IssueLinks. This list will be immutable.

public IssueLink getIssueLink (Long issueLinkId)

Returns the IssueLink with the specified id.

Parameters
issueLinkId the issue link id.
Returns
  • the IssueLink. Can be NULL, if no issue link found.

public IssueLink getIssueLink (Long sourceId, Long destinationId, Long issueLinkTypeId)

Retrieves an issue link given a source, destination and a link type.

Parameters
sourceId the ID of the source issue
destinationId the ID of the destination issue
issueLinkTypeId the issue link type
Returns
  • an IssueLink or null if this link does not exist

public Collection<IssueLink> getIssueLinks (Long issueLinkTypeId)

Returns a collection of all IssueLinks for a particular issue link type

Parameters
issueLinkTypeId ID of the Issue Link Type
Returns

public LinkCollection getLinkCollection (Issue issue, ApplicationUser remoteUser, boolean excludeSystemLinks)

public LinkCollection getLinkCollection (GenericValue issue, ApplicationUser remoteUser)

Constructs a LinkCollection for a given issue.

Parameters
issue the Issue
remoteUser the remote user
Returns

public LinkCollection getLinkCollection (Issue issue, ApplicationUser remoteUser)

Constructs a LinkCollection for a given issue.

Parameters
issue the issue
remoteUser the user performing the search
Returns

public LinkCollection getLinkCollectionOverrideSecurity (Issue issue)

Constructs a LinkCollection for a given issue, ignoring security.

Parameters
issue the issue
Returns

public List<IssueLink> getOutwardLinks (Long sourceId)

Get links from an issue.

Parameters
sourceId Eg. from getId()
Returns
  • List of IssueLinks. This list will be immutable.

public boolean isLinkingEnabled ()

Returns whether Issue Linking is currently enabled in JIRA. Issue Linking can be enabled or disabled in the Admin section of JIRA.

public void moveIssueLink (List<IssueLink> issueLinks, Long currentSequence, Long sequence)

Moves an issue link to a different position in the list of issuelink. NOTE: This is currently only used when re-ordering sub-tasks.

Parameters
issueLinks The list of issueLinks
currentSequence The postion of the issuelink about to be moved
sequence The target position of the issuelink

public void removeIssueLink (IssueLink issueLink, ApplicationUser remoteUser)

Removes a single issue link We do not check for permission here. It should be done before this method is called. For example, in the action.

Parameters
issueLink the issue link to remove
remoteUser needed for creation of change items

public int removeIssueLinks (Issue issue, ApplicationUser remoteUser)

Removes ALL incoming and outgoing issuelinks from the issue supplied.

Parameters
issue the Issue
remoteUser the remote user
Returns
  • The total number of issuelinks deleted.

public int removeIssueLinks (GenericValue issue, ApplicationUser remoteUser)

Removes ALL incoming and outgoing issuelinks from the issue supplied.

Parameters
issue the Issue
remoteUser the remote user
Returns
  • The total number of issuelinks deleted.

public int removeIssueLinksNoChangeItems (Issue issue)

Removes ALL incoming and outgoing issuelinks from the issue supplied without creating ChangeItems for the Change History.

You would normally want to use the other method which creates the ChangeItems - this method is only intended for use during Issue Delete.

Parameters
issue the Issue
Returns
  • The total number of issuelinks deleted.

public void resetSequences (List<IssueLink> issueLinks)

Sets the sequence number for each issueLink in the List of issueLinks provided according to its position in the List.

Parameters
issueLinks A list of issue links to be recalculated

Protected Methods

protected void reindexLinkedIssues (IssueLink issueLink)