Class AbstractRemoteEntityLinkResource<S,T extends RemoteEntityLink<S>>

java.lang.Object
com.atlassian.jira.rest.v2.entity.AbstractRemoteEntityLinkResource<S,T>
Type Parameters:
S - the target entity (like Version)
T - the entity link type (like RemoteVersionLink)
Direct Known Subclasses:
RemoteVersionLinkResource

public abstract class AbstractRemoteEntityLinkResource<S,T extends RemoteEntityLink<S>> extends Object
Common toolkit for implementing remote entity link services.
Since:
Jira REST v6.5.1 (in Jira 6.1.1)
  • Field Details

    • i18n

      protected final I18nHelper i18n
    • jiraAuthenticationContext

      protected final JiraAuthenticationContext jiraAuthenticationContext
    • jsonEntityPropertyManager

      protected final JsonEntityPropertyManager jsonEntityPropertyManager
    • contextUriInfo

      protected final jakarta.ws.rs.core.UriInfo contextUriInfo
  • Constructor Details

  • Method Details

    • toBean

      protected RemoteEntityLinkJsonBean toBean(T link)
      Creates a JSON bean for the provided remote entity link.
      Parameters:
      link - the remote entity link to be written out
      Returns:
      the corresponding bean
    • toBean

      protected RemoteEntityLinksJsonBean toBean(Collection<? extends T> links)
      Creates a list of JSON beans for the provided remote entity links.
      Parameters:
      links - the remote entity links to be written out
      Returns:
      the corresponding bean
    • toResponse

      protected jakarta.ws.rs.core.Response toResponse(T link)
      Responds with a single remote entity link. This convenience method is equivalent to toResponse(toBean(link)).
      Parameters:
      link - the remote entity link to write
      Returns:
      a response containing the link
    • toResponse

      protected jakarta.ws.rs.core.Response toResponse(Collection<? extends T> links)
      Responds with a list of remote entity links. This convenience method is equivalent to toResponse(toBean(links)).
      Parameters:
      links - the remote entity links to be written out
      Returns:
      the response containing the links
    • toResponse

      protected jakarta.ws.rs.core.Response toResponse(Object entity)
      Turns a bean into an normal response object.
      Parameters:
      entity - the object to respond with
      Returns:
      the response
    • toSuccessfulPostResponse

      protected jakarta.ws.rs.core.Response toSuccessfulPostResponse(T link)
      Forms a 201 response with a Location: header pointing to link's self URI.
      Parameters:
      link - the newly created link
      Returns:
      the successful response
    • toSuccessfulDeleteResponse

      protected jakarta.ws.rs.core.Response toSuccessfulDeleteResponse()
      Forms a 204 response with no content to acknowledge the successful deletion.
      Returns:
      the successful response
    • createSelfLink

      protected abstract URI createSelfLink(T link)
      Forms the self URI for a link.
      Parameters:
      link - the link to be rendered as a URI
      Returns:
      the self URI for the link
    • valid

      protected <T extends ServiceResult> T valid(T result)
      Verifies that the provided service result is error-free. If it is invalid, then we throw the appropriate RESTException containing the error collection instead of returning the result.
      Type Parameters:
      T - the inferred service result class
      Parameters:
      result - the service result to validate
      Returns:
      result itself
    • getUser

      protected ApplicationUser getUser()
      Returns the currently logged in user.
      Returns:
      the currently logged in user.