Class Response

java.lang.Object
org.elasticsearch.client.Response

public class Response
extends java.lang.Object
Holds an elasticsearch response. It wraps the HttpResponse returned and associates it with its corresponding RequestLine and HttpHost.
  • Method Summary

    Modifier and Type Method Description
    org.apache.http.HttpEntity getEntity()
    Returns the response body available, null otherwise
    java.lang.String getHeader​(java.lang.String name)
    Returns the value of the first header with a specified name of this message.
    org.apache.http.Header[] getHeaders()
    Returns all the response headers
    org.apache.http.HttpHost getHost()
    Returns the node that returned this response
    org.apache.http.RequestLine getRequestLine()
    Returns the request line that generated this response
    org.apache.http.StatusLine getStatusLine()
    Returns the status line of the current response
    java.util.List<java.lang.String> getWarnings()
    Returns a list of all warning headers returned in the response.
    boolean hasWarnings()
    Returns true if there is at least one warning header returned in the response.
    java.lang.String toString()  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • 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

      public java.lang.String getHeader​(java.lang.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 message null is returned.
    • getEntity

      public org.apache.http.HttpEntity getEntity()
      Returns the response body available, null otherwise
      See Also:
      HttpEntity
    • getWarnings

      public java.util.List<java.lang.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.
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object