public class RestStatusToXContentListener<Response extends StatusToXContent> extends RestResponseListener<Response>
RestStatus
from the response.channel
Constructor and Description |
---|
RestStatusToXContentListener(RestChannel channel)
Build an instance that doesn't support responses with the status
201 CREATED . |
RestStatusToXContentListener(RestChannel channel,
java.util.function.Function<Response,java.lang.String> extractLocation)
Build an instance that does support responses with the status
201 CREATED . |
Modifier and Type | Method and Description |
---|---|
RestResponse |
buildResponse(Response response)
Builds the response to send back through the channel.
|
RestResponse |
buildResponse(Response response,
XContentBuilder builder) |
processResponse
onFailure, onResponse
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
wrap
public RestStatusToXContentListener(RestChannel channel)
201 CREATED
.public RestStatusToXContentListener(RestChannel channel, java.util.function.Function<Response,java.lang.String> extractLocation)
201 CREATED
.public final RestResponse buildResponse(Response response) throws java.lang.Exception
RestResponseListener
buildResponse
in class RestResponseListener<Response extends StatusToXContent>
java.lang.Exception
public final RestResponse buildResponse(Response response, XContentBuilder builder) throws java.lang.Exception
java.lang.Exception