com.atlassian.applinks.api
Interface ReadOnlyApplicationLinkService


@ExperimentalApi
public interface ReadOnlyApplicationLinkService

Provides methods for retrieving ReadOnlyApplicationLinks representing linked applications (e.g. JIRA, Confluence, etc.). The usage of this service is encouraged over ApplicationLinkService, especially if the ApplicationLink's property set is not used at all. Also, there is no need to cache any retrieved application links for performance reasons. Simply query this service again.

Since:
4.0

Method Summary
 ReadOnlyApplicationLink getApplicationLink(ApplicationId applicationId)
          Retrieves an ReadOnlyApplicationLink by its ApplicationId.
 Iterable<ReadOnlyApplicationLink> getApplicationLinks()
          Retrieves all ReadOnlyApplicationLinks.
 Iterable<ReadOnlyApplicationLink> getApplicationLinks(Class<? extends ApplicationType> type)
          Retrieves all ReadOnlyApplicationLinks of a particular ApplicationType.
 ReadOnlyApplicationLink getPrimaryApplicationLink(Class<? extends ApplicationType> type)
          Retrieves the primary ReadOnlyApplicationLink of a particular ApplicationType.
 

Method Detail

getApplicationLinks

Iterable<ReadOnlyApplicationLink> getApplicationLinks()
Retrieves all ReadOnlyApplicationLinks.

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

getApplicationLink

@Nullable
ReadOnlyApplicationLink getApplicationLink(ApplicationId applicationId)
Retrieves an ReadOnlyApplicationLink by its ApplicationId. Use this method only if you know the ApplicationId of an existing ReadOnlyApplicationLink. 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:
applicationId - the ApplicationId of a stored ReadOnlyApplicationLink.
Returns:
the ReadOnlyApplicationLink specified by the id, or null if it does not exist

getApplicationLinks

Iterable<ReadOnlyApplicationLink> getApplicationLinks(Class<? extends ApplicationType> type)
Retrieves all ReadOnlyApplicationLinks of a particular ApplicationType.

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

getPrimaryApplicationLink

@Nullable
ReadOnlyApplicationLink getPrimaryApplicationLink(Class<? extends ApplicationType> type)
Retrieves the primary ReadOnlyApplicationLink 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 ReadOnlyApplicationLinks 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 © 2015 Atlassian. All rights reserved.