@Contract(threading=SAFE) public final class ReactiveEntityProducer extends Object implements AsyncEntityProducer
AsyncEntityProducer that subscribes to a Publisher
instance, as defined by the Reactive Streams specification.| Constructor and Description |
|---|
ReactiveEntityProducer(org.reactivestreams.Publisher<ByteBuffer> publisher,
long contentLength,
ContentType contentType,
String contentEncoding)
Creates a new
ReactiveEntityProducer with the given parameters. |
| Modifier and Type | Method and Description |
|---|---|
int |
available() |
void |
failed(Exception cause) |
String |
getContentEncoding() |
long |
getContentLength() |
String |
getContentType() |
Set<String> |
getTrailerNames() |
boolean |
isChunked() |
boolean |
isRepeatable() |
void |
produce(DataStreamChannel channel) |
void |
releaseResources() |
public ReactiveEntityProducer(org.reactivestreams.Publisher<ByteBuffer> publisher, long contentLength, ContentType contentType, String contentEncoding)
ReactiveEntityProducer with the given parameters.publisher - the publisher of the entity stream.contentLength - the length of the entity, or -1 if unknown (implies chunked encoding).contentType - the Content-Type of the entity, or null if none.contentEncoding - the Content-Encoding of the entity, or null if none.public int available()
available in interface AsyncDataProducerpublic void produce(DataStreamChannel channel) throws IOException
produce in interface AsyncDataProducerIOExceptionpublic void releaseResources()
releaseResources in interface ResourceHolderpublic boolean isRepeatable()
isRepeatable in interface AsyncEntityProducerpublic void failed(Exception cause)
failed in interface AsyncEntityProducerpublic long getContentLength()
getContentLength in interface EntityDetailspublic String getContentType()
getContentType in interface EntityDetailspublic String getContentEncoding()
getContentEncoding in interface EntityDetailspublic boolean isChunked()
isChunked in interface EntityDetailspublic Set<String> getTrailerNames()
getTrailerNames in interface EntityDetailsCopyright © 2005–2021 The Apache Software Foundation. All rights reserved.