java.lang.Object
org.elasticsearch.rest.RestResponse
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Releasable
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionRestResponse
(RestChannel channel, Exception e) RestResponse
(RestChannel channel, RestStatus status, Exception e) RestResponse
(RestStatus status, String content) Creates a new plain text response.RestResponse
(RestStatus status, String responseMediaType, String content) Creates a new plain text response.RestResponse
(RestStatus status, String responseMediaType, BytesReference content) RestResponse
(RestStatus status, XContentBuilder builder) Creates a new response based onXContentBuilder
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a custom header.static RestResponse
chunked
(RestStatus restStatus, ChunkedRestResponseBodyPart content, Releasable releasable) void
close()
content()
void
filterHeaders
(Map<String, List<String>> headers) Returns custom headers that have been added.boolean
status()
-
Field Details
-
TEXT_CONTENT_TYPE
- See Also:
-
RESPONSE_PARAMS
-
-
Constructor Details
-
RestResponse
Creates a new response based onXContentBuilder
. -
RestResponse
Creates a new plain text response. -
RestResponse
Creates a new plain text response. -
RestResponse
-
RestResponse
- Throws:
IOException
-
RestResponse
- Throws:
IOException
-
-
Method Details
-
chunked
public static RestResponse chunked(RestStatus restStatus, ChunkedRestResponseBodyPart content, @Nullable Releasable releasable) -
contentType
-
content
-
chunkedContent
-
isChunked
public boolean isChunked() -
status
-
copyHeaders
-
addHeader
Add a custom header. -
getHeaders
Returns custom headers that have been added. This method should not be used to mutate headers. -
filterHeaders
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceReleasable
-