public interface

MutatingEntityLinkService

implements EntityLinkService
com.atlassian.applinks.spi.link.MutatingEntityLinkService
Known Indirect Subclasses

Summary

Public Methods
abstract EntityLink addEntityLink(String localKey, Class<? extends EntityType> localType, EntityLink entityLink)
Create an EntityLink from an entity in the local application to an entity in the remote application.
abstract EntityLink addReciprocatedEntityLink(String localKey, Class<? extends EntityType> localType, EntityLink entityLink)
Create an EntityLink from an entity in the local application to an entity in the remote application, and a reciprocal link from the entity in the remote application back to the local entity.
abstract boolean deleteEntityLink(String localKey, Class<? extends EntityType> localType, EntityLink entityLink)
Delete an EntityLink from an entity in the local application to an entity in the remote application.
abstract void deleteEntityLinksFor(ApplicationLink link)
Delete all EntityLinks targeting entities in the application instance specified by the supplied ApplicationLink
abstract boolean deleteReciprocatedEntityLink(String localKey, Class<? extends EntityType> localType, EntityLink entityLink)
Delete an EntityLink from an entity in the local application to an entity in the remote application after first deleting the reciprocal link from the entity in the remote application back to the local entity.
abstract EntityLink getEntityLink(String localKey, Class<? extends EntityType> localType, String remoteKey, Class<? extends EntityType> remoteType, ApplicationId applicationId)
Retrieve an existing EntityLink that links the specified local entity to the specified remote entity, or return null if no link matching linking the specified entities exists.
abstract EntityLinkBuilderFactory getEntityLinkBuilderFactory()
abstract Iterable<EntityLink> getEntityLinksForApplicationLink(ApplicationLink applicationLink)
Retrieves all configured entity links for a configured application link.
abstract Iterable<EntityLink> getEntityLinksForKey(String localKey, Class<? extends EntityType> localType)
Retrieves all EntityLinks from a local entity.
abstract Iterable<EntityLink> getEntityLinksForKey(String localKey, Class<? extends EntityType> localType, Class<? extends EntityType> type)
Retrieves all EntityLinks from a local entity, filtered by the target entity's EntityType.
abstract EntityLink getPrimaryEntityLinkForKey(String localKey, Class<? extends EntityType> localType, Class<? extends EntityType> type)
abstract EntityLink makePrimary(String localKey, Class<? extends EntityType> localType, EntityLink entityLink)
Make the specified EntityLink the primary link of its EntityType for the specified local entity
[Expand]
Inherited Methods
From interface com.atlassian.applinks.api.EntityLinkService

Public Methods

public abstract EntityLink addEntityLink (String localKey, Class<? extends EntityType> localType, EntityLink entityLink)

Create an EntityLink from an entity in the local application to an entity in the remote application.

Parameters
localKey the key of a local entity to create a link from (JIRA project, Confluence space, etc.), for example "JRA", "CONF".
localType the Class of the local entity EntityType to create a link from
entityLink an EntityLink object initialised with the details of the target entity in the remote application to link to. Use EntityLinkBuilderFactory to create the EntityLink object.
Returns

public abstract EntityLink addReciprocatedEntityLink (String localKey, Class<? extends EntityType> localType, EntityLink entityLink)

Create an EntityLink from an entity in the local application to an entity in the remote application, and a reciprocal link from the entity in the remote application back to the local entity. Note that the local outgoing entity link will not be created if the link back from the remote application can not be established for any reason.

Parameters
localKey the key of a local entity to create a link from (JIRA project, Confluence space, etc.), for example "JRA", "CONF".
localType the Class of the local entity EntityType to create a link from
entityLink an EntityLink object initialised with the details of the target entity in the remote application to link to. Use EntityLinkBuilderFactory to create the EntityLink object.
Returns
Throws
CredentialsRequiredException if the currently logged in user does not have credentials stored for the authenticator configured for the remote application
ReciprocalActionException if the reciprocal link could not be created back from the remote application

public abstract boolean deleteEntityLink (String localKey, Class<? extends EntityType> localType, EntityLink entityLink)

Delete an EntityLink from an entity in the local application to an entity in the remote application.

