Class ServerHttpRequestDecorator
- java.lang.Object
- org.springframework.http.server.reactive.ServerHttpRequestDecorator
- All Implemented Interfaces:
HttpMessage
,HttpRequest
,ReactiveHttpInputMessage
,ServerHttpRequest
public class ServerHttpRequestDecorator extends Object implements ServerHttpRequest
Wraps anotherServerHttpRequest
and delegates all methods to it. Sub-classes can override specific methods selectively.- Since:
- 5.0
- Author:
- Rossen Stoyanchev
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.http.server.reactive.ServerHttpRequest
ServerHttpRequest.Builder
Constructor Summary
Constructors Constructor Description ServerHttpRequestDecorator(ServerHttpRequest delegate)
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description reactor.core.publisher.Flux<DataBuffer>
getBody()
Return the body of the message as aPublisher
.MultiValueMap<String,HttpCookie>
getCookies()
Return a read-only map of cookies sent by the client.ServerHttpRequest
getDelegate()
HttpHeaders
getHeaders()
Return the headers of this message.String
getId()
Return an id that represents the underlying connection, if available, or the request for the purpose of correlating log messages.InetSocketAddress
getLocalAddress()
Return the local address the request was accepted on, if available.HttpMethod
getMethod()
Return the HTTP method of the request.String
getMethodValue()
Return the HTTP method of the request as a String value.RequestPath
getPath()
Returns a structured representation of the request path including the context path + path within application portions, path segments with encoded and decoded values, and path parameters.MultiValueMap<String,String>
getQueryParams()
Return a read-only map with parsed and decoded query parameter values.InetSocketAddress
getRemoteAddress()
Return the remote address where this request is connected to, if available.SslInfo
getSslInfo()
Return the SSL session information if the request has been transmitted over a secure protocol including SSL certificates, if available.URI
getURI()
Return the URI of the request (including a query string if any, but only if it is well-formed for a URI representation).String
toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.http.server.reactive.ServerHttpRequest
mutate
Constructor Detail
ServerHttpRequestDecorator
public ServerHttpRequestDecorator(ServerHttpRequest delegate)
Method Detail
getDelegate
public ServerHttpRequest getDelegate()
getId
public String getId()
Description copied from interface:ServerHttpRequest
Return an id that represents the underlying connection, if available, or the request for the purpose of correlating log messages.- Specified by:
getId
in interfaceServerHttpRequest
- See Also:
ServerWebExchange.getLogPrefix()
getMethod
@Nullable public HttpMethod getMethod()
Description copied from interface:HttpRequest
Return the HTTP method of the request.- Specified by:
getMethod
in interfaceHttpRequest
- Returns:
- the HTTP method as an HttpMethod enum value, or
null
if not resolvable (e.g. in case of a non-standard HTTP method) - See Also:
HttpRequest.getMethodValue()
,HttpMethod.resolve(String)
getMethodValue
public String getMethodValue()
Description copied from interface:HttpRequest
Return the HTTP method of the request as a String value.- Specified by:
getMethodValue
in interfaceHttpRequest
- Returns:
- the HTTP method as a plain String
- See Also:
HttpRequest.getMethod()
getURI
public URI getURI()
Description copied from interface:HttpRequest
Return the URI of the request (including a query string if any, but only if it is well-formed for a URI representation).- Specified by:
getURI
in interfaceHttpRequest
- Returns:
- the URI of the request (never
null
)
getPath
public RequestPath getPath()
Description copied from interface:ServerHttpRequest
Returns a structured representation of the request path including the context path + path within application portions, path segments with encoded and decoded values, and path parameters.- Specified by:
getPath
in interfaceServerHttpRequest
getQueryParams
public MultiValueMap<String,String> getQueryParams()
Description copied from interface:ServerHttpRequest
Return a read-only map with parsed and decoded query parameter values.- Specified by:
getQueryParams
in interfaceServerHttpRequest
getHeaders
public HttpHeaders getHeaders()
Description copied from interface:HttpMessage
Return the headers of this message.- Specified by:
getHeaders
in interfaceHttpMessage
- Returns:
- a corresponding HttpHeaders object (never
null
)
getCookies
public MultiValueMap<String,HttpCookie> getCookies()
Description copied from interface:ServerHttpRequest
Return a read-only map of cookies sent by the client.- Specified by:
getCookies
in interfaceServerHttpRequest
getLocalAddress
@Nullable public InetSocketAddress getLocalAddress()
Description copied from interface:ServerHttpRequest
Return the local address the request was accepted on, if available.- Specified by:
getLocalAddress
in interfaceServerHttpRequest
getRemoteAddress
@Nullable public InetSocketAddress getRemoteAddress()
Description copied from interface:ServerHttpRequest
Return the remote address where this request is connected to, if available.- Specified by:
getRemoteAddress
in interfaceServerHttpRequest
getSslInfo
@Nullable public SslInfo getSslInfo()
Description copied from interface:ServerHttpRequest
Return the SSL session information if the request has been transmitted over a secure protocol including SSL certificates, if available.- Specified by:
getSslInfo
in interfaceServerHttpRequest
- Returns:
- the session information, or
null
if none available
getBody
public reactor.core.publisher.Flux<DataBuffer> getBody()
Description copied from interface:ReactiveHttpInputMessage
Return the body of the message as aPublisher
.- Specified by:
getBody
in interfaceReactiveHttpInputMessage
- Returns:
- the body content publisher