T
- entity representation.public final class DiscardingEntityConsumer<T> extends Object implements AsyncEntityConsumer<T>
AsyncEntityConsumer
that discards all data from the data stream.Constructor and Description |
---|
DiscardingEntityConsumer() |
Modifier and Type | Method and Description |
---|---|
void |
consume(ByteBuffer src)
Triggered to pass incoming data to the data consumer.
|
void |
failed(Exception cause)
Triggered to signal a failure in data processing.
|
T |
getContent()
Returns the result of entity processing when it becomes available or
null
if the entity is still being received. |
void |
releaseResources() |
void |
streamEnd(List<? extends Header> trailers)
Triggered to signal termination of the data stream.
|
void |
streamStart(EntityDetails entityDetails,
FutureCallback<T> resultCallback)
Signals beginning of an incoming request entity stream.
|
void |
updateCapacity(CapacityChannel capacityChannel)
Triggered to signal ability of the underlying data stream to receive
data capacity update.
|
public void streamStart(EntityDetails entityDetails, FutureCallback<T> resultCallback) throws IOException, HttpException
AsyncEntityConsumer
streamStart
in interface AsyncEntityConsumer<T>
entityDetails
- the details of the incoming message entity.resultCallback
- the result callback.IOException
- in case of an I/O error.HttpException
- in case of an HTTP protocol violation.public void updateCapacity(CapacityChannel capacityChannel) throws IOException
AsyncDataConsumer
updateCapacity
in interface AsyncDataConsumer
capacityChannel
- the channel for capacity updates.IOException
- in case of an I/O error.public void consume(ByteBuffer src) throws IOException
AsyncDataConsumer
consume
in interface AsyncDataConsumer
src
- data source.IOException
- in case of an I/O error.public void streamEnd(List<? extends Header> trailers) throws IOException
AsyncDataConsumer
streamEnd
in interface AsyncDataConsumer
trailers
- data stream trailers.IOException
- in case of an I/O error.public void failed(Exception cause)
AsyncEntityConsumer
failed
in interface AsyncEntityConsumer<T>
cause
- the cause of the failure.public T getContent()
AsyncEntityConsumer
null
if the entity is still being received.getContent
in interface AsyncEntityConsumer<T>
public void releaseResources()
releaseResources
in interface ResourceHolder
Copyright © 2005–2021 The Apache Software Foundation. All rights reserved.