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.
 Iterable<ApplicationLink> getApplicationLinks()
          Retrieves all ApplicationLinks.
 Iterable<ApplicationLink> getApplicationLinks(Class<? extends ApplicationType> type)
          Retrieves all ApplicationLinks of a particular ApplicationType.
 ApplicationLink getPrimaryApplicationLink(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.

Note: if your code doesn't use the application link's property set, then ReadOnlyApplicationLinkService.getApplicationLink(ApplicationId) could offer a better performing alternative.

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

Iterable<ApplicationLink> getApplicationLinks()
Retrieves all ApplicationLinks. Note: if your code doesn't use the application link's property set, the ReadOnlyApplicationLinkService.getApplicationLinks() could offer a better performing alternative.

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

getApplicationLinks

Iterable<ApplicationLink> getApplicationLinks(Class<? extends ApplicationType> type)
Retrieves all ApplicationLinks of a particular ApplicationType. Note: if your code doesn't use the application link's property set, the ReadOnlyApplicationLinkService.getApplicationLinks(Class) could offer a better performing alternative.

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(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).

Note: if your code doesn't use the application link's property set, the ReadOnlyApplicationLinkService.getPrimaryApplicationLink(Class) could offer a better performing alternative.

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


Copyright © 2015 Atlassian. All rights reserved.