Package 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
Modifier and TypeMethodDescriptiongetApplicationLink(ApplicationId applicationId) Retrieves anReadOnlyApplicationLinkby itsApplicationId.Retrieves allReadOnlyApplicationLinks.getApplicationLinks(Class<? extends ApplicationType> type) Retrieves allReadOnlyApplicationLinks of a particularApplicationType.getPrimaryApplicationLink(Class<? extends ApplicationType> type) Retrieves the primaryReadOnlyApplicationLinkof a particularApplicationType.
-
Method Details
-
getApplicationLinks
Iterable<ReadOnlyApplicationLink> getApplicationLinks()Retrieves allReadOnlyApplicationLinks.- Returns:
- an
Iterableof storedReadOnlyApplicationLinks, of allApplicationTypes.
-
getApplicationLink
Retrieves anReadOnlyApplicationLinkby itsApplicationId. Use this method only if you know theApplicationIdof an existingReadOnlyApplicationLink. If you storing anApplicationIdfor future look-ups using this method, you should listen for theApplicationLinksIDChangedEventto ensure your storedApplicationIdis kept current.- Parameters:
applicationId- theApplicationIdof a storedReadOnlyApplicationLink.- Returns:
- the
ReadOnlyApplicationLinkspecified by the id, ornullif it does not exist
-
getApplicationLinks
Retrieves allReadOnlyApplicationLinks of a particularApplicationType.- Parameters:
type- theClassof theApplicationTypes to return- Returns:
- an
Iterablecontaining all storedReadOnlyApplicationLinks of the specified type. The primaryReadOnlyApplicationLinkis the first link in the list.
-
getPrimaryApplicationLink
Retrieves the primaryReadOnlyApplicationLinkof a particularApplicationType. 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 allReadOnlyApplicationLinks of a particularApplicationType(like aggregating activity or searching) should usegetApplicationLinks(Class).- Parameters:
type- an application type (e.g. "jira")- Returns:
- the primary
ApplicationLinkof the specified type
-