com.pyxis.greenhopper.gadget
Class AbstractGadgetResource

java.lang.Object
  extended by com.pyxis.greenhopper.gadget.AbstractGadgetResource
Direct Known Subclasses:
CardViewGadgetResource, ChartDataResource, ContextResource, DaysRemainingResource, GreenHopperResource, ProgressBarGadgetResource, ProjectsResource, RapidViewGadgetResource, TaskBoardGadgetResource, TBMappingResource, VersionBoardResource, WatchedFieldsResource

public abstract class AbstractGadgetResource
extends java.lang.Object

Parent class of all resource classes. Provides helper methods to return error and validation responses


Field Summary
static java.lang.String PROJECT_PREFIX
           
 
Constructor Summary
AbstractGadgetResource()
           
 
Method Summary
protected  javax.ws.rs.core.Response createErrorResponse(java.util.Collection<ValidationError> errors)
           
protected  javax.ws.rs.core.Response createIndexingUnavailableResponse(java.lang.String message)
           
protected  javax.ws.rs.core.Response createOkResponse(java.lang.Object entity)
           
protected  javax.ws.rs.core.Response createValidationResponse(java.util.Collection<ValidationError> errors)
           
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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROJECT_PREFIX

public static final java.lang.String PROJECT_PREFIX
See Also:
Constant Field Values
Constructor Detail

AbstractGadgetResource

public AbstractGadgetResource()
Method Detail

response

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. JIRA as of 5.0 lose stuff when bad errors happen and this way any badness is captured into atlassian-greenhopper.log

Parameters:
responseCallable - a callable block of code
Returns:
the REST response from that callable block of code

createErrorResponse

protected javax.ws.rs.core.Response createErrorResponse(java.util.Collection<ValidationError> errors)

createIndexingUnavailableResponse

protected javax.ws.rs.core.Response createIndexingUnavailableResponse(java.lang.String message)

createValidationResponse

protected javax.ws.rs.core.Response createValidationResponse(java.util.Collection<ValidationError> errors)

createOkResponse

protected javax.ws.rs.core.Response createOkResponse(java.lang.Object entity)


Copyright © 2007-2014 Atlassian. All Rights Reserved.