public interface BlockingStreamingHttpServerResponse extends HttpResponseMetaData
HttpResponse but provides an ability to write the payload to an HttpPayloadWriter.BlockingStreamingHttpService| Modifier and Type | Method and Description |
|---|---|
default BlockingStreamingHttpServerResponse |
addCookie(CharSequence name,
CharSequence value)
|
default BlockingStreamingHttpServerResponse |
addCookie(HttpCookiePair cookie)
Adds a cookie.
|
default BlockingStreamingHttpServerResponse |
addHeader(CharSequence name,
CharSequence value)
Adds a new header with the specified
name and value. |
default BlockingStreamingHttpServerResponse |
addHeaders(HttpHeaders headers)
Adds all header names and values of
headers object. |
default BlockingStreamingHttpServerResponse |
addSetCookie(CharSequence name,
CharSequence value)
|
default BlockingStreamingHttpServerResponse |
addSetCookie(HttpSetCookie cookie)
Adds a set-cookie.
|
BlockingStreamingHttpServerResponse |
context(ContextMap context)
Sets a context for this
HttpMetaData. |
default BlockingStreamingHttpServerResponse |
encoding(ContentCodec encoding)
The
ContentCodec used to encode the payload of a request or a response. |
HttpPayloadWriter<Buffer> |
sendMetaData()
Sends the
HttpResponseMetaData and returns an HttpPayloadWriter to continue writing the payload
body. |
default <T> HttpPayloadWriter<T> |
sendMetaData(HttpSerializer<T> serializer)
Deprecated.
|
<T> HttpPayloadWriter<T> |
sendMetaData(HttpStreamingSerializer<T> serializer)
Sends the
HttpResponseMetaData to the client and returns an HttpPayloadWriter of type T
to continue writing a payload body. |
HttpOutputStream |
sendMetaDataOutputStream()
Sends the
HttpResponseMetaData to the client and returns an OutputStream to continue writing a
payload body. |
default BlockingStreamingHttpServerResponse |
setHeader(CharSequence name,
CharSequence value)
Sets a header with the specified
name and value. |
default BlockingStreamingHttpServerResponse |
setHeaders(HttpHeaders headers)
Clears the current header entries and copies all header entries of the specified
headers object. |
BlockingStreamingHttpServerResponse |
status(HttpResponseStatus status)
Set the status of this
StreamingHttpResponse. |
BlockingStreamingHttpServerResponse |
version(HttpProtocolVersion version)
Set the protocol version of this
HttpMetaData. |
statusHttpPayloadWriter<Buffer> sendMetaData()
HttpResponseMetaData and returns an HttpPayloadWriter to continue writing the payload
body.
Note: calling any other method on this class after calling this method is not allowed.
HttpPayloadWriter to write a payload bodyIllegalStateException - if one of the sendMetaData* methods has been called on this response@Deprecated default <T> HttpPayloadWriter<T> sendMetaData(HttpSerializer<T> serializer)
sendMetaData(HttpStreamingSerializer).HttpResponseMetaData to the client and returns an HttpPayloadWriter of type T
to continue writing a payload body. Each element will be serialized using provided serializer.
Note: calling any other method on this class after calling this method is not allowed.
T - the type of objects to writeserializer - used to serialize the payload elementsHttpPayloadWriter to write a payload bodyIllegalStateException - if one of the sendMetaData* methods has been called on this response<T> HttpPayloadWriter<T> sendMetaData(HttpStreamingSerializer<T> serializer)
HttpResponseMetaData to the client and returns an HttpPayloadWriter of type T
to continue writing a payload body. Each element will be serialized using provided serializer.
Note: calling any other method on this class after calling this method is not allowed.
T - the type of objects to writeserializer - used to serialize the payload elementsHttpPayloadWriter to write a payload bodyIllegalStateException - if one of the sendMetaData* methods has been called on this responseHttpOutputStream sendMetaDataOutputStream()
HttpResponseMetaData to the client and returns an OutputStream to continue writing a
payload body.
Note: calling any other method on this class after calling this method is not allowed.
HttpOutputStream to write a payload bodyIllegalStateException - if one of the sendMetaData* methods has been called on this responseBlockingStreamingHttpServerResponse version(HttpProtocolVersion version)
HttpMetaDataHttpMetaData.version in interface HttpMetaDataversion in interface HttpResponseMetaDataversion - the protocol version to set.this.BlockingStreamingHttpServerResponse status(HttpResponseStatus status)
HttpResponseMetaDataStreamingHttpResponse.status in interface HttpResponseMetaDatastatus - The HttpResponseStatus to set.this.default BlockingStreamingHttpServerResponse encoding(ContentCodec encoding)
HttpMetaDataContentCodec used to encode the payload of a request or a response.
If the endpoint is setup with ContentCodingHttpServiceFilter, the server will
auto-establish the accepted encoding for the response, unless the caller provides a specific encoding
by calling this method.
Any encoding passed here, takes precedence. In other words, a compressed response, can
be disabled by passing Identity.identity().encoding in interface HttpMetaDataencoding - The ContentCodec used for the encoding of the payload.this.default BlockingStreamingHttpServerResponse 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 BlockingStreamingHttpServerResponse addHeaders(HttpHeaders headers)
HttpMetaDataheaders object.addHeaders in interface HttpMetaDataaddHeaders in interface HttpResponseMetaDataheaders - the headers to add.this.default BlockingStreamingHttpServerResponse 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 BlockingStreamingHttpServerResponse setHeaders(HttpHeaders headers)
HttpMetaDataheaders object.setHeaders in interface HttpMetaDatasetHeaders in interface HttpResponseMetaDataheaders - the headers object which contains new values.this.default BlockingStreamingHttpServerResponse 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 BlockingStreamingHttpServerResponse 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 BlockingStreamingHttpServerResponse 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 BlockingStreamingHttpServerResponse 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.BlockingStreamingHttpServerResponse 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.