Package com.linecorp.armeria.common
Interface HttpMessage
- All Superinterfaces:
org.reactivestreams.Publisher<HttpObject>
,StreamMessage<HttpObject>
- All Known Subinterfaces:
HttpRequest
,HttpRequestWriter
,HttpResponse
,HttpResponseWriter
- All Known Implementing Classes:
FilteredHttpRequest
,FilteredHttpResponse
public interface HttpMessage extends StreamMessage<HttpObject>
A streamed HTTP/2 message.
-
Method Summary
Modifier and Type Method Description default <T> StreamMessage<T>
decode(HttpDecoder<T> decoder)
Creates a decodedStreamMessage
which is decoded from a stream ofHttpObject
s using the specifiedHttpDecoder
.default <T> StreamMessage<T>
decode(HttpDecoder<T> decoder, ByteBufAllocator alloc)
Creates a decodedStreamMessage
which is decoded from a stream ofHttpObject
s using the specifiedHttpDecoder
andByteBufAllocator
.<T> StreamMessage<T>
decode(HttpDecoder<T> decoder, ByteBufAllocator alloc, Function<? super HttpData,? extends ByteBuf> byteBufConverter)
Creates a decodedStreamMessage
which is decoded from a stream ofHttpObject
s using the specifiedHttpDecoder
andByteBufAllocator
andbyteBufConverter
.StreamMessageDuplicator<HttpObject>
toDuplicator(long maxContentLength)
Returns a newStreamMessageDuplicator
that duplicates thisHttpMessage
into one or moreHttpMessage
s, which publish the same elements.StreamMessageDuplicator<HttpObject>
toDuplicator(EventExecutor executor, long maxContentLength)
Returns a newStreamMessageDuplicator
that duplicates thisHttpMessage
into one or moreHttpMessage
s, which publish the same elements.Methods inherited from interface com.linecorp.armeria.common.stream.StreamMessage
abort, abort, collect, collect, collect, defaultSubscriberExecutor, demand, filter, isComplete, isEmpty, isOpen, map, subscribe, subscribe, subscribe, subscribe, toDuplicator, toDuplicator, whenComplete
-
Method Details
-
toDuplicator
Returns a newStreamMessageDuplicator
that duplicates thisHttpMessage
into one or moreHttpMessage
s, which publish the same elements. Note that you cannot subscribe to thisHttpMessage
anymore after you call this method. To subscribe, callStreamMessageDuplicator.duplicate()
from the returnedStreamMessageDuplicator
.- Parameters:
maxContentLength
- the maximum content length that the duplicator can hold in its buffer.ContentTooLargeException
is raised if the length of the bufferedHttpData
is greater than this value.
-
toDuplicator
Returns a newStreamMessageDuplicator
that duplicates thisHttpMessage
into one or moreHttpMessage
s, which publish the same elements. Note that you cannot subscribe to thisHttpMessage
anymore after you call this method. To subscribe, callStreamMessageDuplicator.duplicate()
from the returnedStreamMessageDuplicator
.- Parameters:
executor
- the executor to duplicatemaxContentLength
- the maximum content length that the duplicator can hold in its buffer.ContentTooLargeException
is raised if the length of the bufferedHttpData
is greater than this value.
-
decode
Creates a decodedStreamMessage
which is decoded from a stream ofHttpObject
s using the specifiedHttpDecoder
. -
decode
Creates a decodedStreamMessage
which is decoded from a stream ofHttpObject
s using the specifiedHttpDecoder
andByteBufAllocator
. -
decode
<T> StreamMessage<T> decode(HttpDecoder<T> decoder, ByteBufAllocator alloc, Function<? super HttpData,? extends ByteBuf> byteBufConverter)Creates a decodedStreamMessage
which is decoded from a stream ofHttpObject
s using the specifiedHttpDecoder
andByteBufAllocator
andbyteBufConverter
.
-