com.atlassian.jira.issue.link
Class DefaultIssueLinkTypeManager

java.lang.Object
  extended by com.atlassian.jira.issue.link.DefaultIssueLinkTypeManager
All Implemented Interfaces:
Startable, IssueLinkTypeManager

public class DefaultIssueLinkTypeManager
extends Object
implements IssueLinkTypeManager, Startable


Constructor Summary
DefaultIssueLinkTypeManager(OfBizDelegator delegator, com.atlassian.event.api.EventPublisher eventPublisher)
           
 
Method Summary
 void createIssueLinkType(String name, String outward, String inward, String style)
           
 IssueLinkType getIssueLinkType(Long id)
           
 Collection<IssueLinkType> getIssueLinkTypes()
          Find only the user defined link types
 Collection<IssueLinkType> getIssueLinkTypesByInwardDescription(String desc)
          Returns a collection of IssueLinkTypes with the given description as the inward description.
 Collection getIssueLinkTypesByName(String name)
          Returns a collection of IssueLinkTypes with the given name.
 Collection<IssueLinkType> getIssueLinkTypesByOutwardDescription(String desc)
          Returns a collection of IssueLinkTypes with the given description as the outward description.
 Collection getIssueLinkTypesByStyle(String style)
           
 void onClearCache(ClearCacheEvent event)
           
 void removeIssueLinkType(Long issueLinkTypeId)
          This method removed the issue link type from the database
WARNING: This method DOES NOT check if there are any existing issue links of this issue link type.
 void start()
          This method wil be called after the plugin system is fully initialised and all components added to the dependency injection framework.
 void updateIssueLinkType(IssueLinkType issueLinkType, String name, String outward, String inward)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultIssueLinkTypeManager

public DefaultIssueLinkTypeManager(OfBizDelegator delegator,
                                   com.atlassian.event.api.EventPublisher eventPublisher)
Method Detail

start

public void start()
           throws Exception
Description copied from interface: Startable
This method wil be called after the plugin system is fully initialised and all components added to the dependency injection framework.

Specified by:
start in interface Startable
Throws:
Exception - Allows implementations to throw an Exception.

onClearCache

@EventListener
public void onClearCache(ClearCacheEvent event)

createIssueLinkType

public void createIssueLinkType(String name,
                                String outward,
                                String inward,
                                String style)
Specified by:
createIssueLinkType in interface IssueLinkTypeManager

getIssueLinkType

public IssueLinkType getIssueLinkType(Long id)
Specified by:
getIssueLinkType in interface IssueLinkTypeManager

getIssueLinkTypesByName

public Collection getIssueLinkTypesByName(String name)
Description copied from interface: IssueLinkTypeManager
Returns a collection of IssueLinkTypes with the given name. Actually this collection should always have either one or zero elements - it is illegal to have two link types with the same name.

Specified by:
getIssueLinkTypesByName in interface IssueLinkTypeManager
Parameters:
name - The name to search for Issue Link Types by.
Returns:
a collection of IssueLinkTypes, or an empty collection if name isn't a link type. TODO: Reconsider this method. The GUI enforces unique names.

getIssueLinkTypesByInwardDescription

public Collection<IssueLinkType> getIssueLinkTypesByInwardDescription(String desc)
Description copied from interface: IssueLinkTypeManager
Returns a collection of IssueLinkTypes with the given description as the inward description.

There is no restriction on inward and outward descriptions being unique across issue link types, which is why this may return more than one IssueLinkType.

Specified by:
getIssueLinkTypesByInwardDescription in interface IssueLinkTypeManager
Parameters:
desc - the inward description to search on
Returns:
the collection of matched issue link types; never null.

getIssueLinkTypesByOutwardDescription

public Collection<IssueLinkType> getIssueLinkTypesByOutwardDescription(String desc)
Description copied from interface: IssueLinkTypeManager
Returns a collection of IssueLinkTypes with the given description as the outward description.

There is no restriction on inward and outward descriptions being unique across issue link types, which is why this may return more than one IssueLinkType.

Specified by:
getIssueLinkTypesByOutwardDescription in interface IssueLinkTypeManager
Parameters:
desc - the outward description to search on
Returns:
the collection of matched issue link types; never null.

getIssueLinkTypesByStyle

public Collection getIssueLinkTypesByStyle(String style)
Specified by:
getIssueLinkTypesByStyle in interface IssueLinkTypeManager

updateIssueLinkType

public void updateIssueLinkType(IssueLinkType issueLinkType,
                                String name,
                                String outward,
                                String inward)
Specified by:
updateIssueLinkType in interface IssueLinkTypeManager

removeIssueLinkType

public void removeIssueLinkType(Long issueLinkTypeId)
Description copied from interface: IssueLinkTypeManager
This method removed the issue link type from the database
WARNING: This method DOES NOT check if there are any existing issue links of this issue link type. It simply removes the record from the datastore. Use IssueLinkTypeDestroyer to 'nicely' remove the issue link type taking care of exiting issue links.

Specified by:
removeIssueLinkType in interface IssueLinkTypeManager
Parameters:
issueLinkTypeId - the id of the IssueLinkType to remove

getIssueLinkTypes

public Collection<IssueLinkType> getIssueLinkTypes()
Find only the user defined link types

Specified by:
getIssueLinkTypes in interface IssueLinkTypeManager


Copyright © 2002-2010 Atlassian. All Rights Reserved.