Class JsonNodeEntityFallbackConsumer
java.lang.Object
org.apache.hc.core5.jackson2.http.JsonNodeEntityFallbackConsumer
- All Implemented Interfaces:
AsyncDataConsumer,AsyncEntityConsumer<com.fasterxml.jackson.databind.JsonNode>,ResourceHolder
public class JsonNodeEntityFallbackConsumer
extends Object
implements AsyncEntityConsumer<com.fasterxml.jackson.databind.JsonNode>
AsyncEntityConsumer implementation that
de-serializes incoming HTTP message entity into an JsonNode instance
if the message content type is ContentType.APPLICATION_JSON or as a single text
JsonNode if the message content type is not supported. This entity consumer
is primarily intended for handling of response messages that represent a client or a server
error (such as a response with 4xx or 5xx status).- Since:
- 5.5
-
Constructor Summary
ConstructorsConstructorDescriptionJsonNodeEntityFallbackConsumer(com.fasterxml.jackson.core.JsonFactory jsonFactory) JsonNodeEntityFallbackConsumer(com.fasterxml.jackson.databind.ObjectMapper objectMapper) -
Method Summary
Modifier and TypeMethodDescriptionvoidconsume(ByteBuffer data) voidcom.fasterxml.jackson.databind.JsonNodevoidvoidvoidstreamStart(EntityDetails entityDetails, FutureCallback<com.fasterxml.jackson.databind.JsonNode> resultCallback) voidupdateCapacity(CapacityChannel capacityChannel)
-
Constructor Details
-
JsonNodeEntityFallbackConsumer
public JsonNodeEntityFallbackConsumer(com.fasterxml.jackson.core.JsonFactory jsonFactory) -
JsonNodeEntityFallbackConsumer
public JsonNodeEntityFallbackConsumer(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
-
-
Method Details
-
streamStart
public void streamStart(EntityDetails entityDetails, FutureCallback<com.fasterxml.jackson.databind.JsonNode> resultCallback) throws HttpException, IOException - Specified by:
streamStartin interfaceAsyncEntityConsumer<com.fasterxml.jackson.databind.JsonNode>- Throws:
HttpExceptionIOException
-
getContent
public com.fasterxml.jackson.databind.JsonNode getContent()- Specified by:
getContentin interfaceAsyncEntityConsumer<com.fasterxml.jackson.databind.JsonNode>
-
updateCapacity
- Specified by:
updateCapacityin interfaceAsyncDataConsumer- Throws:
IOException
-
consume
- Specified by:
consumein interfaceAsyncDataConsumer- Throws:
IOException
-
streamEnd
- Specified by:
streamEndin interfaceAsyncDataConsumer- Throws:
HttpExceptionIOException
-
failed
- Specified by:
failedin interfaceAsyncEntityConsumer<com.fasterxml.jackson.databind.JsonNode>
-
releaseResources
public void releaseResources()- Specified by:
releaseResourcesin interfaceResourceHolder
-