org.springframework.web.server

Class ServerWebExchangeDecorator

  • java.lang.Object
    • org.springframework.web.server.ServerWebExchangeDecorator
    • Constructor Detail

      • ServerWebExchangeDecorator

        protected ServerWebExchangeDecorator(ServerWebExchange delegate)
    • Method Detail

      • getAttributes

        public java.util.Map<java.lang.String,java.lang.Object> getAttributes()
        Description copied from interface: ServerWebExchange
        Return a mutable map of request attributes for the current exchange.
        Specified by:
        getAttributes in interface ServerWebExchange
      • getSession

        public reactor.core.publisher.Mono<WebSession> getSession()
        Description copied from interface: ServerWebExchange
        Return the web session for the current request. Always guaranteed to return an instance either matching to the session id requested by the client, or with a new session id either because the client did not specify one or because the underlying session had expired. Use of this method does not automatically create a session. See WebSession for more details.
        Specified by:
        getSession in interface ServerWebExchange
      • getPrincipal

        public <T extends java.security.Principal> reactor.core.publisher.Mono<T> getPrincipal()
        Description copied from interface: ServerWebExchange
        Return the authenticated user for the request, if any.
        Specified by:
        getPrincipal in interface ServerWebExchange
      • getFormData

        public reactor.core.publisher.Mono<MultiValueMap<java.lang.String,java.lang.String>> getFormData()
        Description copied from interface: ServerWebExchange
        Return the form data from the body of the request if the Content-Type is "application/x-www-form-urlencoded" or an empty map otherwise.

        Note: calling this method causes the request body to be read and parsed in full and the resulting MultiValueMap is cached so that this method is safe to call more than once.

        Specified by:
        getFormData in interface ServerWebExchange
      • getMultipartData

        public reactor.core.publisher.Mono<MultiValueMap<java.lang.String,Part>> getMultipartData()
        Description copied from interface: ServerWebExchange
        Return the parts of a multipart request if the Content-Type is "multipart/form-data" or an empty map otherwise.

        Note: calling this method causes the request body to be read and parsed in full and the resulting MultiValueMap is cached so that this method is safe to call more than once.

        Specified by:
        getMultipartData in interface ServerWebExchange
      • isNotModified

        public boolean isNotModified()
        Description copied from interface: ServerWebExchange
        Returns true if the one of the checkNotModified methods in this contract were used and they returned true.
        Specified by:
        isNotModified in interface ServerWebExchange
      • checkNotModified

        public boolean checkNotModified(@Nullable
                                        java.lang.String etag,
                                        java.time.Instant lastModified)
        Description copied from interface: ServerWebExchange
        Check whether the requested resource has been modified given the supplied ETag (entity tag) and last-modified timestamp as determined by the application. Also transparently prepares the response, setting HTTP status, and adding "ETag" and "Last-Modified" headers when applicable. This method works with conditional GET/HEAD requests as well as with conditional POST/PUT/DELETE requests.

        Note: The HTTP specification recommends setting both ETag and Last-Modified values, but you can also use #checkNotModified(String) or ServerWebExchange.checkNotModified(Instant).

        Specified by:
        checkNotModified in interface ServerWebExchange
        Parameters:
        etag - the entity tag that the application determined for the underlying resource. This parameter will be padded with quotes (") if necessary.
        lastModified - the last-modified timestamp that the application determined for the underlying resource
        Returns:
        true if the request does not require further processing.
      • addUrlTransformer

        public void addUrlTransformer(java.util.function.Function<java.lang.String,java.lang.String> transformer)
        Description copied from interface: ServerWebExchange
        Register an additional URL transformation function for use with ServerWebExchange.transformUrl(java.lang.String). The given function can be used to insert an id for authentication, a nonce for CSRF protection, etc.

        Note that the given function is applied after any previously registered functions.

        Specified by:
        addUrlTransformer in interface ServerWebExchange
        Parameters:
        transformer - a URL transformation function to add
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object