Package org.elasticsearch.rest
Class RestResponse
java.lang.Object
org.elasticsearch.rest.RestResponse
- Direct Known Subclasses:
BytesRestResponse
public abstract class RestResponse
extends java.lang.Object
-
Constructor Summary
Constructors Constructor Description RestResponse()
-
Method Summary
Modifier and Type Method Description void
addHeader(java.lang.String name, java.lang.String value)
Add a custom header.abstract BytesReference
content()
The response content.abstract java.lang.String
contentType()
The response content type.void
copyHeaders(ElasticsearchException ex)
java.util.Map<java.lang.String,java.util.List<java.lang.String>>
filterHeaders(java.util.Map<java.lang.String,java.util.List<java.lang.String>> headers)
java.util.Map<java.lang.String,java.util.List<java.lang.String>>
getHeaders()
Returns custom headers that have been added.abstract RestStatus
status()
The rest status code.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
RestResponse
public RestResponse()
-
-
Method Details
-
contentType
public abstract java.lang.String contentType()The response content type. -
content
The response content. Note, if the content isReleasable
it should automatically be released when done by the channel sending it. -
status
The rest status code. -
copyHeaders
-
addHeader
public void addHeader(java.lang.String name, java.lang.String value)Add a custom header. -
getHeaders
public java.util.Map<java.lang.String,java.util.List<java.lang.String>> getHeaders()Returns custom headers that have been added. This method should not be used to mutate headers. -
filterHeaders
public java.util.Map<java.lang.String,java.util.List<java.lang.String>> filterHeaders(java.util.Map<java.lang.String,java.util.List<java.lang.String>> headers)
-