org.elasticsearch.rest
Class Utf8RestResponse

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

public class Utf8RestResponse
extends AbstractRestResponse
implements RestResponse

An http response that is built on top of UnicodeUtil.UTF8Result.

Note, this class assumes that the utf8 result is not thread safe.


Field Summary
static org.apache.lucene.util.UnicodeUtil.UTF8Result EMPTY
           
 
Constructor Summary
Utf8RestResponse(RestStatus status)
           
Utf8RestResponse(RestStatus status, org.apache.lucene.util.UnicodeUtil.UTF8Result utf8Result)
           
Utf8RestResponse(RestStatus status, org.apache.lucene.util.UnicodeUtil.UTF8Result utf8Result, org.apache.lucene.util.UnicodeUtil.UTF8Result prefixUtf8Result, org.apache.lucene.util.UnicodeUtil.UTF8Result suffixUtf8Result)
           
 
Method Summary
 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
 

Field Detail

EMPTY

public static final org.apache.lucene.util.UnicodeUtil.UTF8Result EMPTY
Constructor Detail

Utf8RestResponse

public Utf8RestResponse(RestStatus status)

Utf8RestResponse

public Utf8RestResponse(RestStatus status,
                        org.apache.lucene.util.UnicodeUtil.UTF8Result utf8Result)

Utf8RestResponse

public Utf8RestResponse(RestStatus status,
                        org.apache.lucene.util.UnicodeUtil.UTF8Result utf8Result,
                        org.apache.lucene.util.UnicodeUtil.UTF8Result prefixUtf8Result,
                        org.apache.lucene.util.UnicodeUtil.UTF8Result suffixUtf8Result)
Method Detail

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).

Specified by:
contentThreadSafe in interface RestResponse

contentType

public String contentType()
Specified by:
contentType in interface RestResponse

content

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

Specified by:
content in interface RestResponse

contentLength

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

Specified by:
contentLength in interface RestResponse

status

public RestStatus status()
Specified by:
status in interface RestResponse

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.