com.atlassian.jira.gadgets.system
Class AbstractResource
java.lang.Object
com.atlassian.jira.gadgets.system.AbstractResource
- Direct Known Subclasses:
- BugzillaIdSearchResource, FavouriteFiltersResource, IssueTableResource, ProjectGadgetResource, RoadMapResource, SearchQueryBackedResource
public abstract class AbstractResource
- extends Object
Lightweight optional convenience base class for REST end points with commonly used methods.
- Since:
- v4.0
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractResource
public AbstractResource()
createErrorResponse
protected javax.ws.rs.core.Response createErrorResponse(Collection<com.atlassian.jira.rest.v1.model.errors.ValidationError> errors)
- Creates an error response using the given errors.
- Parameters:
errors
- the errors to use for the error response. Should not be empty.
- Returns:
- the error response.
createIndexingUnavailableResponse
protected javax.ws.rs.core.Response createIndexingUnavailableResponse(String message)
createValidationResponse
protected javax.ws.rs.core.Response createValidationResponse(Collection<com.atlassian.jira.rest.v1.model.errors.ValidationError> errors)
- Creates a response based on the given errors. If there are no errors, the response will be NO_CONTENT (204). If there are
errors, these will be used to return an error response. Many REST validate methods need to first build up a
possibly empty collection of
ValidationError
and then just return
the result of calling this method.
- Parameters:
errors
- the possibly empty collection of errors.
- Returns:
- a success response if the errors are empty, otherwise an error response based on these errors.
Copyright © 2002-2013 Atlassian. All Rights Reserved.