@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 AsyncDataProducer
public void produce(DataStreamChannel channel) throws IOException
produce
in interface AsyncDataProducer
IOException
public void releaseResources()
releaseResources
in interface ResourceHolder
public boolean isRepeatable()
isRepeatable
in interface AsyncEntityProducer
public void failed(Exception cause)
failed
in interface AsyncEntityProducer
public long getContentLength()
getContentLength
in interface EntityDetails
public String getContentType()
getContentType
in interface EntityDetails
public String getContentEncoding()
getContentEncoding
in interface EntityDetails
public boolean isChunked()
isChunked
in interface EntityDetails
public Set<String> getTrailerNames()
getTrailerNames
in interface EntityDetails
Copyright © 2005–2021 The Apache Software Foundation. All rights reserved.