public abstract class BlockingStreamingHttpServerResponse
extends Object
HttpResponse but provides an ability to write the payload to an HttpPayloadWriter.BlockingStreamingHttpService| Modifier and Type | Method and Description |
|---|---|
BlockingStreamingHttpServerResponse |
addCookie(CharSequence name,
CharSequence value)
|
BlockingStreamingHttpServerResponse |
addCookie(HttpCookiePair cookie)
Adds a cookie.
|
BlockingStreamingHttpServerResponse |
addHeader(CharSequence name,
CharSequence value)
Adds a new header with the specified
name and value. |
BlockingStreamingHttpServerResponse |
addHeaders(HttpHeaders headers)
Adds all header names and values of
headers object. |
BlockingStreamingHttpServerResponse |
addSetCookie(CharSequence name,
CharSequence value)
|
BlockingStreamingHttpServerResponse |
addSetCookie(HttpSetCookie cookie)
Adds a set-cookie.
|
ContentCodec |
encoding()
Returns the
ContentCodec used to encode the payload of a request or a response. |
HttpMetaData |
encoding(ContentCodec encoding)
The
ContentCodec used to encode the payload of a request or a response. |
boolean |
equals(Object o) |
int |
hashCode() |
HttpHeaders |
headers()
Returns the headers of this message.
|
abstract HttpPayloadWriter<Buffer> |
sendMetaData()
Sends the
HttpResponseMetaData and returns an HttpPayloadWriter to continue writing the payload
body. |
<T> HttpPayloadWriter<T> |
sendMetaData(HttpSerializer<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. |
BlockingStreamingHttpServerResponse |
setHeader(CharSequence name,
CharSequence value)
Sets a header with the specified
name and value. |
BlockingStreamingHttpServerResponse |
setHeaders(HttpHeaders headers)
Clears the current header entries and copies all header entries of the specified
headers object. |
HttpResponseStatus |
status()
Returns the status of this
StreamingHttpResponse. |
BlockingStreamingHttpServerResponse |
status(HttpResponseStatus status)
Set the status of this
StreamingHttpResponse. |
String |
toString()
Returns a string representation of the message.
|
HttpProtocolVersion |
version()
Returns the protocol version of this
HttpMetaData. |
BlockingStreamingHttpServerResponse |
version(HttpProtocolVersion version)
Set the protocol version of this
HttpMetaData. |
public abstract HttpPayloadWriter<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 responsepublic final <T> HttpPayloadWriter<T> sendMetaData(HttpSerializer<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 responsepublic final HttpOutputStream 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 responsepublic BlockingStreamingHttpServerResponse version(HttpProtocolVersion version)
HttpMetaDataHttpMetaData.version in interface HttpMetaDataversion in interface HttpResponseMetaDataversion - the protocol version to set.this.public BlockingStreamingHttpServerResponse status(HttpResponseStatus status)
HttpResponseMetaDataStreamingHttpResponse.status in interface HttpResponseMetaDatastatus - The HttpResponseStatus to set.this.public BlockingStreamingHttpServerResponse addHeader(CharSequence name, CharSequence value)
HttpMetaDataname and value.name - the name of the header.value - the value of the header.this.public BlockingStreamingHttpServerResponse addHeaders(HttpHeaders headers)
HttpMetaDataheaders object.headers - the headers to add.this.public BlockingStreamingHttpServerResponse setHeader(CharSequence name, CharSequence value)
HttpMetaDataname and value. Any existing headers with the same name are
overwritten.name - the name of the header.value - the value of the header.this.public BlockingStreamingHttpServerResponse setHeaders(HttpHeaders headers)
HttpMetaDataheaders object.headers - the headers object which contains new values.this.public BlockingStreamingHttpServerResponse addCookie(HttpCookiePair cookie)
HttpMetaData
This may result in multiple HttpCookiePairs with same name.
cookie - the cookie to add.this.public 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.
name - the name of the cookie.value - the value of the cookie.this.public BlockingStreamingHttpServerResponse addSetCookie(HttpSetCookie cookie)
HttpMetaData
This may result in multiple HttpSetCookies with same name.
cookie - the cookie to add.this.public 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.
name - the name of the cookie.value - the value of the cookie.this.public final HttpResponseStatus status()
HttpResponseMetaDataStreamingHttpResponse.status in interface HttpResponseMetaDataHttpResponseStatus of this StreamingHttpResponsepublic final String toString()
HttpMetaDatatoString in interface HttpMetaDatatoString in class Objectpublic boolean equals(Object o)
public int hashCode()
public final HttpProtocolVersion version()
HttpMetaDataHttpMetaData.version in interface HttpMetaDatapublic HttpMetaData 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 ContentCodings.identity().encoding in interface HttpMetaDataencoding - The ContentCodec used for the encoding of the payload.this.public ContentCodec encoding()
HttpMetaDataContentCodec used to encode the payload of a request or a response.encoding in interface HttpMetaDataContentCodec used for the encoding of the payload.public final HttpHeaders headers()
HttpMetaDataheaders in interface HttpMetaData