org.apache.kafka.clients
Class ClientResponse

java.lang.Object
  extended by org.apache.kafka.clients.ClientResponse

public class ClientResponse
extends java.lang.Object

A response from the server. Contains both the body of the response as well as the correlated request that was originally sent.


Constructor Summary
ClientResponse(ClientRequest request, long received, boolean disconnected, Struct responseBody)
           
 
Method Summary
 boolean hasResponse()
           
 long receivedTime()
           
 ClientRequest request()
           
 long requestLatencyMs()
           
 Struct responseBody()
           
 java.lang.String toString()
           
 boolean wasDisconnected()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ClientResponse

public ClientResponse(ClientRequest request,
                      long received,
                      boolean disconnected,
                      Struct responseBody)
Parameters:
request - The original request
received - The unix timestamp when this response was received
disconnected - Whether the client disconnected before fully reading a response
responseBody - The response contents (or null) if we disconnected or no response was expected
Method Detail

receivedTime

public long receivedTime()

wasDisconnected

public boolean wasDisconnected()

request

public ClientRequest request()

responseBody

public Struct responseBody()

hasResponse

public boolean hasResponse()

requestLatencyMs

public long requestLatencyMs()

toString

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