Package org.elasticsearch.action
Class ActionListenerResponseHandler<Response extends TransportResponse>
- java.lang.Object
-
- org.elasticsearch.action.ActionListenerResponseHandler<Response>
-
- All Implemented Interfaces:
Writeable.Reader<Response>,TransportResponseHandler<Response>
public class ActionListenerResponseHandler<Response extends TransportResponse> extends java.lang.Object implements TransportResponseHandler<Response>
A simple base class for action response listeners, defaulting to using the SAME executor (as its very common on response handlers).
-
-
Constructor Summary
Constructors Constructor Description ActionListenerResponseHandler(ActionListener<? super Response> listener, Writeable.Reader<Response> reader)ActionListenerResponseHandler(ActionListener<? super Response> listener, Writeable.Reader<Response> reader, java.lang.String executor)
-
Method Summary
Modifier and Type Method Description java.lang.Stringexecutor()voidhandleException(TransportException e)voidhandleResponse(Response response)Responseread(StreamInput in)ReadV-type value from a stream.
-
-
-
Constructor Detail
-
ActionListenerResponseHandler
public ActionListenerResponseHandler(ActionListener<? super Response> listener, Writeable.Reader<Response> reader, java.lang.String executor)
-
ActionListenerResponseHandler
public ActionListenerResponseHandler(ActionListener<? super Response> listener, Writeable.Reader<Response> reader)
-
-
Method Detail
-
handleResponse
public void handleResponse(Response response)
- Specified by:
handleResponsein interfaceTransportResponseHandler<Response extends TransportResponse>
-
handleException
public void handleException(TransportException e)
- Specified by:
handleExceptionin interfaceTransportResponseHandler<Response extends TransportResponse>
-
executor
public java.lang.String executor()
- Specified by:
executorin interfaceTransportResponseHandler<Response extends TransportResponse>
-
read
public Response read(StreamInput in) throws java.io.IOException
Description copied from interface:Writeable.ReaderReadV-type value from a stream.- Specified by:
readin interfaceWriteable.Reader<Response extends TransportResponse>- Parameters:
in- Input to read the value from- Throws:
java.io.IOException
-
-