Package org.springframework.http.server.reactive

# Class AbstractListenerServerHttpResponse

java.lang.Object
org.springframework.http.server.reactive.AbstractServerHttpResponse
org.springframework.http.server.reactive.AbstractListenerServerHttpResponse

All Implemented Interfaces:
  `HttpMessage`, `ReactiveHttpOutputMessage`, `ServerHttpResponse`

public abstract class AbstractListenerServerHttpResponse extends AbstractServerHttpResponse
Abstract base class for listener-based server responses.

Since:
  5.0
Author:
  Arjen Poutsma

## Constructor Summary

Constructors
Constructor
Description
`AbstractListenerServerHttpResponse(org.springframework.core.io.buffer.DataBufferFactory bufferFactory)`
`AbstractListenerServerHttpResponse(org.springframework.core.io.buffer.DataBufferFactory bufferFactory, HttpHeaders headers)`

## Method Summary

Modifier and Type
Method
Description
`protected abstract Processor<? super Publisher<? extends org.springframework.core.io.buffer.DataBuffer>,Void>`
`createBodyFlushProcessor()`
Abstract template method to create a `Processor<Publisher<DataBuffer>, Void>` that will write the response body with flushes to the underlying output.
`protected final reactor.core.publisher.Mono<Void>`
`writeAndFlushWithInternal(Publisher<? extends Publisher<? extends org.springframework.core.io.buffer.DataBuffer>> body)`
Write to the underlying the response, and flush after each `Publisher<DataBuffer>`.
`protected final reactor.core.publisher.Mono<Void>`
`writeWithInternal(Publisher<? extends org.springframework.core.io.buffer.DataBuffer> body)`
Write to the underlying the response.

### Methods inherited from class org.springframework.http.server.reactive.AbstractServerHttpResponse

`addCookie, applyCookies, applyHeaders, applyStatusCode, beforeCommit, bufferFactory, doCommit, doCommit, getCookies, getHeaders, getNativeResponse, getStatusCode, isCommitted, setComplete, setRawStatusCode, setStatusCode, touchDataBuffer, writeAndFlushWith, writeWith`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface org.springframework.http.server.reactive.ServerHttpResponse

`getRawStatusCode`

## Constructor Details

### AbstractListenerServerHttpResponse

public AbstractListenerServerHttpResponse(org.springframework.core.io.buffer.DataBufferFactory bufferFactory)

### AbstractListenerServerHttpResponse

public AbstractListenerServerHttpResponse(org.springframework.core.io.buffer.DataBufferFactory bufferFactory, HttpHeaders headers)

## Method Details

### writeWithInternal

protected final reactor.core.publisher.Mono<Void> writeWithInternal(Publisher<? extends org.springframework.core.io.buffer.DataBuffer> body)
Description copied from class: `AbstractServerHttpResponse`
Write to the underlying the response.

Specified by:
  `writeWithInternal` in class `AbstractServerHttpResponse`
Parameters:
  `body` - the publisher to write with

### writeAndFlushWithInternal

protected final reactor.core.publisher.Mono<Void> writeAndFlushWithInternal(Publisher<? extends Publisher<? extends org.springframework.core.io.buffer.DataBuffer>> body)
Description copied from class: `AbstractServerHttpResponse`
Write to the underlying the response, and flush after each `Publisher<DataBuffer>`.

Specified by:
  `writeAndFlushWithInternal` in class `AbstractServerHttpResponse`
Parameters:
  `body` - the publisher to write and flush with

### createBodyFlushProcessor

protected abstract Processor<? super Publisher<? extends org.springframework.core.io.buffer.DataBuffer>,Void> createBodyFlushProcessor()
Abstract template method to create a `Processor<Publisher<DataBuffer>, Void>` that will write the response body with flushes to the underlying output. Called from `writeAndFlushWithInternal(Publisher)`.