Class SafeResponseConsumer<T>
java.lang.Object
co.elastic.clients.transport.rest5_client.SafeResponseConsumer<T>
- All Implemented Interfaces:
org.apache.hc.core5.http.nio.AsyncDataConsumer,org.apache.hc.core5.http.nio.AsyncResponseConsumer<T>,org.apache.hc.core5.http.nio.ResourceHolder
public class SafeResponseConsumer<T>
extends Object
implements org.apache.hc.core5.http.nio.AsyncResponseConsumer<T>
A response consumer that will propagate Errors as RuntimeExceptions to avoid crashing the IOReactor.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final co.elastic.clients.transport.rest5_client.low_level.HttpAsyncResponseConsumerFactoryA consumer factory that safely wraps the one provided byRequestOptions.DEFAULT.static final co.elastic.clients.transport.rest5_client.low_level.RequestOptionsSame asRequestOptions.DEFAULTwith a safe consumer factory -
Constructor Summary
ConstructorsConstructorDescriptionSafeResponseConsumer(org.apache.hc.core5.http.nio.AsyncResponseConsumer<T> delegate) -
Method Summary
Modifier and TypeMethodDescriptionvoidconsume(ByteBuffer src) voidconsumeResponse(org.apache.hc.core5.http.HttpResponse response, org.apache.hc.core5.http.EntityDetails entityDetails, org.apache.hc.core5.http.protocol.HttpContext context, org.apache.hc.core5.concurrent.FutureCallback<T> resultCallback) voidvoidinformationResponse(org.apache.hc.core5.http.HttpResponse response, org.apache.hc.core5.http.protocol.HttpContext context) voidvoidvoidupdateCapacity(org.apache.hc.core5.http.nio.CapacityChannel capacityChannel)
-
Field Details
-
DEFAULT_FACTORY
public static final co.elastic.clients.transport.rest5_client.low_level.HttpAsyncResponseConsumerFactory DEFAULT_FACTORYA consumer factory that safely wraps the one provided byRequestOptions.DEFAULT. -
DEFAULT_REQUEST_OPTIONS
public static final co.elastic.clients.transport.rest5_client.low_level.RequestOptions DEFAULT_REQUEST_OPTIONSSame asRequestOptions.DEFAULTwith a safe consumer factory
-
-
Constructor Details
-
SafeResponseConsumer
-
-
Method Details
-
consumeResponse
public void consumeResponse(org.apache.hc.core5.http.HttpResponse response, org.apache.hc.core5.http.EntityDetails entityDetails, org.apache.hc.core5.http.protocol.HttpContext context, org.apache.hc.core5.concurrent.FutureCallback<T> resultCallback) - Specified by:
consumeResponsein interfaceorg.apache.hc.core5.http.nio.AsyncResponseConsumer<T>
-
informationResponse
public void informationResponse(org.apache.hc.core5.http.HttpResponse response, org.apache.hc.core5.http.protocol.HttpContext context) - Specified by:
informationResponsein interfaceorg.apache.hc.core5.http.nio.AsyncResponseConsumer<T>
-
failed
- Specified by:
failedin interfaceorg.apache.hc.core5.http.nio.AsyncResponseConsumer<T>
-
updateCapacity
public void updateCapacity(org.apache.hc.core5.http.nio.CapacityChannel capacityChannel) - Specified by:
updateCapacityin interfaceorg.apache.hc.core5.http.nio.AsyncDataConsumer
-
consume
- Specified by:
consumein interfaceorg.apache.hc.core5.http.nio.AsyncDataConsumer
-
streamEnd
- Specified by:
streamEndin interfaceorg.apache.hc.core5.http.nio.AsyncDataConsumer
-
releaseResources
public void releaseResources()- Specified by:
releaseResourcesin interfaceorg.apache.hc.core5.http.nio.ResourceHolder
-