org.elasticsearch.rest
Class XContentRestResponse

java.lang.Object
  extended by org.elasticsearch.rest.AbstractRestResponse
      extended by org.elasticsearch.rest.XContentRestResponse
All Implemented Interfaces:
RestResponse
Direct Known Subclasses:
XContentThrowableRestResponse

public class XContentRestResponse
extends AbstractRestResponse


Constructor Summary
XContentRestResponse(RestRequest request, RestStatus status, XContentBuilder builder)
           
 
Method Summary
 XContentBuilder builder()
           
 byte[] content()
          Returns the actual content.
 int contentLength()
          The content length.
 boolean contentThreadSafe()
          Can the content byte[] be used only with this thread (false), or by any thread (true).
 String contentType()
           
 byte[] prefixContent()
           
 int prefixContentLength()
           
 RestStatus status()
           
 byte[] suffixContent()
           
 int suffixContentLength()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XContentRestResponse

public XContentRestResponse(RestRequest request,
                            RestStatus status,
                            XContentBuilder builder)
                     throws IOException
Throws:
IOException
Method Detail

builder

public XContentBuilder builder()

contentType

public String contentType()

contentThreadSafe

public boolean contentThreadSafe()
Description copied from interface: RestResponse
Can the content byte[] be used only with this thread (false), or by any thread (true).


content

public byte[] content()
               throws IOException
Description copied from interface: RestResponse
Returns the actual content. Note, use RestResponse.contentLength() in order to know the content length of the byte array.

Throws:
IOException

contentLength

public int contentLength()
                  throws IOException
Description copied from interface: RestResponse
The content length.

Throws:
IOException

status

public RestStatus status()

prefixContent

public byte[] prefixContent()
Specified by:
prefixContent in interface RestResponse
Overrides:
prefixContent in class AbstractRestResponse

prefixContentLength

public int prefixContentLength()
Specified by:
prefixContentLength in interface RestResponse
Overrides:
prefixContentLength in class AbstractRestResponse

suffixContent

public byte[] suffixContent()
Specified by:
suffixContent in interface RestResponse
Overrides:
suffixContent in class AbstractRestResponse

suffixContentLength

public int suffixContentLength()
Specified by:
suffixContentLength in interface RestResponse
Overrides:
suffixContentLength in class AbstractRestResponse


Copyright © 2009-2012. All Rights Reserved.