|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.greenhopper.global.AbstractLoggable com.atlassian.greenhopper.web.AbstractResource
public abstract class AbstractResource
To be extended by all GreenHopper rest resources. Provides no-cache logic.
Field Summary | |
---|---|
static java.lang.String |
HTTP_HEADER_GREENHOPPER_GADGET
|
Fields inherited from class com.atlassian.greenhopper.global.AbstractLoggable |
---|
logger |
Constructor Summary | |
---|---|
AbstractResource()
|
Method Summary | ||
---|---|---|
void |
check(ServiceOutcome<?> outcome)
Check this outcome for errors. |
|
javax.ws.rs.core.Response |
createErrorResponse(ErrorCollection errors)
Deprecated. |
|
javax.ws.rs.core.Response |
createFromServiceOutcome(ServiceOutcome<? extends RestTemplate> outcome)
Deprecated. |
|
javax.ws.rs.core.Response |
createNoContentResponse()
|
|
javax.ws.rs.core.Response |
createOkResponse(RestTemplate entity)
Returns an ok response with NO_CACHE headers applied to it. |
|
javax.ws.rs.core.Response |
createOkResponse(RestTemplate template,
javax.ws.rs.core.EntityTag eTag)
Creates an ok response including an etag. |
|
protected com.atlassian.crowd.embedded.api.User |
getUser()
|
|
protected boolean |
isGadgetRequest()
Is this request for rendering a gadget? GH.Ajax.get() puts in a special header if sending ajax requests for gadgets. |
|
protected
|
nullSafe(java.util.Set<T> set)
Used for converting sets created by Jersey. |
|
protected javax.ws.rs.core.Response |
response(java.util.concurrent.Callable<javax.ws.rs.core.Response> responseCallable)
A standard way to invoke a REST resource and handle errors that might be throw. |
Methods inherited from class com.atlassian.greenhopper.global.AbstractLoggable |
---|
logDebug, logError, logException, logInfo, logTrace, logWarn, setInfoLogLevel |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String HTTP_HEADER_GREENHOPPER_GADGET
Constructor Detail |
---|
public AbstractResource()
Method Detail |
---|
protected javax.ws.rs.core.Response response(java.util.concurrent.Callable<javax.ws.rs.core.Response> responseCallable)
responseCallable
- a callable block of code
public javax.ws.rs.core.Response createOkResponse(RestTemplate entity)
entity
- the returned rest template
public javax.ws.rs.core.Response createOkResponse(RestTemplate template, javax.ws.rs.core.EntityTag eTag)
template
- the template to usedeTag
- an entity tag
public javax.ws.rs.core.Response createNoContentResponse()
@Deprecated public javax.ws.rs.core.Response createFromServiceOutcome(ServiceOutcome<? extends RestTemplate> outcome)
@Deprecated public javax.ws.rs.core.Response createErrorResponse(ErrorCollection errors)
public void check(ServiceOutcome<?> outcome)
ErrorCollection.checkErrors(com.atlassian.greenhopper.model.I18n2)
,
which will throw some REST exceptions.
outcome
- the outcome to checkprotected <T> java.util.Set<T> nullSafe(java.util.Set<T> set)
set
- that cant be null
protected com.atlassian.crowd.embedded.api.User getUser()
protected boolean isGadgetRequest()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |