public abstract class BlockingStreamingHttpServerResponse
extends java.lang.Object
HttpResponse
but provides an ability to write the payload to an HttpPayloadWriter
.BlockingStreamingHttpService
Modifier and Type | Method and Description |
---|---|
BlockingStreamingHttpServerResponse |
addCookie(java.lang.CharSequence name,
java.lang.CharSequence value)
|
BlockingStreamingHttpServerResponse |
addCookie(HttpCookiePair cookie)
Adds a cookie.
|
BlockingStreamingHttpServerResponse |
addHeader(java.lang.CharSequence name,
java.lang.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(java.lang.CharSequence name,
java.lang.CharSequence value)
|
BlockingStreamingHttpServerResponse |
addSetCookie(HttpSetCookie cookie)
Adds a set-cookie.
|
boolean |
equals(java.lang.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(java.lang.CharSequence name,
java.lang.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 . |
java.lang.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 . |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
headers, toString, version
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 bodyjava.lang.IllegalStateException
- 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 bodyjava.lang.IllegalStateException
- 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 bodyjava.lang.IllegalStateException
- if one of the sendMetaData*
methods has been called on this responsepublic BlockingStreamingHttpServerResponse version(HttpProtocolVersion version)
HttpMetaData
HttpMetaData
.version
in interface HttpMetaData
version
in interface HttpResponseMetaData
version
- the protocol version to set.this
.public BlockingStreamingHttpServerResponse status(HttpResponseStatus status)
HttpResponseMetaData
StreamingHttpResponse
.status
in interface HttpResponseMetaData
status
- The HttpResponseStatus
to set.this
.public BlockingStreamingHttpServerResponse addHeader(java.lang.CharSequence name, java.lang.CharSequence value)
HttpMetaData
name
and value
.name
- the name of the header.value
- the value of the header.this
.public BlockingStreamingHttpServerResponse addHeaders(HttpHeaders headers)
HttpMetaData
headers
object.headers
- the headers to add.this
.public BlockingStreamingHttpServerResponse setHeader(java.lang.CharSequence name, java.lang.CharSequence value)
HttpMetaData
name
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)
HttpMetaData
headers
object.headers
- the headers object which contains new values.this
.public BlockingStreamingHttpServerResponse addCookie(HttpCookiePair cookie)
HttpMetaData
This may result in multiple HttpCookiePair
s with same name.
cookie
- the cookie to add.this
.public BlockingStreamingHttpServerResponse 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.
name
- the name of the cookie.value
- the value of the cookie.this
.public BlockingStreamingHttpServerResponse addSetCookie(HttpSetCookie cookie)
HttpMetaData
This may result in multiple HttpSetCookie
s with same name.
cookie
- the cookie to add.this
.public BlockingStreamingHttpServerResponse 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.
name
- the name of the cookie.value
- the value of the cookie.this
.public final HttpResponseStatus status()
HttpResponseMetaData
StreamingHttpResponse
.status
in interface HttpResponseMetaData
HttpResponseStatus
of this StreamingHttpResponse
public final java.lang.String toString()
HttpMetaData
toString
in interface HttpMetaData
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
public int hashCode()
public final HttpProtocolVersion version()
HttpMetaData
HttpMetaData
.version
in interface HttpMetaData
public final HttpHeaders headers()
HttpMetaData
headers
in interface HttpMetaData