public interface BlockingStreamingHttpResponse extends HttpResponseMetaData
HttpResponse but provides the payload as a BlockingIterable.| Modifier and Type | Method and Description |
|---|---|
default BlockingStreamingHttpResponse |
addCookie(CharSequence name,
CharSequence value)
|
default BlockingStreamingHttpResponse |
addCookie(HttpCookiePair cookie)
Adds a cookie.
|
default BlockingStreamingHttpResponse |
addHeader(CharSequence name,
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(CharSequence name,
CharSequence value)
|
default BlockingStreamingHttpResponse |
addSetCookie(HttpSetCookie cookie)
Adds a set-cookie.
|
BlockingStreamingHttpResponse |
context(ContextMap context)
Sets a context for this
HttpMetaData. |
HttpMessageBodyIterable<Buffer> |
messageBody()
Get the
HttpMessageBodyIterable for this response. |
BlockingStreamingHttpResponse |
messageBody(HttpMessageBodyIterable<Buffer> messageBody)
Set the
HttpMessageBodyIterable for this response. |
<T> BlockingStreamingHttpResponse |
messageBody(HttpMessageBodyIterable<T> messageBody,
HttpStreamingSerializer<T> serializer)
Set the
HttpMessageBodyIterable for this response. |
<T> HttpMessageBodyIterable<T> |
messageBody(HttpStreamingDeserializer<T> deserializer)
Get the
HttpMessageBodyIterable for this response and deserialize to type T. |
BlockingIterable<Buffer> |
payloadBody()
Gets the underlying payload as a
Publisher of Buffers. |
default <T> BlockingIterable<T> |
payloadBody(HttpDeserializer<T> deserializer)
Deprecated.
|
<T> BlockingIterable<T> |
payloadBody(HttpStreamingDeserializer<T> deserializer)
Gets and deserializes the payload body.
|
BlockingStreamingHttpResponse |
payloadBody(InputStream payloadBody)
Returns a
BlockingStreamingHttpResponse with its underlying payload set to payloadBody. |
BlockingStreamingHttpResponse |
payloadBody(Iterable<Buffer> payloadBody)
Returns a
BlockingStreamingHttpResponse with its underlying payload set to payloadBody. |
<T> BlockingStreamingHttpResponse |
payloadBody(Iterable<T> payloadBody,
HttpSerializer<T> serializer)
Deprecated.
|
<T> BlockingStreamingHttpResponse |
payloadBody(Iterable<T> payloadBody,
HttpStreamingSerializer<T> serializer)
Returns a
BlockingStreamingHttpResponse with its underlying payload set to the result of serialization. |
default InputStream |
payloadBodyInputStream()
Gets the underlying payload as a
InputStream. |
default BlockingStreamingHttpResponse |
setHeader(CharSequence name,
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)
Deprecated.
|
<T> BlockingStreamingHttpResponse |
transformPayloadBody(Function<BlockingIterable<Buffer>,BlockingIterable<T>> transformer,
HttpSerializer<T> serializer)
Deprecated.
|
default <T,R> BlockingStreamingHttpResponse |
transformPayloadBody(Function<BlockingIterable<T>,BlockingIterable<R>> transformer,
HttpDeserializer<T> deserializer,
HttpSerializer<R> serializer)
Deprecated.
|
BlockingStreamingHttpResponse |
transformPayloadBody(UnaryOperator<BlockingIterable<Buffer>> transformer)
Deprecated.
Use
payloadBody() and payloadBody(Iterable). |
BlockingStreamingHttpResponse |
version(HttpProtocolVersion version)
Set the protocol version of this
HttpMetaData. |
statusBlockingIterable<Buffer> payloadBody()
Publisher of Buffers.Publisher of Buffer representation of the underlying payload body.default InputStream payloadBodyInputStream()
InputStream.InputStream representation of the underlying payload body.@Deprecated default <T> BlockingIterable<T> payloadBody(HttpDeserializer<T> deserializer)
payloadBody(HttpStreamingDeserializer).T - The resulting type of the deserialization operation.deserializer - The function that deserializes the underlying BlockingIterable.<T> BlockingIterable<T> payloadBody(HttpStreamingDeserializer<T> deserializer)
T - The resulting type of the deserialization operation.deserializer - The function that deserializes the underlying BlockingIterable.HttpMessageBodyIterable<Buffer> messageBody()
HttpMessageBodyIterable for this response.HttpMessageBodyIterable for this response.<T> HttpMessageBodyIterable<T> messageBody(HttpStreamingDeserializer<T> deserializer)
HttpMessageBodyIterable for this response and deserialize to type T.T - The resulting type of the deserialization operation.deserializer - The function that deserializes the underlying BlockingIterable.HttpMessageBodyIterable for this payloadBody.BlockingStreamingHttpResponse payloadBody(Iterable<Buffer> payloadBody)
BlockingStreamingHttpResponse with its underlying payload set to payloadBody.
A best effort will be made to apply back pressure to the existing payload body which is being replaced. 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 payload body that is being replaced.
payloadBody - The new payload body.thisBlockingStreamingHttpResponse payloadBody(InputStream payloadBody)
BlockingStreamingHttpResponse with its underlying payload set to payloadBody.
A best effort will be made to apply back pressure to the existing payload body which is being replaced. 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 payload body that is being replaced.
payloadBody - The new payload body.thisBlockingStreamingHttpResponse messageBody(HttpMessageBodyIterable<Buffer> messageBody)
HttpMessageBodyIterable for this response.messageBody - The new message body.this.@Deprecated <T> BlockingStreamingHttpResponse payloadBody(Iterable<T> payloadBody, HttpSerializer<T> serializer)
payloadBody(Iterable, HttpStreamingSerializer).BlockingStreamingHttpResponse with its underlying payload set to the result of serialization.
A best effort will be made to apply back pressure to the existing payload body which is being replaced. 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 payload body that is being replaced.
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(Iterable<T> payloadBody, HttpStreamingSerializer<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 payload body which is being replaced. If this
default policy is not sufficient payloadBody() can be used to drain with 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 payload body that is being replaced.
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 messageBody(HttpMessageBodyIterable<T> messageBody, HttpStreamingSerializer<T> serializer)
HttpMessageBodyIterable for this response.T - The type of the serialized objects.messageBody - The serialized message body.serializer - The function that serializes the underlying BlockingIterable.this@Deprecated <T> BlockingStreamingHttpResponse transformPayloadBody(Function<BlockingIterable<Buffer>,BlockingIterable<T>> transformer, HttpSerializer<T> serializer)
payloadBody(HttpStreamingDeserializer) and
payloadBody(Iterable, HttpStreamingSerializer).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@Deprecated default <T,R> BlockingStreamingHttpResponse transformPayloadBody(Function<BlockingIterable<T>,BlockingIterable<R>> transformer, HttpDeserializer<T> deserializer, HttpSerializer<R> serializer)
payloadBody(HttpStreamingDeserializer) and
payloadBody(Iterable, HttpStreamingSerializer).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@Deprecated BlockingStreamingHttpResponse transformPayloadBody(UnaryOperator<BlockingIterable<Buffer>> transformer)
payloadBody() and payloadBody(Iterable).BlockingStreamingHttpResponse with its underlying payload transformed to Buffers.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@Deprecated <T> BlockingStreamingHttpResponse transform(TrailersTransformer<T,Buffer> trailersTransformer)
messageBody() and messageBody(HttpMessageBodyIterable).BlockingStreamingHttpResponse with its underlying payload transformed to Buffers,
with access to the trailers.T - The type of state used during the transformation.trailersTransformer - TrailersTransformer to use for this transform.thisSingle<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)
HttpMetaDataHttpMetaData.version in interface HttpMetaDataversion in interface HttpResponseMetaDataversion - the protocol version to set.this.BlockingStreamingHttpResponse status(HttpResponseStatus status)
HttpResponseMetaDataStreamingHttpResponse.status in interface HttpResponseMetaDatastatus - The HttpResponseStatus to set.this.default BlockingStreamingHttpResponse addHeader(CharSequence name, CharSequence value)
HttpMetaDataname and value.addHeader in interface HttpMetaDataaddHeader in interface HttpResponseMetaDataname - the name of the header.value - the value of the header.this.default BlockingStreamingHttpResponse addHeaders(HttpHeaders headers)
HttpMetaDataheaders object.addHeaders in interface HttpMetaDataaddHeaders in interface HttpResponseMetaDataheaders - the headers to add.this.default BlockingStreamingHttpResponse setHeader(CharSequence name, CharSequence value)
HttpMetaDataname and value. Any existing headers with the same name are
overwritten.setHeader in interface HttpMetaDatasetHeader in interface HttpResponseMetaDataname - the name of the header.value - the value of the header.this.default BlockingStreamingHttpResponse setHeaders(HttpHeaders headers)
HttpMetaDataheaders object.setHeaders in interface HttpMetaDatasetHeaders in interface HttpResponseMetaDataheaders - the headers object which contains new values.this.default BlockingStreamingHttpResponse addCookie(HttpCookiePair cookie)
HttpMetaData
This may result in multiple HttpCookiePairs with same name.
addCookie in interface HttpMetaDataaddCookie in interface HttpResponseMetaDatacookie - the cookie to add.this.default BlockingStreamingHttpResponse addCookie(CharSequence name, CharSequence value)
HttpMetaDataname and
value.
This may result in multiple HttpSetCookies 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 HttpMetaDataaddCookie in interface HttpResponseMetaDataname - the name of the cookie.value - the value of the cookie.this.default BlockingStreamingHttpResponse addSetCookie(HttpSetCookie cookie)
HttpMetaData
This may result in multiple HttpSetCookies with same name.
addSetCookie in interface HttpMetaDataaddSetCookie in interface HttpResponseMetaDatacookie - the cookie to add.this.default BlockingStreamingHttpResponse addSetCookie(CharSequence name, CharSequence value)
HttpMetaDataname
and value.
This may result in multiple HttpSetCookies 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 HttpMetaDataaddSetCookie in interface HttpResponseMetaDataname - the name of the cookie.value - the value of the cookie.this.BlockingStreamingHttpResponse context(ContextMap context)
HttpMetaDataHttpMetaData.
Context can be used to associate a state with a request or response message without serializing its state on the wire.
context in interface ContextMapHoldercontext in interface HttpMetaDatacontext in interface HttpResponseMetaDatacontext - the new context for this HttpMetaData.this.