Package org.elasticsearch.client
Class Response
- java.lang.Object
-
- org.elasticsearch.client.Response
-
public class Response extends Object
Holds an elasticsearch response. It wraps theHttpResponsereturned and associates it with its correspondingRequestLineandHttpHost.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HttpEntitygetEntity()Returns the response body available, null otherwiseStringgetHeader(String name)Returns the value of the first header with a specified name of this message.Header[]getHeaders()Returns all the response headersHttpHostgetHost()Returns the node that returned this responseRequestLinegetRequestLine()Returns the request line that generated this responseStatusLinegetStatusLine()Returns the status line of the current responseList<String>getWarnings()Returns a list of all warning headers returned in the response.booleanhasWarnings()Returns true if there is at least one warning header returned in the response.StringtoString()
-
-
-
Method Detail
-
getRequestLine
public RequestLine getRequestLine()
Returns the request line that generated this response
-
getHost
public HttpHost getHost()
Returns the node that returned this response
-
getStatusLine
public StatusLine getStatusLine()
Returns the status line of the current response
-
getHeaders
public Header[] getHeaders()
Returns all the response headers
-
getHeader
public String getHeader(String name)
Returns the value of the first header with a specified name of this message. If there is more than one matching header in the message the first element is returned. If there is no matching header in the messagenullis returned.
-
getEntity
public HttpEntity getEntity()
Returns the response body available, null otherwise- See Also:
HttpEntity
-
getWarnings
public List<String> getWarnings()
Returns a list of all warning headers returned in the response.
-
hasWarnings
public boolean hasWarnings()
Returns true if there is at least one warning header returned in the response.
-
-