RestChannelpublic abstract class AbstractRestChannel extends java.lang.Object implements RestChannel
| Modifier and Type | Field | Description |
|---|---|---|
protected boolean |
detailedErrorsEnabled |
|
protected RestRequest |
request |
| Modifier | Constructor | Description |
|---|---|---|
protected |
AbstractRestChannel(RestRequest request,
boolean detailedErrorsEnabled) |
| Modifier and Type | Method | Description |
|---|---|---|
BytesStreamOutput |
bytesOutput() |
A channel level bytes output that can be reused.
|
protected BytesStreamOutput |
bytesOutputOrNull() |
An accessor to the raw value of the channel bytes output.
|
boolean |
detailedErrorsEnabled() |
|
XContentBuilder |
newBuilder() |
|
XContentBuilder |
newBuilder(XContentType requestContentType,
boolean useFiltering) |
Creates a new
XContentBuilder for a response to be sent using this channel. |
protected BytesStreamOutput |
newBytesOutput() |
|
XContentBuilder |
newErrorBuilder() |
|
RestRequest |
request() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsendResponseprotected final RestRequest request
protected final boolean detailedErrorsEnabled
protected AbstractRestChannel(RestRequest request, boolean detailedErrorsEnabled)
public XContentBuilder newBuilder() throws java.io.IOException
newBuilder in interface RestChanneljava.io.IOExceptionpublic XContentBuilder newErrorBuilder() throws java.io.IOException
newErrorBuilder in interface RestChanneljava.io.IOExceptionpublic XContentBuilder newBuilder(@Nullable XContentType requestContentType, boolean useFiltering) throws java.io.IOException
XContentBuilder for a response to be sent using this channel. The builder's type is determined by the following
logic. If the request has a format parameter that will be used to attempt to map to an XContentType. If there is no format
parameter, the HTTP Accept header is checked to see if it can be matched to a XContentType. If this first attempt to map
fails, the request content type will be used if the value is not null; if the value is null the output format falls
back to JSON.newBuilder in interface RestChanneljava.io.IOExceptionpublic final BytesStreamOutput bytesOutput()
newBytesOutput(). Once the stream is created, it gets reset on each
call to this method.bytesOutput in interface RestChannelprotected final BytesStreamOutput bytesOutputOrNull()
protected BytesStreamOutput newBytesOutput()
public RestRequest request()
request in interface RestChannelpublic boolean detailedErrorsEnabled()
detailedErrorsEnabled in interface RestChannel