Class BytesRestResponse

java.lang.Object
org.elasticsearch.rest.RestResponse
org.elasticsearch.rest.BytesRestResponse

public class BytesRestResponse
extends RestResponse
  • Field Details

    • TEXT_CONTENT_TYPE

      public static final java.lang.String 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 on XContentBuilder.
    • BytesRestResponse

      public BytesRestResponse​(RestStatus status, java.lang.String content)
      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

      public BytesRestResponse​(RestStatus status, java.lang.String contentType, byte[] content)
      Creates a binary response.
    • BytesRestResponse

      public BytesRestResponse​(RestStatus status, java.lang.String contentType, BytesReference content)
      Creates a binary response.
    • BytesRestResponse

      public BytesRestResponse​(RestChannel channel, java.lang.Exception e) throws java.io.IOException
      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: RestResponse
      The response content type.
      Specified by:
      contentType in class RestResponse
    • content

      public BytesReference content()
      Description copied from class: RestResponse
      The response content. Note, if the content is Releasable it should automatically be released when done by the channel sending it.
      Specified by:
      content in class RestResponse
    • status

      public RestStatus status()
      Description copied from class: RestResponse
      The rest status code.
      Specified by:
      status in class RestResponse
    • skipStackTrace

      protected boolean skipStackTrace()
    • errorFromXContent

      public static ElasticsearchStatusException errorFromXContent​(org.elasticsearch.common.xcontent.XContentParser parser) throws java.io.IOException
      Throws:
      java.io.IOException