Package org.elasticsearch.rest
Class BytesRestResponse
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 contentType, byte[] content)Creates a binary response.BytesRestResponse(RestStatus status, String contentType, String content)Creates a new plain text response.BytesRestResponse(RestStatus status, String contentType, BytesReference content)Creates a binary response.BytesRestResponse(RestStatus status, org.elasticsearch.common.xcontent.XContentBuilder builder)Creates a new response based onXContentBuilder. -
Method Summary
Modifier and TypeMethodDescriptioncontent()The response content.The response content type.static ElasticsearchStatusExceptionerrorFromXContent(org.elasticsearch.common.xcontent.XContentParser parser)protected booleanstatus()The rest status code.Methods inherited from class org.elasticsearch.rest.RestResponse
addHeader, copyHeaders, filterHeaders, getHeaders
-
Field Details
-
TEXT_CONTENT_TYPE
- See Also:
- Constant Field Values
-
-
Constructor Details
-
BytesRestResponse
public BytesRestResponse(RestStatus status, org.elasticsearch.common.xcontent.XContentBuilder builder)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:RestResponseThe response content type.- Specified by:
contentTypein classRestResponse
-
content
Description copied from class:RestResponseThe response content. Note, if the content isReleasableit should automatically be released when done by the channel sending it.- Specified by:
contentin classRestResponse
-
status
Description copied from class:RestResponseThe rest status code.- Specified by:
statusin classRestResponse
-
skipStackTrace
protected boolean skipStackTrace() -
errorFromXContent
public static ElasticsearchStatusException errorFromXContent(org.elasticsearch.common.xcontent.XContentParser parser) throws IOException- Throws:
IOException
-