Parameters
localKey the key of a local entity to that is the source of the link to be deleted, for example "JRA", "CONF".
localType the Class of the local entity EntityType that is the source of the link to be deleted
entityLink an EntityLink representing the entity in the remote application that is the target of the link.
Returns
  • true if the link was successfully deleted, false otherwise

public abstract void deleteEntityLinksFor (ApplicationLink link)

Delete all EntityLinks targeting entities in the application instance specified by the supplied ApplicationLink

Parameters
link an established ApplicationLink

public abstract boolean deleteReciprocatedEntityLink (String localKey, Class<? extends EntityType> localType, EntityLink entityLink)

Delete an EntityLink from an entity in the local application to an entity in the remote application after first deleting the reciprocal link from the entity in the remote application back to the local entity. Note that the local outgoing entity link will not be deleted if the link back from the remote application could not be deleted for any reason.

Parameters
localKey the key of a local entity to that is the source of the link to be deleted, for example "JRA", "CONF".
localType the Class of the local entity EntityType that is the source of the link to be deleted
entityLink an EntityLink representing the entity in the remote application that is the target of the link.
Returns
  • true if the link was successfully deleted, false otherwise
Throws
CredentialsRequiredException if the currently logged in user does not have credentials stored for the authenticator configured for the remote application
ReciprocalActionException if the reciprocal link could not be deleted from the remote application

public abstract EntityLink getEntityLink (String localKey, Class<? extends EntityType> localType, String remoteKey, Class<? extends EntityType> remoteType, ApplicationId applicationId)

Retrieve an existing EntityLink that links the specified local entity to the specified remote entity, or return null if no link matching linking the specified entities exists.

Parameters
localKey the key of a local entity to that is the source of the link to be retrieved, for example "JRA", "CONF".
localType the Class of the local entity EntityType that is the source of the link to be retrieved
remoteKey the key of the remote entity to that is the target of the link to be retrieved, for example "JRA", "CONF".
remoteType the Class of the remote entity EntityType that is the target of the link to be retrieved
applicationId the ApplicationId of the application containing the entity that is the target of the link to be retrieved
Returns
  • the specified EntityLink if it exists, or null otherwise.

public abstract EntityLinkBuilderFactory getEntityLinkBuilderFactory ()

Returns

public abstract Iterable<EntityLink> getEntityLinksForApplicationLink (ApplicationLink applicationLink)

Retrieves all configured entity links for a configured application link.

Parameters
applicationLink an established ApplicationLink, cannot be null.
Returns
Throws
TypeNotInstalledException if the application type is not installed

public abstract Iterable<EntityLink> getEntityLinksForKey (String localKey, Class<? extends EntityType> localType)

Retrieves all EntityLinks from a local entity.

Parameters
localKey the key of a local entity to that is the source of the links to be retrieved, for example "JRA", "CONF".
localType the Class of the local entity EntityType that is the source of the links to be
Returns

public abstract Iterable<EntityLink> getEntityLinksForKey (String localKey, Class<? extends EntityType> localType, Class<? extends EntityType> type)

Retrieves all EntityLinks from a local entity, filtered by the target entity's EntityType.

Parameters
localKey the key of a local entity to that is the source of the links to be retrieved, for example "JRA", "CONF".
localType the Class of the local entity EntityType that is the source of the links to be
type the Class of the remote entities EntityType to retrieve established EntityLinks for
Returns
  • an Iterable containing EntityLinks associated with the specified entity, of the specified type

public abstract EntityLink getPrimaryEntityLinkForKey (String localKey, Class<? extends EntityType> localType, Class<? extends EntityType> type)

Parameters
localKey the key of an entity local to this application, for which to retrieve a link for (e.g. JRA, CONF)
localType the Class of the local entity EntityType that is the source of the link
type the type of EntityLink to retrieve (e.g. fisheye-repository)
Returns
  • the primary entity link of the specified type, or null if no remote entities of the specified type have been linked

public abstract EntityLink makePrimary (String localKey, Class<? extends EntityType> localType, EntityLink entityLink)

Make the specified EntityLink the primary link of its EntityType for the specified local entity

Parameters
localKey the key of a local entity to that is the source of the link to be deleted, for example "JRA", "CONF".
localType the Class of the local entity EntityType that is the source of the link to be deleted
entityLink an EntityLink representing the entity in the remote application that is the target of the link.
Returns
  • the supplied EntityLink, with its primary status updated