public interface BlockingStreamingHttpResponse extends HttpResponseMetaData
HttpResponse
but provides the payload as a BlockingIterable
.Modifier and Type | Method and Description |
---|---|
default BlockingStreamingHttpResponse |
addCookie(java.lang.CharSequence name,
java.lang.CharSequence value)
|
default BlockingStreamingHttpResponse |
addCookie(HttpCookiePair cookie)
Adds a cookie.
|
default BlockingStreamingHttpResponse |
addHeader(java.lang.CharSequence name,
java.lang.CharSequence value)
Adds a new header with the specified
name and value . |
default BlockingStreamingHttpResponse |
addHeaders(HttpHeaders headers)
Adds all header names and values of
headers object. |
default BlockingStreamingHttpResponse |
addSetCookie(java.lang.CharSequence name,
java.lang.CharSequence value)
|
default BlockingStreamingHttpResponse |
addSetCookie(HttpSetCookie cookie)
Adds a set-cookie.
|
BlockingIterable<Buffer> |
payloadBody()
|
BlockingStreamingHttpResponse |
payloadBody(CloseableIterable<Buffer> payloadBody)
Returns a
BlockingStreamingHttpResponse with its underlying payload set to payloadBody . |
<T> BlockingStreamingHttpResponse |
payloadBody(CloseableIterable<T> payloadBody,
HttpSerializer<T> serializer)
Returns a
BlockingStreamingHttpResponse with its underlying payload set to the result of serialization. |
default <T> BlockingIterable<T> |
payloadBody(HttpDeserializer<T> deserializer)
Gets and deserializes the payload body.
|
BlockingStreamingHttpResponse |
payloadBody(java.lang.Iterable<Buffer> payloadBody)
Returns a
BlockingStreamingHttpResponse with its underlying payload set to payloadBody . |
<T> BlockingStreamingHttpResponse |
payloadBody(java.lang.Iterable<T> payloadBody,
HttpSerializer<T> serializer)
Returns a
BlockingStreamingHttpResponse with its underlying payload set to the result of serialization. |
default java.io.InputStream |
payloadBodyInputStream()
Gets the underlying payload as a
InputStream . |
default BlockingStreamingHttpResponse |
setHeader(java.lang.CharSequence name,
java.lang.CharSequence value)
Sets a header with the specified
name and value . |
default BlockingStreamingHttpResponse |
setHeaders(HttpHeaders headers)
Clears the current header entries and copies all header entries of the specified
headers object. |
BlockingStreamingHttpResponse |
status(HttpResponseStatus status)
Set the status of this
StreamingHttpResponse . |
Single<HttpResponse> |
toResponse()
Translates this
BlockingStreamingHttpResponse to a HttpResponse . |
StreamingHttpResponse |
toStreamingResponse()
Translates this
BlockingStreamingHttpResponse to a StreamingHttpResponse . |
<T> BlockingStreamingHttpResponse |
transform(TrailersTransformer<T,Buffer> trailersTransformer)
Returns a
BlockingStreamingHttpResponse with its underlying payload transformed to Buffer s,
with access to the trailers. |
<T> BlockingStreamingHttpResponse |
transformPayloadBody(java.util.function.Function<BlockingIterable<Buffer>,BlockingIterable<T>> transformer,
HttpSerializer<T> serializer)
Returns a
BlockingStreamingHttpResponse with its underlying payload transformed to the result of
serialization. |
default <T,R> BlockingStreamingHttpResponse |
transformPayloadBody(java.util.function.Function<BlockingIterable<T>,BlockingIterable<R>> transformer,
HttpDeserializer<T> deserializer,
HttpSerializer<R> serializer)
Returns a
BlockingStreamingHttpResponse with its underlying payload transformed to the result of
serialization. |
BlockingStreamingHttpResponse |
transformPayloadBody(java.util.function.UnaryOperator<BlockingIterable<Buffer>> transformer)
Returns a
BlockingStreamingHttpResponse with its underlying payload transformed to Buffer s. |
<T> BlockingStreamingHttpResponse |
transformRaw(TrailersTransformer<T,java.lang.Object> trailersTransformer)
Returns a
BlockingStreamingHttpResponse with its underlying payload transformed to Object s,
with access to the trailers. |
BlockingStreamingHttpResponse |
transformRawPayloadBody(java.util.function.UnaryOperator<BlockingIterable<?>> transformer)
Returns a
BlockingStreamingHttpResponse with its underlying payload transformed. |
BlockingStreamingHttpResponse |
version(HttpProtocolVersion version)
Set the protocol version of this
HttpMetaData . |
status
headers, toString, toString, version
BlockingIterable<Buffer> payloadBody()
default java.io.InputStream payloadBodyInputStream()
InputStream
.InputStream
representation of the underlying payload body.default <T> BlockingIterable<T> payloadBody(HttpDeserializer<T> deserializer)
T
- The resulting type of the deserialization operation.deserializer
- The function that deserializes the underlying BlockingIterable
.BlockingStreamingHttpResponse payloadBody(java.lang.Iterable<Buffer> payloadBody)
BlockingStreamingHttpResponse
with its underlying payload set to payloadBody
.
A best effort will be made to apply back pressure to the existing Iterable
payload body. If this
default policy is not sufficient you can use transformPayloadBody(UnaryOperator)
for more fine grain
control.
This method reserves the right to delay completion/consumption of payloadBody
. This may occur due to the
combination with the existing Iterable
payload body.
payloadBody
- The new payload body.this
BlockingStreamingHttpResponse payloadBody(CloseableIterable<Buffer> payloadBody)
BlockingStreamingHttpResponse
with its underlying payload set to payloadBody
.
A best effort will be made to apply back pressure to the existing CloseableIterable
payload body. If this
default policy is not sufficient you can use transformPayloadBody(UnaryOperator)
for more fine grain
control.
This method reserves the right to delay completion/consumption of payloadBody
. This may occur due to the
combination with the existing CloseableIterable
payload body.
payloadBody
- The new payload body.this
<T> BlockingStreamingHttpResponse payloadBody(java.lang.Iterable<T> payloadBody, HttpSerializer<T> serializer)
BlockingStreamingHttpResponse
with its underlying payload set to the result of serialization.
A best effort will be made to apply back pressure to the existing Iterable
payload body. If this
default policy is not sufficient you can use transformPayloadBody(Function, HttpSerializer)
for more
fine grain control.
This method reserves the right to delay completion/consumption of payloadBody
. This may occur due to the
combination with the existing Iterable
payload body.
T
- The type of objects to serialize.payloadBody
- The new payload body, prior to serialization.serializer
- Used to serialize the payload body.this
<T> BlockingStreamingHttpResponse payloadBody(CloseableIterable<T> payloadBody, HttpSerializer<T> serializer)
BlockingStreamingHttpResponse
with its underlying payload set to the result of serialization.
A best effort will be made to apply back pressure to the existing CloseableIterable
payload body. If this
default policy is not sufficient you can use transformPayloadBody(Function, HttpSerializer)
for more
fine grain control.
This method reserves the right to delay completion/consumption of payloadBody
. This may occur due to the
combination with the existing CloseableIterable
payload body.
T
- The type of objects to serialize.payloadBody
- The new payload body, prior to serialization.serializer
- Used to serialize the payload body.this
<T> BlockingStreamingHttpResponse transformPayloadBody(java.util.function.Function<BlockingIterable<Buffer>,BlockingIterable<T>> transformer, HttpSerializer<T> serializer)
BlockingStreamingHttpResponse
with its underlying payload transformed to the result of
serialization.T
- The type of objects to serialize.transformer
- A Function
which take as a parameter the existing payload body
BlockingIterable
and returns the new payload body BlockingIterable
prior to serialization. It is
assumed the existing payload body BlockingIterable
will be transformed/consumed or else no more responses
may be processed.serializer
- Used to serialize the payload body.this
default <T,R> BlockingStreamingHttpResponse transformPayloadBody(java.util.function.Function<BlockingIterable<T>,BlockingIterable<R>> transformer, HttpDeserializer<T> deserializer, HttpSerializer<R> serializer)
BlockingStreamingHttpResponse
with its underlying payload transformed to the result of
serialization.T
- The type of objects to deserialize.R
- The type of objects to serialize.transformer
- A Function
which take as a parameter the existing payload body
BlockingIterable
and returns the new payload body BlockingIterable
prior to serialization. It is
assumed the existing payload body BlockingIterable
will be transformed/consumed or else no more requests
may be processed.deserializer
- Used to deserialize the existing payload body.serializer
- Used to serialize the payload body.this
BlockingStreamingHttpResponse transformPayloadBody(java.util.function.UnaryOperator<BlockingIterable<Buffer>> transformer)
BlockingStreamingHttpResponse
with its underlying payload transformed to Buffer
s.transformer
- A Function
which take as a parameter the existing payload body
BlockingIterable
and returns the new payload body BlockingIterable
. It is assumed the existing
payload body BlockingIterable
will be transformed/consumed or else no more responses may be processed.this
BlockingStreamingHttpResponse transformRawPayloadBody(java.util.function.UnaryOperator<BlockingIterable<?>> transformer)
BlockingStreamingHttpResponse
with its underlying payload transformed.transformer
- A Function
which take as a parameter the existing payload body
BlockingIterable
and returns the new payload body BlockingIterable
. It is assumed the existing
payload body BlockingIterable
will be transformed/consumed or else no more responses may be processed.this
<T> BlockingStreamingHttpResponse transform(TrailersTransformer<T,Buffer> trailersTransformer)
BlockingStreamingHttpResponse
with its underlying payload transformed to Buffer
s,
with access to the trailers.T
- The type of state used during the transformation.trailersTransformer
- TrailersTransformer
to use for this transform.this
<T> BlockingStreamingHttpResponse transformRaw(TrailersTransformer<T,java.lang.Object> trailersTransformer)
BlockingStreamingHttpResponse
with its underlying payload transformed to Object
s,
with access to the trailers.T
- The type of state used during the transformation.trailersTransformer
- TrailersTransformer
to use for this transform.this
Single<HttpResponse> toResponse()
BlockingStreamingHttpResponse
to a HttpResponse
.Single
that completes with a HttpResponse
representation of this
BlockingStreamingHttpResponse
.StreamingHttpResponse toStreamingResponse()
BlockingStreamingHttpResponse
to a StreamingHttpResponse
.StreamingHttpResponse
representation of this BlockingStreamingHttpResponse
.BlockingStreamingHttpResponse version(HttpProtocolVersion version)
HttpMetaData
HttpMetaData
.version
in interface HttpMetaData
version
in interface HttpResponseMetaData
version
- the protocol version to set.this
.BlockingStreamingHttpResponse status(HttpResponseStatus status)
HttpResponseMetaData
StreamingHttpResponse
.status
in interface HttpResponseMetaData
status
- The HttpResponseStatus
to set.this
.default BlockingStreamingHttpResponse addHeader(java.lang.CharSequence name, java.lang.CharSequence value)
HttpMetaData
name
and value
.addHeader
in interface HttpMetaData
addHeader
in interface HttpResponseMetaData
name
- the name of the header.value
- the value of the header.this
.default BlockingStreamingHttpResponse addHeaders(HttpHeaders headers)
HttpMetaData
headers
object.addHeaders
in interface HttpMetaData
addHeaders
in interface HttpResponseMetaData
headers
- the headers to add.this
.default BlockingStreamingHttpResponse setHeader(java.lang.CharSequence name, java.lang.CharSequence value)
HttpMetaData
name
and value
. Any existing headers with the same name are
overwritten.setHeader
in interface HttpMetaData
setHeader
in interface HttpResponseMetaData
name
- the name of the header.value
- the value of the header.this
.default BlockingStreamingHttpResponse setHeaders(HttpHeaders headers)
HttpMetaData
headers
object.setHeaders
in interface HttpMetaData
setHeaders
in interface HttpResponseMetaData
headers
- the headers object which contains new values.this
.default BlockingStreamingHttpResponse addCookie(HttpCookiePair cookie)
HttpMetaData
This may result in multiple HttpCookiePair
s with same name.
addCookie
in interface HttpMetaData
addCookie
in interface HttpResponseMetaData
cookie
- the cookie to add.this
.default BlockingStreamingHttpResponse addCookie(java.lang.CharSequence name, java.lang.CharSequence value)
HttpMetaData
name
and
value
.
This may result in multiple HttpSetCookie
s with same name. Added cookie will not be wrapped, not secure,
and not HTTP-only, with no path, domain, expire date and maximum age.
addCookie
in interface HttpMetaData
addCookie
in interface HttpResponseMetaData
name
- the name of the cookie.value
- the value of the cookie.this
.default BlockingStreamingHttpResponse addSetCookie(HttpSetCookie cookie)
HttpMetaData
This may result in multiple HttpSetCookie
s with same name.
addSetCookie
in interface HttpMetaData
addSetCookie
in interface HttpResponseMetaData
cookie
- the cookie to add.this
.default BlockingStreamingHttpResponse addSetCookie(java.lang.CharSequence name, java.lang.CharSequence value)
HttpMetaData
name
and value
.
This may result in multiple HttpSetCookie
s with same name. Added cookie will not be wrapped, not secure,
and not HTTP-only, with no path, domain, expire date and maximum age.
addSetCookie
in interface HttpMetaData
addSetCookie
in interface HttpResponseMetaData
name
- the name of the cookie.value
- the value of the cookie.this
.