com.atlassian.jira.issue.link
Class DefaultIssueLinkManager

java.lang.Object
  extended by com.atlassian.jira.issue.link.DefaultIssueLinkManager
All Implemented Interfaces:
IssueLinkManager

public class DefaultIssueLinkManager
extends Object
implements IssueLinkManager


Constructor Summary
DefaultIssueLinkManager(OfBizDelegator genericDelegator, IssueLinkCreator issueLinkCreator, IssueLinkTypeManager issueLinkTypeManager, CollectionReorderer collectionReorderer, IssueUpdater issueUpdater, IssueIndexManager issueIndexManager, ApplicationProperties applicationProperties)
           
 
Method Summary
 void changeIssueLinkType(IssueLink issueLink, IssueLinkType swapLinkType, User remoteUser)
          Changes the type of an issue link.
 void createIssueLink(Long sourceId, Long destinationId, Long issueLinkTypeId, Long sequence, User remoteUser)
          Constructs a new issuelink from the sourceIssueId to the destinationId and persists it.
 List getInwardLinks(Long id)
          Get links to an issue.
 IssueLink getIssueLink(Long sourceId, Long destinationId, Long issueLinkTypeId)
          Retrieves an issue link given a source, destination and a link type.
 Collection getIssueLinks(Long issueLinkTypeId)
          Returns a collection of all IssueLinks for a particular issue link type
 LinkCollection getLinkCollection(org.ofbiz.core.entity.GenericValue issue, User remoteUser)
          Constructs a LinkCollection for a given issue.
 List getOutwardLinks(Long sourceId)
          Get links from an issue.
 boolean isLinkingEnabled()
          Returns whether Issue Linking is currently enabled in JIRA.
 void moveIssueLink(List issueLinks, Long currentSequence, Long sequence)
          Moves an issue link to a different position in the list of issuelink.
protected  void reindexLinkedIssues(IssueLink issueLink)
           
 void removeIssueLink(IssueLink issueLink, User remoteUser)
          We do not check for permission here.
 int removeIssueLinks(org.ofbiz.core.entity.GenericValue issue, User remoteUser)
          Removes ALL incoming and outgoing issuelinks from the issue supplied.
 void resetSequences(List issueLinks)
          Sets the sequence number for each issueLink in the List of issueLinks provided according to its position in the List.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultIssueLinkManager

public DefaultIssueLinkManager(OfBizDelegator genericDelegator,
                               IssueLinkCreator issueLinkCreator,
                               IssueLinkTypeManager issueLinkTypeManager,
                               CollectionReorderer collectionReorderer,
                               IssueUpdater issueUpdater,
                               IssueIndexManager issueIndexManager,
                               ApplicationProperties applicationProperties)
Method Detail

createIssueLink

public void createIssueLink(Long sourceId,
                            Long destinationId,
                            Long issueLinkTypeId,
                            Long sequence,
                            User remoteUser)
                     throws CreateException
Description copied from interface: IssueLinkManager
Constructs a new issuelink from the sourceIssueId to the destinationId and persists it. This operation will cause a re-index of the associated issues.

Specified by:
createIssueLink in interface IssueLinkManager
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.
Throws:
CreateException

reindexLinkedIssues

protected void reindexLinkedIssues(IssueLink issueLink)

removeIssueLink

public void removeIssueLink(IssueLink issueLink,
                            User remoteUser)
                     throws RemoveException
We do not check for permission here. It should be done before this method is called. For example, in the action.

Specified by:
removeIssueLink in interface IssueLinkManager
Parameters:
issueLink -
remoteUser -
Throws:
RemoveException

removeIssueLinks

public int removeIssueLinks(org.ofbiz.core.entity.GenericValue issue,
                            User remoteUser)
                     throws RemoveException
Description copied from interface: IssueLinkManager
Removes ALL incoming and outgoing issuelinks from the issue supplied.

Specified by:
removeIssueLinks in interface IssueLinkManager
Returns:
The total number of issuelinks deleted.
Throws:
RemoveException

getLinkCollection

public LinkCollection getLinkCollection(org.ofbiz.core.entity.GenericValue issue,
                                        User remoteUser)
Description copied from interface: IssueLinkManager
Constructs a LinkCollection for a given issue.

Specified by:
getLinkCollection in interface IssueLinkManager
Returns:
A LinkCollection with all the issues ingoing and outgoing issue links

getOutwardLinks

public List getOutwardLinks(Long sourceId)
Description copied from interface: IssueLinkManager
Get links from an issue.

Specified by:
getOutwardLinks in interface IssueLinkManager
Parameters:
sourceId - Eg. from Issue.getId()
Returns:
List of IssueLinks

getInwardLinks

public List getInwardLinks(Long id)
Description copied from interface: IssueLinkManager
Get links to an issue.

Specified by:
getInwardLinks in interface IssueLinkManager
Parameters:
id - Eg. from Issue.getId()
Returns:
List of IssueLinks

moveIssueLink

public void moveIssueLink(List issueLinks,
                          Long currentSequence,
                          Long sequence)
Description copied from interface: IssueLinkManager
Moves an issue link to a different position in the list of issuelink. NOTE: This is currently only used when re-ordering sub-tasks.

Specified by:
moveIssueLink in interface IssueLinkManager
Parameters:
issueLinks - The list of issueLinks
currentSequence - The postion of the issuelink about to be moved
sequence - The target position of the issuelink

resetSequences

public void resetSequences(List issueLinks)
Description copied from interface: IssueLinkManager
Sets the sequence number for each issueLink in the List of issueLinks provided according to its position in the List.

Specified by:
resetSequences in interface IssueLinkManager
Parameters:
issueLinks - A list of issue links to be recalculated

getIssueLink

public IssueLink getIssueLink(Long sourceId,
                              Long destinationId,
                              Long issueLinkTypeId)
Description copied from interface: IssueLinkManager
Retrieves an issue link given a source, destination and a link type.

Specified by:
getIssueLink in interface IssueLinkManager
Returns:
an IssueLink

getIssueLinks

public Collection getIssueLinks(Long issueLinkTypeId)
Description copied from interface: IssueLinkManager
Returns a collection of all IssueLinks for a particular issue link type

Specified by:
getIssueLinks in interface IssueLinkManager
Returns:
A collection of IssueLinks

changeIssueLinkType

public void changeIssueLinkType(IssueLink issueLink,
                                IssueLinkType swapLinkType,
                                User remoteUser)
                         throws RemoveException
Description copied from interface: IssueLinkManager
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.

Specified by:
changeIssueLinkType in interface IssueLinkManager
Throws:
RemoveException

isLinkingEnabled

public boolean isLinkingEnabled()
Description copied from interface: IssueLinkManager
Returns whether Issue Linking is currently enabled in JIRA. Issue Linking can be enabled or disabled in the Admin section of JIRA.

Specified by:
isLinkingEnabled in interface IssueLinkManager


Copyright © 2002-2007 Atlassian. All Rights Reserved.