Package com.atlassian.applinks.spi.link
Interface MutatingEntityLinkService
- All Superinterfaces:
EntityLinkService
- Since:
- 3.0
-
Method Summary
Modifier and TypeMethodDescriptionaddEntityLink(String localKey, Class<? extends EntityType> localType, EntityLink entityLink) Create anEntityLinkfrom an entity in the local application to an entity in the remote application.addReciprocatedEntityLink(String localKey, Class<? extends EntityType> localType, EntityLink entityLink) Create anEntityLinkfrom 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.booleandeleteEntityLink(String localKey, Class<? extends EntityType> localType, EntityLink entityLink) Delete anEntityLinkfrom an entity in the local application to an entity in the remote application.voidDelete allEntityLinks targeting entities in the application instance specified by the suppliedApplicationLinkbooleandeleteReciprocatedEntityLink(String localKey, Class<? extends EntityType> localType, EntityLink entityLink) Delete anEntityLinkfrom 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.getEntityLink(String localKey, Class<? extends EntityType> localType, String remoteKey, Class<? extends EntityType> remoteType, ApplicationId applicationId) Retrieve an existingEntityLinkthat links the specified local entity to the specified remote entity, or return null if no link matching linking the specified entities exists.getEntityLinksForApplicationLink(ApplicationLink applicationLink) Retrieves all configured entity links for a configured application link.getEntityLinksForKey(String localKey, Class<? extends EntityType> localType) Retrieves allEntityLinks from a local entity.getEntityLinksForKey(String localKey, Class<? extends EntityType> localType, Class<? extends EntityType> type) Retrieves allEntityLinks from a local entity, filtered by the target entity'sEntityType.getPrimaryEntityLinkForKey(String localKey, Class<? extends EntityType> localType, Class<? extends EntityType> type) makePrimary(String localKey, Class<? extends EntityType> localType, EntityLink entityLink) Make the specifiedEntityLinkthe primary link of itsEntityTypefor the specified local entityMethods inherited from interface com.atlassian.applinks.api.EntityLinkService
getEntityLinks, getEntityLinks, getPrimaryEntityLink
-
Method Details
-
addEntityLink
EntityLink addEntityLink(String localKey, Class<? extends EntityType> localType, EntityLink entityLink) Create anEntityLinkfrom 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- theClassof the local entityEntityTypeto create a link fromentityLink- anEntityLinkobject initialised with the details of the target entity in the remote application to link to. UseEntityLinkBuilderFactoryto create theEntityLinkobject.- Returns:
- the created
EntityLinkobject - See Also:
-
addReciprocatedEntityLink
EntityLink addReciprocatedEntityLink(String localKey, Class<? extends EntityType> localType, EntityLink entityLink) throws ReciprocalActionException, CredentialsRequiredException Create anEntityLinkfrom 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- theClassof the local entityEntityTypeto create a link fromentityLink- anEntityLinkobject initialised with the details of the target entity in the remote application to link to. UseEntityLinkBuilderFactoryto create theEntityLinkobject.- Returns:
- the created
EntityLinkobject - Throws:
CredentialsRequiredException- if the currently logged in user does not have credentials stored for the authenticator configured for the remote applicationReciprocalActionException- if the reciprocal link could not be created back from the remote application- See Also:
-
deleteEntityLink
boolean deleteEntityLink(String localKey, Class<? extends EntityType> localType, EntityLink entityLink) Delete anEntityLinkfrom 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- theClassof the local entityEntityTypethat is the source of the link to be deletedentityLink- anEntityLinkrepresenting the entity in the remote application that is the target of the link.- Returns:
- true if the link was successfully deleted, false otherwise
- See Also:
-
deleteReciprocatedEntityLink
boolean deleteReciprocatedEntityLink(String localKey, Class<? extends EntityType> localType, EntityLink entityLink) throws ReciprocalActionException, CredentialsRequiredException Delete anEntityLinkfrom 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- theClassof the local entityEntityTypethat is the source of the link to be deletedentityLink- anEntityLinkrepresenting 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 applicationReciprocalActionException- if the reciprocal link could not be deleted from the remote application- See Also:
-
deleteEntityLinksFor
Delete allEntityLinks targeting entities in the application instance specified by the suppliedApplicationLink- Parameters:
link- an establishedApplicationLink
-
makePrimary
EntityLink makePrimary(String localKey, Class<? extends EntityType> localType, EntityLink entityLink) Make the specifiedEntityLinkthe primary link of itsEntityTypefor 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- theClassof the local entityEntityTypethat is the source of the link to be deletedentityLink- anEntityLinkrepresenting the entity in the remote application that is the target of the link.- Returns:
- the supplied
EntityLink, with its primary status updated - See Also:
-
getEntityLink
EntityLink getEntityLink(String localKey, Class<? extends EntityType> localType, String remoteKey, Class<? extends EntityType> remoteType, ApplicationId applicationId) Retrieve an existingEntityLinkthat 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- theClassof the local entityEntityTypethat is the source of the link to be retrievedremoteKey- the key of the remote entity to that is the target of the link to be retrieved, for example "JRA", "CONF".remoteType- theClassof the remote entityEntityTypethat is the target of the link to be retrievedapplicationId- theApplicationIdof the application containing the entity that is the target of the link to be retrieved- Returns:
- the specified
EntityLinkif it exists, or null otherwise.
-
getEntityLinksForApplicationLink
Iterable<EntityLink> getEntityLinksForApplicationLink(ApplicationLink applicationLink) throws TypeNotInstalledException Retrieves all configured entity links for a configured application link.- Parameters:
applicationLink- an establishedApplicationLink, cannot be null.- Returns:
- all
EntityLinks for this application. - Throws:
TypeNotInstalledException- if the application type is not installed
-
getEntityLinksForKey
Iterable<EntityLink> getEntityLinksForKey(String localKey, Class<? extends EntityType> localType, Class<? extends EntityType> type) Retrieves allEntityLinks from a local entity, filtered by the target entity'sEntityType.- Parameters:
localKey- the key of a local entity to that is the source of the links to be retrieved, for example "JRA", "CONF".localType- theClassof the local entityEntityTypethat is the source of the links to betype- theClassof the remote entitiesEntityTypeto retrieve establishedEntityLinks for- Returns:
- an
IterablecontainingEntityLinks associated with the specified entity, of the specified type
-
getEntityLinksForKey
Retrieves allEntityLinks 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- theClassof the local entityEntityTypethat is the source of the links to be- Returns:
- an
IterablecontainingEntityLinks associated with the specified entity
-
getPrimaryEntityLinkForKey
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- theClassof the local entityEntityTypethat is the source of the linktype- the type ofEntityLinkto 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
-
getEntityLinkBuilderFactory
EntityLinkBuilderFactory getEntityLinkBuilderFactory()- Returns:
- an
EntityLinkBuilderFactoryfor creatingEntityLinks
-