| 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.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
 | 
protected  LoggerWrapper | 
log
 | 
| Constructor Summary | |
|---|---|
AbstractResource()
 | 
|
| Method Summary | ||
|---|---|---|
 | 
check(ServiceOutcome<T> 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.  | 
|
 void | 
wireAuthenticationContext(com.atlassian.jira.security.JiraAuthenticationContext authenticationContext)
 | 
|
 void | 
wireI18nFactoryService(I18nFactoryService i18nFactoryService)
 | 
|
| Methods inherited from class java.lang.Object | 
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
protected final LoggerWrapper log
public static final java.lang.String HTTP_HEADER_GREENHOPPER_GADGET
| Constructor Detail | 
|---|
public AbstractResource()
| Method Detail | 
|---|
public void wireI18nFactoryService(I18nFactoryService i18nFactoryService)
public void wireAuthenticationContext(com.atlassian.jira.security.JiraAuthenticationContext authenticationContext)
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 <T> T check(ServiceOutcome<T> 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 | |||||||||