Class CachedBodyOutputMessage

java.lang.Object
org.springframework.cloud.gateway.filter.factory.rewrite.CachedBodyOutputMessage
All Implemented Interfaces:
org.springframework.http.HttpMessage, org.springframework.http.ReactiveHttpOutputMessage

public class CachedBodyOutputMessage extends Object implements org.springframework.http.ReactiveHttpOutputMessage
Implementation of ClientHttpRequest that saves body as a field.
  • Constructor Summary

    Constructors
    Constructor
    Description
    CachedBodyOutputMessage(org.springframework.web.server.ServerWebExchange exchange, org.springframework.http.HttpHeaders httpHeaders)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    beforeCommit(Supplier<? extends reactor.core.publisher.Mono<Void>> action)
     
    org.springframework.core.io.buffer.DataBufferFactory
     
    reactor.core.publisher.Flux<org.springframework.core.io.buffer.DataBuffer>
    Return the request body, or an error stream if the body was never set or when.
    org.springframework.http.HttpHeaders
     
    boolean
     
    reactor.core.publisher.Mono<Void>
     
    reactor.core.publisher.Mono<Void>
    writeAndFlushWith(org.reactivestreams.Publisher<? extends org.reactivestreams.Publisher<? extends org.springframework.core.io.buffer.DataBuffer>> body)
     
    reactor.core.publisher.Mono<Void>
    writeWith(org.reactivestreams.Publisher<? extends org.springframework.core.io.buffer.DataBuffer> body)
     

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CachedBodyOutputMessage

      public CachedBodyOutputMessage(org.springframework.web.server.ServerWebExchange exchange, org.springframework.http.HttpHeaders httpHeaders)
  • Method Details

    • beforeCommit

      public void beforeCommit(Supplier<? extends reactor.core.publisher.Mono<Void>> action)
      Specified by:
      beforeCommit in interface org.springframework.http.ReactiveHttpOutputMessage
    • isCommitted

      public boolean isCommitted()
      Specified by:
      isCommitted in interface org.springframework.http.ReactiveHttpOutputMessage
    • getHeaders

      public org.springframework.http.HttpHeaders getHeaders()
      Specified by:
      getHeaders in interface org.springframework.http.HttpMessage
    • bufferFactory

      public org.springframework.core.io.buffer.DataBufferFactory bufferFactory()
      Specified by:
      bufferFactory in interface org.springframework.http.ReactiveHttpOutputMessage
    • getBody

      public reactor.core.publisher.Flux<org.springframework.core.io.buffer.DataBuffer> getBody()
      Return the request body, or an error stream if the body was never set or when.
      Returns:
      body as Flux
    • writeWith

      public reactor.core.publisher.Mono<Void> writeWith(org.reactivestreams.Publisher<? extends org.springframework.core.io.buffer.DataBuffer> body)
      Specified by:
      writeWith in interface org.springframework.http.ReactiveHttpOutputMessage
    • writeAndFlushWith

      public reactor.core.publisher.Mono<Void> writeAndFlushWith(org.reactivestreams.Publisher<? extends org.reactivestreams.Publisher<? extends org.springframework.core.io.buffer.DataBuffer>> body)
      Specified by:
      writeAndFlushWith in interface org.springframework.http.ReactiveHttpOutputMessage
    • setComplete

      public reactor.core.publisher.Mono<Void> setComplete()
      Specified by:
      setComplete in interface org.springframework.http.ReactiveHttpOutputMessage