|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.jira.rest.v2.entity.AbstractRemoteEntityLinkResource<S,T>
S
- the target entity (like Version
)T
- the entity link type (like RemoteVersionLink
)public abstract class AbstractRemoteEntityLinkResource<S,T extends RemoteEntityLink<S>>
Common toolkit for implementing remote entity link services.
Field Summary | |
---|---|
protected ContextUriInfo |
contextUriInfo
|
protected I18nHelper |
i18n
|
protected JiraAuthenticationContext |
jiraAuthenticationContext
|
protected JsonEntityPropertyManager |
jsonEntityPropertyManager
|
Constructor Summary | |
---|---|
protected |
AbstractRemoteEntityLinkResource(I18nHelper i18n,
JiraAuthenticationContext jiraAuthenticationContext,
JsonEntityPropertyManager jsonEntityPropertyManager,
ContextUriInfo contextUriInfo)
|
Method Summary | ||
---|---|---|
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
|
valid(T result)
Verifies that the provided service result is error-free. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final I18nHelper i18n
protected final JiraAuthenticationContext jiraAuthenticationContext
protected final JsonEntityPropertyManager jsonEntityPropertyManager
protected final ContextUriInfo contextUriInfo
Constructor Detail |
---|
protected AbstractRemoteEntityLinkResource(I18nHelper i18n, JiraAuthenticationContext jiraAuthenticationContext, JsonEntityPropertyManager jsonEntityPropertyManager, ContextUriInfo contextUriInfo)
Method Detail |
---|
protected RemoteEntityLinkJsonBean toBean(T link)
link
- the remote entity link to be written out
protected RemoteEntityLinksJsonBean toBean(Collection<? extends T> links)
links
- the remote entity links to be written out
protected javax.ws.rs.core.Response toResponse(T link)
toResponse
(toBean
(link)).
link
- the remote entity link to write
protected javax.ws.rs.core.Response toResponse(Collection<? extends T> links)
toResponse
(toBean
(links)).
links
- the remote entity links to be written out
protected javax.ws.rs.core.Response toResponse(Object entity)
entity
- the object to respond with
protected javax.ws.rs.core.Response toSuccessfulPostResponse(T link)
201
response with a Location:
header pointing to link
's self URI.
link
- the newly created link
protected 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 URI
protected <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 validate
result
itselfprotected ApplicationUser getUser()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |