Module org.elasticsearch.server
Package org.elasticsearch.rest.action
Class RestActionListener<Response>
java.lang.Object
org.elasticsearch.rest.action.RestActionListener<Response>
- All Implemented Interfaces:
ActionListener<Response>
- Direct Known Subclasses:
RestChunkedToXContentListener,RestResponseListener
public abstract class RestActionListener<Response>
extends Object
implements ActionListener<Response>
An action listener that requires
processResponse(Object) to be implemented
and will automatically handle failures.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidfinal voidComplete this listener with an exceptional response.final voidonResponse(Response response) Complete this listener with a successful (or at least, non-exceptional) response.protected abstract voidprocessResponse(Response response) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.elasticsearch.action.ActionListener
delegateFailure, delegateFailureAndWrap, delegateFailureIgnoreResponseAndWrap, delegateResponse, map, safeMap
-
Field Details
-
channel
-
-
Constructor Details
-
RestActionListener
-
-
Method Details
-
onResponse
Description copied from interface:ActionListenerComplete this listener with a successful (or at least, non-exceptional) response.- Specified by:
onResponsein interfaceActionListener<Response>
-
processResponse
- Throws:
Exception
-
ensureOpen
protected void ensureOpen() -
onFailure
Description copied from interface:ActionListenerComplete this listener with an exceptional response.- Specified by:
onFailurein interfaceActionListener<Response>
-