java.lang.Object
org.elasticsearch.rest.RestResponse
org.elasticsearch.rest.BytesRestResponse
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionBytesRestResponse
(RestChannel channel, Exception e) BytesRestResponse
(RestChannel channel, RestStatus status, Exception e) BytesRestResponse
(RestStatus status, String content) Creates a new plain text response.BytesRestResponse
(RestStatus status, String responseMediaType, byte[] content) Creates a binary response.BytesRestResponse
(RestStatus status, String responseMediaType, String content) Creates a new plain text response.BytesRestResponse
(RestStatus status, String responseMediaType, BytesReference content) Creates a binary response.BytesRestResponse
(RestStatus status, XContentBuilder builder) Creates a new response based onXContentBuilder
. -
Method Summary
Modifier and TypeMethodDescriptioncontent()
The response content.The response content type.static ElasticsearchStatusException
errorFromXContent
(XContentParser parser) protected boolean
status()
The rest status code.Methods inherited from class org.elasticsearch.rest.RestResponse
addHeader, copyHeaders, filterHeaders, getHeaders
-
Field Details
-
TEXT_CONTENT_TYPE
- See Also:
-
-
Constructor Details
-
BytesRestResponse
Creates a new response based onXContentBuilder
. -
BytesRestResponse
Creates a new plain text response. -
BytesRestResponse
Creates a new plain text response. -
BytesRestResponse
Creates a binary response. -
BytesRestResponse
Creates a binary response. -
BytesRestResponse
- Throws:
IOException
-
BytesRestResponse
- Throws:
IOException
-
-
Method Details
-
contentType
Description copied from class:RestResponse
The response content type.- Specified by:
contentType
in classRestResponse
-
content
Description copied from class:RestResponse
The response content. Note, if the content isReleasable
it should automatically be released when done by the channel sending it.- Specified by:
content
in classRestResponse
-
status
Description copied from class:RestResponse
The rest status code.- Specified by:
status
in classRestResponse
-
skipStackTrace
protected boolean skipStackTrace() -
errorFromXContent
public static ElasticsearchStatusException errorFromXContent(XContentParser parser) throws IOException - Throws:
IOException
-