Package org.apache.hc.core5.reactive
Class ReactiveEntityProducer
- java.lang.Object
-
- org.apache.hc.core5.reactive.ReactiveEntityProducer
-
- All Implemented Interfaces:
org.apache.hc.core5.http.EntityDetails,org.apache.hc.core5.http.nio.AsyncDataProducer,org.apache.hc.core5.http.nio.AsyncEntityProducer,org.apache.hc.core5.http.nio.ResourceHolder
@Contract(threading=SAFE) public final class ReactiveEntityProducer extends java.lang.Object implements org.apache.hc.core5.http.nio.AsyncEntityProducerAnAsyncEntityProducerthat subscribes to aPublisherinstance, as defined by the Reactive Streams specification.- Since:
- 5.0
-
-
Constructor Summary
Constructors Constructor Description ReactiveEntityProducer(org.reactivestreams.Publisher<java.nio.ByteBuffer> publisher, long contentLength, org.apache.hc.core5.http.ContentType contentType, java.lang.String contentEncoding)Creates a newReactiveEntityProducerwith the given parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intavailable()voidfailed(java.lang.Exception cause)java.lang.StringgetContentEncoding()longgetContentLength()java.lang.StringgetContentType()java.util.Set<java.lang.String>getTrailerNames()booleanisChunked()booleanisRepeatable()voidproduce(org.apache.hc.core5.http.nio.DataStreamChannel channel)voidreleaseResources()
-
-
-
Constructor Detail
-
ReactiveEntityProducer
public ReactiveEntityProducer(org.reactivestreams.Publisher<java.nio.ByteBuffer> publisher, long contentLength, org.apache.hc.core5.http.ContentType contentType, java.lang.String contentEncoding)Creates a newReactiveEntityProducerwith the given parameters.- Parameters:
publisher- the publisher of the entity stream.contentLength- the length of the entity, or -1 if unknown (implies chunked encoding).contentType- theContent-Typeof the entity, or null if none.contentEncoding- theContent-Encodingof the entity, or null if none.
-
-
Method Detail
-
available
public int available()
- Specified by:
availablein interfaceorg.apache.hc.core5.http.nio.AsyncDataProducer
-
produce
public void produce(org.apache.hc.core5.http.nio.DataStreamChannel channel) throws java.io.IOException- Specified by:
producein interfaceorg.apache.hc.core5.http.nio.AsyncDataProducer- Throws:
java.io.IOException
-
releaseResources
public void releaseResources()
- Specified by:
releaseResourcesin interfaceorg.apache.hc.core5.http.nio.ResourceHolder
-
isRepeatable
public boolean isRepeatable()
- Specified by:
isRepeatablein interfaceorg.apache.hc.core5.http.nio.AsyncEntityProducer
-
failed
public void failed(java.lang.Exception cause)
- Specified by:
failedin interfaceorg.apache.hc.core5.http.nio.AsyncEntityProducer
-
getContentLength
public long getContentLength()
- Specified by:
getContentLengthin interfaceorg.apache.hc.core5.http.EntityDetails
-
getContentType
public java.lang.String getContentType()
- Specified by:
getContentTypein interfaceorg.apache.hc.core5.http.EntityDetails
-
getContentEncoding
public java.lang.String getContentEncoding()
- Specified by:
getContentEncodingin interfaceorg.apache.hc.core5.http.EntityDetails
-
isChunked
public boolean isChunked()
- Specified by:
isChunkedin interfaceorg.apache.hc.core5.http.EntityDetails
-
getTrailerNames
public java.util.Set<java.lang.String> getTrailerNames()
- Specified by:
getTrailerNamesin interfaceorg.apache.hc.core5.http.EntityDetails
-
-