com.atlassian.applinks.api
Interface ApplicationLinkService


public interface ApplicationLinkService

Provides methods for retrieving ApplicationLinks representing linked applications (e.g. JIRA, Confluence, etc.)

Since:
v3.0

Method Summary
 ApplicationLink getApplicationLink(ApplicationId id)
          Retrieves an ApplicationLink by its ApplicationId.
 java.lang.Iterable<ApplicationLink> getApplicationLinks()
          Retrieves all ApplicationLinks.
 java.lang.Iterable<ApplicationLink> getApplicationLinks(java.lang.Class<? extends ApplicationType> type)
          Retrieves all ApplicationLinks of a particular ApplicationType.
 ApplicationLink getPrimaryApplicationLink(java.lang.Class<? extends ApplicationType> type)
          Retrieves the primary ApplicationLink of a particular ApplicationType.
 

Method Detail

getApplicationLink

ApplicationLink getApplicationLink(ApplicationId id)
                                   throws TypeNotInstalledException
Retrieves an ApplicationLink by its ApplicationId. Use this method only if you know the ApplicationId of an existing ApplicationLink. If you storing an ApplicationId for future look-ups using this method, you should listen for the ApplicationLinksIDChangedEvent to ensure your stored ApplicationId is kept current.

Parameters:
id - the ApplicationId of a stored ApplicationLink
Returns:
the ApplicationLink specified by the id, or null if it does not exist
Throws:
TypeNotInstalledException - if the specified ApplicationLink's ApplicationType is not currently installed.

getApplicationLinks

java.lang.Iterable<ApplicationLink> getApplicationLinks()
Retrieves all ApplicationLinks.

Returns:
an Iterable of stored ApplicationLinks, of all ApplicationTypes.

getApplicationLinks

java.lang.Iterable<ApplicationLink> getApplicationLinks(java.lang.Class<? extends ApplicationType> type)
Retrieves all ApplicationLinks of a particular ApplicationType.

Parameters:
type - the Class of the ApplicationTypes to return
Returns:
an Iterable containing all stored ApplicationLinks of the specified type. The primary ApplicationLink is the first link in the list.

getPrimaryApplicationLink

ApplicationLink getPrimaryApplicationLink(java.lang.Class<? extends ApplicationType> type)
Retrieves the primary ApplicationLink of a particular ApplicationType. This method should be used when you are implementing an integration feature that requires just one remote entity, for example: determining which linked JIRA project to create an issue in, or which linked Confluence space to create a page in. Features that require all ApplicationLinks of a particular ApplicationType (like aggregating activity or searching) should use getApplicationLinks(Class).

Parameters:
type - an application type (e.g. "jira")
Returns:
the primary ApplicationLink of the specified type


Copyright © 2011 Atlassian. All Rights Reserved.