Package org.elasticsearch.client
Class Response
java.lang.Object
org.elasticsearch.client.Response
Holds an elasticsearch response. It wraps the
HttpResponse
returned and associates it with
its corresponding RequestLine
and HttpHost
.-
Method Summary
Modifier and TypeMethodDescriptionorg.apache.http.HttpEntity
Returns the response body available, null otherwiseReturns the value of the first header with a specified name of this message.org.apache.http.Header[]
Returns all the response headersorg.apache.http.HttpHost
getHost()
Returns the node that returned this responseorg.apache.http.RequestLine
Returns the request line that generated this responseorg.apache.http.StatusLine
Returns the status line of the current responseReturns a list of all warning headers returned in the response.boolean
Returns true if there is at least one warning header returned in the response.toString()
-
Method Details
-
getRequestLine
public org.apache.http.RequestLine getRequestLine()Returns the request line that generated this response -
getHost
public org.apache.http.HttpHost getHost()Returns the node that returned this response -
getStatusLine
public org.apache.http.StatusLine getStatusLine()Returns the status line of the current response -
getHeaders
public org.apache.http.Header[] getHeaders()Returns all the response headers -
getHeader
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 messagenull
is returned. -
getEntity
public org.apache.http.HttpEntity getEntity()Returns the response body available, null otherwise- See Also:
-
HttpEntity
-
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. -
toString
-