public class UndertowServerHttpResponse extends AbstractListenerServerHttpResponse implements ZeroCopyHttpOutputMessage
ServerHttpResponse
to the Undertow HttpServerExchange
.Modifier and Type | Class and Description |
---|---|
private class |
UndertowServerHttpResponse.ResponseBodyFlushProcessor |
private static class |
UndertowServerHttpResponse.ResponseBodyProcessor |
Modifier and Type | Field and Description |
---|---|
private HttpServerExchange |
exchange |
private StreamSinkChannel |
responseChannel |
Constructor and Description |
---|
UndertowServerHttpResponse(HttpServerExchange exchange,
DataBufferFactory bufferFactory) |
Modifier and Type | Method and Description |
---|---|
protected void |
applyCookies()
Implement this method to add cookies from
AbstractServerHttpResponse.getHeaders() to the
underlying response. |
protected void |
applyHeaders()
Implement this method to apply header changes from
AbstractServerHttpResponse.getHeaders()
to the underlying response. |
protected void |
applyStatusCode()
Implement this method to write the status code to the underlying response.
|
protected <any> |
createBodyFlushProcessor()
Abstract template method to create a
Processor<Publisher<DataBuffer>, Void>
that will write the response body with flushes to the underlying output. |
private UndertowServerHttpResponse.ResponseBodyProcessor |
createBodyProcessor() |
HttpServerExchange |
getUndertowExchange() |
<any> |
writeWith(java.io.File file,
long position,
long count)
Use the given
File to write the body of the message to the underlying
HTTP layer. |
writeAndFlushWithInternal, writeWithInternal
beforeCommit, bufferFactory, doCommit, doCommit, encodeUrl, getCookies, getHeaders, getStatusCode, isCommitted, registerUrlEncoder, setComplete, setStatusCode, writeAndFlushWith, writeWith
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
beforeCommit, bufferFactory, isCommitted, setComplete, writeAndFlushWith, writeWith
getHeaders
private final HttpServerExchange exchange
private StreamSinkChannel responseChannel
public UndertowServerHttpResponse(HttpServerExchange exchange, DataBufferFactory bufferFactory)
public HttpServerExchange getUndertowExchange()
protected void applyStatusCode()
AbstractServerHttpResponse
applyStatusCode
in class AbstractServerHttpResponse
public <any> writeWith(java.io.File file, long position, long count)
ZeroCopyHttpOutputMessage
File
to write the body of the message to the underlying
HTTP layer.writeWith
in interface ZeroCopyHttpOutputMessage
file
- the file to transferposition
- the position within the file from which the transfer is to begincount
- the number of bytes to be transferredprotected void applyHeaders()
AbstractServerHttpResponse
AbstractServerHttpResponse.getHeaders()
to the underlying response. This method is called once only.applyHeaders
in class AbstractServerHttpResponse
protected void applyCookies()
AbstractServerHttpResponse
AbstractServerHttpResponse.getHeaders()
to the
underlying response. This method is called once only.applyCookies
in class AbstractServerHttpResponse
protected <any> createBodyFlushProcessor()
AbstractListenerServerHttpResponse
Processor<Publisher<DataBuffer>, Void>
that will write the response body with flushes to the underlying output. Called from
#writeAndFlushWithInternal(Publisher)
.createBodyFlushProcessor
in class AbstractListenerServerHttpResponse
private UndertowServerHttpResponse.ResponseBodyProcessor createBodyProcessor()