Class AbstractCharAsyncEntityConsumer<T>
java.lang.Object
org.apache.hc.core5.http.nio.entity.AbstractCharDataConsumer
org.apache.hc.core5.http.nio.entity.AbstractCharAsyncEntityConsumer<T>
- Type Parameters:
T- entity representation.
- All Implemented Interfaces:
AsyncDataConsumer,AsyncEntityConsumer<T>,ResourceHolder
- Direct Known Subclasses:
StringAsyncEntityConsumer
public abstract class AbstractCharAsyncEntityConsumer<T>
extends AbstractCharDataConsumer
implements AsyncEntityConsumer<T>
Abstract text entity content consumer.
- Since:
- 5.0
-
Field Summary
FieldsFields inherited from class org.apache.hc.core5.http.nio.entity.AbstractCharDataConsumer
DEF_BUF_SIZE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractCharAsyncEntityConsumer(int bufSize, CharCodingConfig charCodingConfig) -
Method Summary
Modifier and TypeMethodDescriptionprotected final voidTriggered to signal completion of data processing.final voidTriggered to signal a failure in data processing.protected abstract TTriggered to generate entity representation.final TReturns the result of entity processing when it becomes available ornullif the entity is still being received.protected abstract voidstreamStart(ContentType contentType) Triggered to signal beginning of entity content stream.final voidstreamStart(EntityDetails entityDetails, FutureCallback<T> resultCallback) Signals beginning of an incoming request entity stream.Methods inherited from class org.apache.hc.core5.http.nio.entity.AbstractCharDataConsumer
capacityIncrement, consume, data, setCharset, streamEnd, updateCapacityMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.hc.core5.http.nio.AsyncDataConsumer
consume, streamEnd, updateCapacityMethods inherited from interface org.apache.hc.core5.http.nio.ResourceHolder
releaseResources
-
Field Details
-
resultCallback
-
-
-
Constructor Details
-
AbstractCharAsyncEntityConsumer
-
AbstractCharAsyncEntityConsumer
public AbstractCharAsyncEntityConsumer()
-
-
Method Details
-
streamStart
Triggered to signal beginning of entity content stream.- Parameters:
contentType- the entity content type- Throws:
HttpExceptionIOException
-
generateContent
Triggered to generate entity representation.- Returns:
- the entity content
- Throws:
IOException
-
streamStart
public final void streamStart(EntityDetails entityDetails, FutureCallback<T> resultCallback) throws IOException, HttpException Description copied from interface:AsyncEntityConsumerSignals beginning of an incoming request entity stream.- Specified by:
streamStartin interfaceAsyncEntityConsumer<T>- Parameters:
entityDetails- the details of the incoming message entity.resultCallback- the result callback.- Throws:
IOExceptionHttpException
-
completed
Description copied from class:AbstractCharDataConsumerTriggered to signal completion of data processing.- Specified by:
completedin classAbstractCharDataConsumer- Throws:
IOException
-
failed
Description copied from interface:AsyncEntityConsumerTriggered to signal a failure in data processing.- Specified by:
failedin interfaceAsyncEntityConsumer<T>- Parameters:
cause- the cause of the failure.
-
getContent
Description copied from interface:AsyncEntityConsumerReturns the result of entity processing when it becomes available ornullif the entity is still being received.- Specified by:
getContentin interfaceAsyncEntityConsumer<T>- Returns:
- the response processing result.
-