public abstract class

AbstractRemoteEntityLinkResource

extends Object
java.lang.Object
   ↳ com.atlassian.jira.rest.v2.entity.AbstractRemoteEntityLinkResource<S, T extends com.atlassian.jira.entity.remotelink.RemoteEntityLink<S>>
Known Direct Subclasses

Class Overview

Common toolkit for implementing remote entity link services.

Summary

Fields
protected final ContextUriInfo contextUriInfo
protected final I18nHelper i18n
protected final JiraAuthenticationContext jiraAuthenticationContext
protected final JsonEntityPropertyManager jsonEntityPropertyManager
Protected Constructors
AbstractRemoteEntityLinkResource(I18nHelper i18n, JiraAuthenticationContext jiraAuthenticationContext, JsonEntityPropertyManager jsonEntityPropertyManager, ContextUriInfo contextUriInfo)
Protected Methods
abstract URI createSelfLink(T link)
Forms the self URI for a link.
ApplicationUser getUser()
Returns the currently logged in user.
RemoteEntityLinkJsonBean toBean(T link)
Creates a JSON bean for the provided remote entity link.
RemoteEntityLinksJsonBean toBean(Collection<? extends T> links)
Creates a list of JSON beans for the provided remote entity links.
Response toResponse(Object entity)
Turns a bean into an normal response object.
Response toResponse(T link)
Responds with a single remote entity link.
Response toResponse(Collection<? extends T> links)
Responds with a list of remote entity links.
Response toSuccessfulDeleteResponse()
Forms a 204 response with no content to acknowledge the successful deletion.
Response toSuccessfulPostResponse(T link)
Forms a 201 response with a Location: header pointing to link's self URI.
<T extends ServiceResult> T valid(T result)
Verifies that the provided service result is error-free.
[Expand]
Inherited Methods
From class java.lang.Object

Fields

protected final ContextUriInfo contextUriInfo

protected final I18nHelper i18n

protected final JiraAuthenticationContext jiraAuthenticationContext

protected final JsonEntityPropertyManager jsonEntityPropertyManager

Protected Constructors

protected AbstractRemoteEntityLinkResource (I18nHelper i18n, JiraAuthenticationContext jiraAuthenticationContext, JsonEntityPropertyManager jsonEntityPropertyManager, ContextUriInfo contextUriInfo)

Protected Methods

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

protected ApplicationUser getUser ()

Returns the currently logged in user.

Returns
  • the currently logged in user.

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

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

protected Response toResponse (Object entity)

Turns a bean into an normal response object.

Parameters
entity the object to respond with
Returns
  • the response

protected 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

protected 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

protected Response toSuccessfulDeleteResponse ()

Forms a 204 response with no content to acknowledge the successful deletion.

Returns
  • the successful response

protected 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

protected 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.

Parameters
result the service result to validate
Returns
  • result itself