public class HttpServerResponse<T> extends DefaultChannelWriter<T>
closeIssued, CONNECTION_ALREADY_CLOSED
Modifier | Constructor and Description |
---|---|
protected |
HttpServerResponse(io.netty.channel.Channel nettyChannel,
io.netty.handler.codec.http.HttpVersion httpVersion,
MetricEventsSubject<? extends ServerMetricsEvent<?>> eventsSubject) |
protected |
HttpServerResponse(io.netty.channel.Channel nettyChannel,
MetricEventsSubject<? extends ServerMetricsEvent<?>> eventsSubject) |
Modifier and Type | Method and Description |
---|---|
rx.Observable<java.lang.Void> |
_close(boolean flush) |
void |
addCookie(io.netty.handler.codec.http.Cookie cookie) |
rx.Observable<java.lang.Void> |
close() |
rx.Observable<java.lang.Void> |
close(boolean flush)
Closes this response with optionally flushing the writes.
|
void |
flushOnlyOnChannelReadComplete(boolean flushOnlyOnReadComplete)
Flush semantics of a response are as follows:
Flush immediately if
DefaultChannelWriter.flush() is called.
Flush at the completion of Observable returned by
RequestHandler.handle(HttpServerRequest, HttpServerResponse) if and only if
flushOnlyOnChannelReadComplete(boolean) is set to false (default is false).
Flush when ChannelHandlerContext.fireChannelReadComplete() event is fired by netty. |
HttpResponseHeaders |
getHeaders() |
io.netty.handler.codec.http.HttpResponseStatus |
getStatus() |
boolean |
isFlushOnlyOnReadComplete() |
void |
setStatus(io.netty.handler.codec.http.HttpResponseStatus status) |
void |
writeChunkedInput(io.netty.handler.codec.http.HttpChunkedInput httpChunkedInput) |
protected void |
writeHeadersIfNotWritten() |
protected io.netty.channel.ChannelFuture |
writeOnChannel(java.lang.Object msg) |
cancelPendingWrites, flush, getAllocator, getChannel, isCloseIssued, write, write, writeAndFlush, writeAndFlush, writeBytes, writeBytes, writeBytesAndFlush, writeBytesAndFlush, writeFileRegion, writeString, writeStringAndFlush
protected HttpServerResponse(io.netty.channel.Channel nettyChannel, MetricEventsSubject<? extends ServerMetricsEvent<?>> eventsSubject)
protected HttpServerResponse(io.netty.channel.Channel nettyChannel, io.netty.handler.codec.http.HttpVersion httpVersion, MetricEventsSubject<? extends ServerMetricsEvent<?>> eventsSubject)
public HttpResponseHeaders getHeaders()
public void addCookie(io.netty.handler.codec.http.Cookie cookie)
public void setStatus(io.netty.handler.codec.http.HttpResponseStatus status)
public io.netty.handler.codec.http.HttpResponseStatus getStatus()
public rx.Observable<java.lang.Void> close()
close
in interface ChannelWriter<T>
close
in class DefaultChannelWriter<T>
public rx.Observable<java.lang.Void> close(boolean flush)
close
in interface ChannelWriter<T>
close
in class DefaultChannelWriter<T>
flush
- If this close should also flush the writes.public rx.Observable<java.lang.Void> _close(boolean flush)
_close
in class DefaultChannelWriter<T>
public void writeChunkedInput(io.netty.handler.codec.http.HttpChunkedInput httpChunkedInput)
public void flushOnlyOnChannelReadComplete(boolean flushOnlyOnReadComplete)
DefaultChannelWriter.flush()
is called.Observable
returned by
RequestHandler.handle(HttpServerRequest, HttpServerResponse)
if and only if
flushOnlyOnChannelReadComplete(boolean)
is set to false (default is false).ChannelHandlerContext.fireChannelReadComplete()
event is fired by netty. This is done
unconditionally and is a no-op if there is nothing to flush.public boolean isFlushOnlyOnReadComplete()
protected io.netty.channel.ChannelFuture writeOnChannel(java.lang.Object msg)
writeOnChannel
in class DefaultChannelWriter<T>
protected void writeHeadersIfNotWritten()