Interface MutatingEntityLinkService

All Superinterfaces:
EntityLinkService

public interface MutatingEntityLinkService extends EntityLinkService
Since:
3.0
  • Method Details

    • addEntityLink

      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:
      the created EntityLink object
      See Also:
    • addReciprocatedEntityLink

      EntityLink addReciprocatedEntityLink(String localKey, Class<? extends EntityType> localType, EntityLink entityLink) throws ReciprocalActionException, CredentialsRequiredException
      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:
      the created EntityLink object
      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
      See Also:
    • deleteEntityLink

      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
      See Also:
    • deleteReciprocatedEntityLink

      boolean deleteReciprocatedEntityLink(String localKey, Class<? extends EntityType> localType, EntityLink entityLink) throws ReciprocalActionException, CredentialsRequiredException
      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
      See Also:
    • deleteEntityLinksFor

      void deleteEntityLinksFor(ApplicationLink link)
      Delete all EntityLinks targeting entities in the application instance specified by the supplied ApplicationLink
      Parameters:
      link - an established ApplicationLink
    • makePrimary

      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
      See Also:
    • getEntityLink

      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.
    • getEntityLinksForApplicationLink

      Iterable<EntityLink> getEntityLinksForApplicationLink(ApplicationLink applicationLink) throws TypeNotInstalledException
      Retrieves all configured entity links for a configured application link.
      Parameters:
      applicationLink - an established ApplicationLink, 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 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
    • getEntityLinksForKey

      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:
      an Iterable containing EntityLinks 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 - 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
    • getEntityLinkBuilderFactory

      EntityLinkBuilderFactory getEntityLinkBuilderFactory()
      Returns:
      an EntityLinkBuilderFactory for creating EntityLinks