ServerHttpResponse to the Undertow HttpServerExchange.
| Modifier and Type | Class and Description |
|---|---|
| private class | |
| private class | |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private final HttpServerExchange | |
| private final UndertowServerHttpRequest | |
| private StreamSinkChannel |
| Access | Constructor and Description |
|---|---|
| pack-priv | UndertowServerHttpResponse(HttpServerExchange exchange, DataBufferFactory bufferFactory, UndertowServerHttpRequest request)
|
| Modifier and Type | Method and Description |
|---|---|
| protected void | applyCookies()
Implements abstract org. getHeaders() to the underlying response.
|
| protected void | applyHeaders()
Implements abstract org. |
| protected void | applyStatusCode()
Implements abstract org. |
| protected Processor | createBodyFlushProcessor()
Implements abstract org. Processor<Publisher<DataBuffer>, Void>
that will write the response body with flushes to the underlying output.
|
| private UndertowServerHttpResponse. | |
| private static HttpHeaders | |
| public <T> T | getNativeResponse()
Implements abstract org. |
| public Integer | getRawStatusCode()
Overrides org. Overrides default org.
Deprecated
Return the status code that has been set, or otherwise fall back on the
status of the response from the underlying server.
|
| public HttpStatusCode | getStatusCode()
Overrides org. Implements org. |
| public Mono | writeWith(Path
the file to transfer file, long the position within the file from which the transfer is to begin position, long the number of bytes to be transferred count)Implements org. Path to write the body of the message to the underlying
HTTP layer.
|
| exchange | back to summary |
|---|---|
| private final HttpServerExchange exchange | |
| request | back to summary |
|---|---|
| private final UndertowServerHttpRequest request | |
| responseChannel | back to summary |
|---|---|
| private StreamSinkChannel responseChannel
| |
| UndertowServerHttpResponse | back to summary |
|---|---|
| pack-priv UndertowServerHttpResponse(HttpServerExchange exchange, DataBufferFactory bufferFactory, UndertowServerHttpRequest request) | |
| applyCookies | back to summary |
|---|---|
| protected void applyCookies() Implements abstract org. Doc from org. Add cookies from
| |
| applyHeaders | back to summary |
|---|---|
| protected void applyHeaders() Implements abstract org. Doc from org. Invoked when the response is getting committed allowing subclasses to make apply header values to the underlying response. Note that some subclasses use an
| |
| applyStatusCode | back to summary |
|---|---|
| protected void applyStatusCode() Implements abstract org. Doc from org. Write the status code to the underlying response. This method is called once only.
| |
| createBodyFlushProcessor | back to summary |
|---|---|
| protected Processor Implements abstract org. Doc from org. Abstract template method to create a
| |
| createBodyProcessor | back to summary |
|---|---|
| private UndertowServerHttpResponse. | |
| createHeaders | back to summary |
|---|---|
| private static HttpHeaders createHeaders(HttpServerExchange exchange) | |
| getNativeResponse | back to summary |
|---|---|
| public <T> T getNativeResponse() Implements abstract org. Doc from org. Return the underlying server response. Note This is exposed mainly for internal framework use such as WebSocket upgrades in the spring-webflux module.
| |
| getRawStatusCode | back to summary |
|---|---|
| public Integer getRawStatusCode() Overrides org. Overrides default org. Doc from org. Deprecated
Return the status code that has been set, or otherwise fall back on the
status of the response from the underlying server. The return value may
be
| |
| getStatusCode | back to summary |
|---|---|
| public HttpStatusCode getStatusCode() Overrides org. Implements org. Doc from org. Return the status code that has been set, or otherwise fall back on the
status of the response from the underlying server. The return value may
be
| |
| writeWith | back to summary |
|---|---|
| public Mono Implements org. Doc from org. Use the given | |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected Processor | createWriteProcessor()
Implements abstract org. |
| protected void | flush()
Implements abstract org. isFlushPending() should
return true after.
|
| protected boolean | isFlushPending()
Implements abstract org. |
| protected boolean | isWritePossible()
Implements abstract org. |
| ResponseBodyFlushProcessor | back to summary |
|---|---|
| public ResponseBodyFlushProcessor() | |
| createWriteProcessor | back to summary |
|---|---|
| protected Processor Implements abstract org. Doc from org. Create a new processor for the current flush boundary.
| |
| flush | back to summary |
|---|---|
| protected void flush() throws IOException Implements abstract org. Doc from org. Flush the output if ready, or otherwise This is primarily for the Servlet non-blocking I/O API where flush cannot be called without a readyToWrite check.
| |
| isFlushPending | back to summary |
|---|---|
| protected boolean isFlushPending() Implements abstract org. Doc from org. Whether flushing is pending. This is primarily for the Servlet non-blocking I/O API where flush cannot be called without a readyToWrite check.
| |
| isWritePossible | back to summary |
|---|---|
| protected boolean isWritePossible() Implements abstract org. Doc from org. Whether writing/flushing is possible.
| |
| Modifier and Type | Field and Description |
|---|---|
| private volatile ByteBuffer | |
| private final StreamSinkChannel | |
| private volatile boolean | writePossible
Keep track of write listener calls, for |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected void | dataReceived(DataBuffer dataBuffer)
Overrides org. Subscriber#onNext(Object).
|
| protected void | discardData(DataBuffer
the data to be released dataBuffer)Implements abstract org. |
| protected boolean | isDataEmpty(DataBuffer dataBuffer)
Implements abstract org. |
| protected boolean | isWritePossible()
Implements abstract org. |
| protected boolean | write(DataBuffer
the item to write dataBuffer)Implements abstract org. |
| private int | |
| protected void | writingComplete()
Overrides org. |
| protected void | writingFailed(Throwable ex)
Overrides org. |
| byteBuffer | back to summary |
|---|---|
| private volatile ByteBuffer byteBuffer
| |
| channel | back to summary |
|---|---|
| private final StreamSinkChannel channel | |
| writePossible | back to summary |
|---|---|
| private volatile boolean writePossible Keep track of write listener calls, for | |
| ResponseBodyProcessor | back to summary |
|---|---|
| public ResponseBodyProcessor(StreamSinkChannel channel) | |
| dataReceived | back to summary |
|---|---|
| protected void dataReceived(DataBuffer dataBuffer) Overrides org. Doc from org. Template method invoked after a data item to write is received via
| |
| discardData | back to summary |
|---|---|
| protected void discardData(DataBuffer dataBuffer) Implements abstract org. Doc from org. Invoked after any error (either from the upstream write Publisher, or from I/O operations to the underlying server) and cancellation to discard in-flight data that was in the process of being written when the error took place.
| |
| isDataEmpty | back to summary |
|---|---|
| protected boolean isDataEmpty(DataBuffer dataBuffer) Implements abstract org. Doc from org. Whether the given data item has any content to write. If false the item is not written.
| |
| isWritePossible | back to summary |
|---|---|
| protected boolean isWritePossible() Implements abstract org. Doc from org. Whether writing is possible.
| |
| write | back to summary |
|---|---|
| protected boolean write(DataBuffer dataBuffer) throws IOException Implements abstract org. Doc from org. Write the given item. Note Sub-classes are responsible for releasing any data buffer associated with the item, once fully written, if pooled buffers apply to the underlying container.
| |
| writeByteBuffer | back to summary |
|---|---|
| private int writeByteBuffer(ByteBuffer byteBuffer) throws IOException | |
| writingComplete | back to summary |
|---|---|
| protected void writingComplete() Overrides org. Doc from org. Invoked after onComplete or onError notification. The default implementation is a no-op.
| |
| writingFailed | back to summary |
|---|---|
| protected void writingFailed(Throwable ex) Overrides org. Doc from org. Invoked when an I/O error occurs during a write. Subclasses may choose to ignore this if they know the underlying API will provide an error notification in a container thread. Defaults to no-op.
| |
| Modifier and Type | Field and Description |
|---|---|
| private long | |
| private long | |
| private final MonoSink | |
| private final FileChannel |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void |
| count | back to summary |
|---|---|
| private long count | |
| position | back to summary |
|---|---|
| private long position | |
| sink | back to summary |
|---|---|
| private final MonoSink<Void> sink | |
| source | back to summary |
|---|---|
| private final FileChannel source | |
| TransferBodyListener | back to summary |
|---|---|
| public TransferBodyListener(FileChannel source, long position, long count, MonoSink<Void> sink) | |
| closeSource | back to summary |
|---|---|
| public void closeSource() | |
| transfer | back to summary |
|---|---|
| public void transfer(StreamSinkChannel destination) | |