public abstract class EntityCreatedObserver<E> extends Object implements rx.Observer<Void>
On success, a 201 CREATED response is built with the location header to indicate the URI of the new resource.
On failure, a 409 CONFLICT response is built if the exception indicates the resource already exists, otherwise a 500 SERVER ERROR reponse is built.
| Constructor and Description |
|---|
EntityCreatedObserver(javax.ws.rs.container.AsyncResponse asyncResponse,
URI location,
Class<E> alreadyExistsExceptionType,
Function<E,javax.ws.rs.core.Response> alreadyExistsResponseBuilder) |
| Modifier and Type | Method and Description |
|---|---|
void |
onCompleted() |
void |
onError(Throwable t) |
void |
onNext(Void aVoid) |
public EntityCreatedObserver(javax.ws.rs.container.AsyncResponse asyncResponse,
URI location,
Class<E> alreadyExistsExceptionType,
Function<E,javax.ws.rs.core.Response> alreadyExistsResponseBuilder)
asyncResponse - JAX-RS asynchronous response referencelocation - URI of the new resource if it is successfully createdalreadyExistsExceptionType - type of the exception indicating the resource already existsalreadyExistsResponseBuilder - a function to build a resource already exists responseCopyright © 2014–2016 Red Hat, Inc.. All rights reserved.