Class AbstractRestResource
java.lang.Object
com.atlassian.jira.plugins.auditing.rest.AbstractRestResource
- Direct Known Subclasses:
AuditingRestResource
A base class to make REST resources more structured and supportable
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final JiraAuthenticationContext
protected final org.apache.log4j.Logger
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractRestResource
(JiraAuthenticationContext jiraAuthenticationContext) -
Method Summary
Modifier and TypeMethodDescriptionprotected jakarta.ws.rs.core.Response
badRequest
(String reasonKey) protected jakarta.ws.rs.core.Response
badRequest
(String reasonKey, ErrorCollection errorCollection) protected jakarta.ws.rs.core.Response
badRequest
(String reasonKey, String errorMessage) protected jakarta.ws.rs.core.Response
protected jakarta.ws.rs.core.Response
errorResponse
(String reasonKey, ErrorCollection errors) protected jakarta.ws.rs.core.Response
forbiddenRequest
(String reasonKey) protected jakarta.ws.rs.core.Response
forbiddenRequest
(String reasonKey, ErrorCollection errorCollection) protected jakarta.ws.rs.core.Response
forbiddenRequest
(String reasonKey, String errorMessage) protected ApplicationUser
protected String
i18n's textprotected boolean
protected jakarta.ws.rs.core.Response
protected jakarta.ws.rs.core.Response
notFoundRequest
(String reasonKey) protected jakarta.ws.rs.core.Response
notFoundRequest
(String reasonKey, ErrorCollection errorCollection) protected jakarta.ws.rs.core.Response
notFoundRequest
(String reasonKey, String errorMessage) protected jakarta.ws.rs.core.Response
protected jakarta.ws.rs.core.Response
protected jakarta.ws.rs.core.Response
Invokes the callable and returns the response but with extra logging support.protected jakarta.ws.rs.core.Response
unauthorizedRequest
(String reasonKey) protected jakarta.ws.rs.core.Response
unauthorizedRequest
(String reasonKey, ErrorCollection errorCollection) protected jakarta.ws.rs.core.Response
unauthorizedRequest
(String reasonKey, String errorMessage)
-
Field Details
-
log
protected final org.apache.log4j.Logger log -
jiraAuthenticationContext
-
-
Constructor Details
-
AbstractRestResource
-
-
Method Details
-
response
protected jakarta.ws.rs.core.Response response(Callable<jakarta.ws.rs.core.Response> responseCallable) Invokes the callable and returns the response but with extra logging support.- Parameters:
responseCallable
- the callable to invoke- Returns:
- the Response
-
isAnonymousUser
protected boolean isAnonymousUser()- Returns:
- true if the current user is anonymous
-
getLoggedInUser
- Returns:
- the currently logged in user or null if they are anonymous
-
getText
i18n's text -
noContent
protected jakarta.ws.rs.core.Response noContent()- Returns:
- a No Content response
-
ok
- Parameters:
result
- the result object to send back- Returns:
- a 200 OK response
-
created
- Returns:
- a 201 Created response
-
notModified
protected jakarta.ws.rs.core.Response notModified()- Returns:
- a 304 Not Modified
-
errorResponse
- Returns:
- Returns an error response using the reason stored inside the ErrorCollection
-
notFoundRequest
- Returns:
- Returns a NOT_FOUND response
-
notFoundRequest
- Returns:
- the NOT_FOUND response
-
notFoundRequest
protected jakarta.ws.rs.core.Response notFoundRequest(String reasonKey, ErrorCollection errorCollection) - Returns:
- Returns a NOT_FOUND response with errors from Jira
-
forbiddenRequest
- Returns:
- Returns a FORBIDDEN response
-
forbiddenRequest
- Returns:
- the FORBIDDEN response
-
forbiddenRequest
protected jakarta.ws.rs.core.Response forbiddenRequest(String reasonKey, ErrorCollection errorCollection) - Returns:
- the FORBIDDEN response with error messages from Jira
-
unauthorizedRequest
- Returns:
- an UNAUTHORIZED response
-
unauthorizedRequest
- Returns:
- the UNAUTHORIZED response
-
unauthorizedRequest
protected jakarta.ws.rs.core.Response unauthorizedRequest(String reasonKey, ErrorCollection errorCollection) - Returns:
- the UNAUTHORIZED response with error messages from Jira
-
badRequest
- Returns:
- the BAD_REQUEST response
-
badRequest
- Returns:
- the BAD_REQUEST response
-
badRequest
- Returns:
- the BAD_REQUEST response with error messages from Jira
-