S
- the target entity (like Version
)T
- the entity link type (like RemoteVersionLink
)public abstract class AbstractRemoteEntityLinkResource<S,T extends RemoteEntityLink<S>> extends Object
Modifier and Type | Field and Description |
---|---|
protected ContextUriInfo |
contextUriInfo |
protected I18nHelper |
i18n |
protected JiraAuthenticationContext |
jiraAuthenticationContext |
protected JsonEntityPropertyManager |
jsonEntityPropertyManager |
Modifier | Constructor and Description |
---|---|
protected |
AbstractRemoteEntityLinkResource(I18nHelper i18n,
JiraAuthenticationContext jiraAuthenticationContext,
JsonEntityPropertyManager jsonEntityPropertyManager,
ContextUriInfo contextUriInfo) |
Modifier and Type | Method and Description |
---|---|
protected abstract URI |
createSelfLink(T link)
Forms the
self URI for a link. |
protected ApplicationUser |
getUser()
Returns the currently logged in user.
|
protected RemoteEntityLinksJsonBean |
toBean(Collection<? extends T> links)
Creates a list of JSON beans for the provided remote entity links.
|
protected RemoteEntityLinkJsonBean |
toBean(T link)
Creates a JSON bean for the provided remote entity link.
|
protected javax.ws.rs.core.Response |
toResponse(Collection<? extends T> links)
Responds with a list of remote entity links.
|
protected javax.ws.rs.core.Response |
toResponse(Object entity)
Turns a bean into an normal response object.
|
protected javax.ws.rs.core.Response |
toResponse(T link)
Responds with a single remote entity link.
|
protected javax.ws.rs.core.Response |
toSuccessfulDeleteResponse()
Forms a
204 response with no content to acknowledge the successful deletion. |
protected javax.ws.rs.core.Response |
toSuccessfulPostResponse(T link)
Forms a
201 response with a Location: header pointing to link 's self URI. |
protected <T extends ServiceResult> |
valid(T result)
Verifies that the provided service result is error-free.
|
protected final I18nHelper i18n
protected final JiraAuthenticationContext jiraAuthenticationContext
protected final JsonEntityPropertyManager jsonEntityPropertyManager
protected final ContextUriInfo contextUriInfo
protected AbstractRemoteEntityLinkResource(I18nHelper i18n, JiraAuthenticationContext jiraAuthenticationContext, JsonEntityPropertyManager jsonEntityPropertyManager, ContextUriInfo contextUriInfo)
protected RemoteEntityLinkJsonBean toBean(T link)
link
- the remote entity link to be written outprotected RemoteEntityLinksJsonBean toBean(Collection<? extends T> links)
links
- the remote entity links to be written outprotected javax.ws.rs.core.Response toResponse(T link)
toResponse
(toBean
(link)).link
- the remote entity link to writeprotected javax.ws.rs.core.Response toResponse(Collection<? extends T> links)
toResponse
(toBean
(links)).links
- the remote entity links to be written outprotected javax.ws.rs.core.Response toResponse(Object entity)
entity
- the object to respond withprotected javax.ws.rs.core.Response toSuccessfulPostResponse(T link)
201
response with a Location:
header pointing to link
's self URI.link
- the newly created linkprotected javax.ws.rs.core.Response toSuccessfulDeleteResponse()
204
response with no content to acknowledge the successful deletion.protected abstract URI createSelfLink(T link)
self
URI for a link.link
- the link to be rendered as a URIprotected <T extends ServiceResult> T valid(T result)
RESTException
containing the error collection instead of returning
the result.T
- the inferred service result classresult
- the service result to validateresult
itselfprotected ApplicationUser getUser()
Copyright © 2002-2021 Atlassian. All Rights Reserved.