Package com.google.gerrit.server.update
Class RetryingRestCollectionModifyView<P extends RestResource,C extends RestResource,I,O>
- java.lang.Object
-
- com.google.gerrit.server.update.RetryingRestCollectionModifyView<P,C,I,O>
-
- All Implemented Interfaces:
RestCollectionModifyView<P,C,I>,RestCollectionView<P,C,I>,RestView<C>
- Direct Known Subclasses:
CreateChange,PostReviewers
public abstract class RetryingRestCollectionModifyView<P extends RestResource,C extends RestResource,I,O> extends Object implements RestCollectionModifyView<P,C,I>
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedRetryingRestCollectionModifyView(RetryHelper retryHelper)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Response<O>apply(P parentResource, I input)Process the modification on the collection resource.protected abstract Response<O>applyImpl(BatchUpdate.Factory updateFactory, P parentResource, I input)
-
-
-
Constructor Detail
-
RetryingRestCollectionModifyView
protected RetryingRestCollectionModifyView(RetryHelper retryHelper)
-
-
Method Detail
-
apply
public final Response<O> apply(P parentResource, I input) throws AuthException, BadRequestException, ResourceConflictException, Exception
Description copied from interface:RestCollectionModifyViewProcess the modification on the collection resource.The value of the returned response is automatically converted to JSON unless it is a
BinaryResult.The returned response defines the status code that is returned to the client. For RestCollectionModifyViews this is usually
200 OK, but other 2XX or 3XX status codes are also possible (e.g.201 Createdif a resource was created,202 Acceptedif a background task was scheduled,204 No Contentif no content is returned,302 Foundfor a redirect).Throwing a subclass of
RestApiExceptionresults in a 4XX response to the client. For any other exception the client will get a500 Internal Server Errorresponse.- Specified by:
applyin interfaceRestCollectionModifyView<P extends RestResource,C extends RestResource,I>- Parameters:
parentResource- the collection resource on which the modification is done- Returns:
- response to return to the client
- Throws:
Exception- the implementation of the view failed. The exception will be logged and HTTP 500 Internal Server Error will be returned to the client.AuthExceptionBadRequestExceptionResourceConflictException
-
-