Package org.elasticsearch.rest
Class BytesRestResponse
java.lang.Object
org.elasticsearch.rest.RestResponse
org.elasticsearch.rest.BytesRestResponse
public class BytesRestResponse extends RestResponse
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringTEXT_CONTENT_TYPE -
Constructor Summary
Constructors Constructor Description BytesRestResponse(RestChannel channel, java.lang.Exception e)BytesRestResponse(RestChannel channel, RestStatus status, java.lang.Exception e)BytesRestResponse(RestStatus status, java.lang.String content)Creates a new plain text response.BytesRestResponse(RestStatus status, java.lang.String contentType, byte[] content)Creates a binary response.BytesRestResponse(RestStatus status, java.lang.String contentType, java.lang.String content)Creates a new plain text response.BytesRestResponse(RestStatus status, java.lang.String contentType, BytesReference content)Creates a binary response.BytesRestResponse(RestStatus status, XContentBuilder builder)Creates a new response based onXContentBuilder. -
Method Summary
Modifier and Type Method Description BytesReferencecontent()The response content.java.lang.StringcontentType()The response content type.static ElasticsearchStatusExceptionerrorFromXContent(XContentParser parser)RestStatusstatus()The rest status code.
-
Field Details
-
TEXT_CONTENT_TYPE
public static final java.lang.String TEXT_CONTENT_TYPE- See Also:
- Constant Field Values
-
-
Constructor Details
-
BytesRestResponse
Creates a new response based onXContentBuilder. -
BytesRestResponse
Creates a new plain text response. -
BytesRestResponse
public BytesRestResponse(RestStatus status, java.lang.String contentType, java.lang.String content)Creates a new plain text response. -
BytesRestResponse
Creates a binary response. -
BytesRestResponse
Creates a binary response. -
BytesRestResponse
- Throws:
java.io.IOException
-
BytesRestResponse
public BytesRestResponse(RestChannel channel, RestStatus status, java.lang.Exception e) throws java.io.IOException- Throws:
java.io.IOException
-
-
Method Details
-
contentType
public java.lang.String 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
-
errorFromXContent
public static ElasticsearchStatusException errorFromXContent(XContentParser parser) throws java.io.IOException- Throws:
java.io.IOException
-