类 ServletServerHttpRequest
java.lang.Object
cn.taketoday.http.server.reactive.AbstractServerHttpRequest
cn.taketoday.http.server.reactive.ServletServerHttpRequest
- 所有已实现的接口:
HttpMessage,HttpRequest,ReactiveHttpInputMessage,ServerHttpRequest
Adapt
ServerHttpRequest to the Servlet HttpServletRequest.- 从以下版本开始:
- 4.0
- 作者:
- Rossen Stoyanchev
-
嵌套类概要
嵌套类修饰符和类型类说明private final classprivate class从接口继承的嵌套类/接口 cn.taketoday.http.server.reactive.ServerHttpRequest
ServerHttpRequest.Builder -
字段概要
字段修饰符和类型字段说明private final AsyncListenerprivate final ServletServerHttpRequest.RequestBodyPublisherprivate final byte[]private final cn.taketoday.core.io.buffer.DataBufferFactoryprivate final Object(专用程序包) static final cn.taketoday.core.io.buffer.DataBufferprivate final ServletInputStreamprivate final HttpServletRequest -
构造器概要
构造器构造器说明ServletServerHttpRequest(cn.taketoday.util.MultiValueMap<String, String> headers, HttpServletRequest request, AsyncContext asyncContext, String servletPath, cn.taketoday.core.io.buffer.DataBufferFactory bufferFactory, int bufferSize) ServletServerHttpRequest(HttpServletRequest request, AsyncContext asyncContext, String servletPath, cn.taketoday.core.io.buffer.DataBufferFactory bufferFactory, int bufferSize) -
方法概要
修饰符和类型方法说明(专用程序包) AsyncListenerReturn anServletServerHttpRequest.RequestAsyncListenerthat completes the request body Publisher when the Servlet container notifies that request input has ended.reactor.core.publisher.Flux<cn.taketoday.core.io.buffer.DataBuffer>getBody()Return the body of the message as aPublisher.protected final ServletInputStreamReturn theServletInputStreamfor the current response.Return the local address the request was accepted on, if available.Return the HTTP method of the request as a String value.<T> TReturn the underlying server response.Return the remote address where this request is connected to, if available.private Stringprivate X509Certificate[]protected cn.taketoday.util.MultiValueMap<String,HttpCookie> Obtain the cookies from the underlying "native" request and adapt those to anHttpCookiemap.initHeaders(cn.taketoday.util.MultiValueMap<String, String> headerValues, HttpServletRequest request) protected SslInfoObtain SSL session information from the underlying "native" request.private static URIinitUri(HttpServletRequest request) protected final voidlogBytesRead(int read) (专用程序包) cn.taketoday.core.io.buffer.DataBufferRead from the request body InputStream and return a DataBuffer.从类继承的方法 cn.taketoday.http.server.reactive.AbstractServerHttpRequest
getCookies, getHeaders, getId, getLogPrefix, getMethod, getPath, getQueryParams, getSslInfo, getURI, initId, initLogPrefix, initQueryParams从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait从接口继承的方法 cn.taketoday.http.server.reactive.ServerHttpRequest
mutate
-
字段详细资料
-
EOF_BUFFER
static final cn.taketoday.core.io.buffer.DataBuffer EOF_BUFFER -
cookieLock
-
buffer
private final byte[] buffer -
request
-
asyncListener
-
inputStream
-
bufferFactory
private final cn.taketoday.core.io.buffer.DataBufferFactory bufferFactory -
bodyPublisher
-
-
构造器详细资料
-
ServletServerHttpRequest
public ServletServerHttpRequest(HttpServletRequest request, AsyncContext asyncContext, String servletPath, cn.taketoday.core.io.buffer.DataBufferFactory bufferFactory, int bufferSize) throws IOException, URISyntaxException -
ServletServerHttpRequest
public ServletServerHttpRequest(cn.taketoday.util.MultiValueMap<String, String> headers, HttpServletRequest request, AsyncContext asyncContext, String servletPath, cn.taketoday.core.io.buffer.DataBufferFactory bufferFactory, int bufferSize) throws IOException, URISyntaxException
-
-
方法详细资料
-
createDefaultHttpHeaders
private static cn.taketoday.util.MultiValueMap<String,String> createDefaultHttpHeaders(HttpServletRequest request) -
initUri
-
initHeaders
private static cn.taketoday.util.MultiValueMap<String,String> initHeaders(cn.taketoday.util.MultiValueMap<String, String> headerValues, HttpServletRequest request) -
getMethodValue
从接口复制的说明:HttpRequestReturn the HTTP method of the request as a String value.- 返回:
- the HTTP method as a plain String
- 另请参阅:
-
initCookies
从类复制的说明:AbstractServerHttpRequestObtain the cookies from the underlying "native" request and adapt those to anHttpCookiemap. The return value is turned into an immutable map and cached.Note that this method is invoked lazily on access to
AbstractServerHttpRequest.getCookies(). Sub-classes should synchronize cookie initialization if the underlying "native" request does not provide thread-safe access to cookie data.- 指定者:
initCookies在类中AbstractServerHttpRequest
-
getLocalAddress
从接口复制的说明:ServerHttpRequestReturn the local address the request was accepted on, if available. -
getRemoteAddress
从接口复制的说明:ServerHttpRequestReturn the remote address where this request is connected to, if available. -
initSslInfo
从类复制的说明:AbstractServerHttpRequestObtain SSL session information from the underlying "native" request.- 指定者:
initSslInfo在类中AbstractServerHttpRequest- 返回:
- the session information, or
nullif none available
-
getSslSessionId
-
getX509Certificates
-
getBody
public reactor.core.publisher.Flux<cn.taketoday.core.io.buffer.DataBuffer> getBody()从接口复制的说明:ReactiveHttpInputMessageReturn the body of the message as aPublisher.- 返回:
- the body content publisher
-
getNativeRequest
public <T> T getNativeRequest()从类复制的说明:AbstractServerHttpRequestReturn the underlying server response. -
getAsyncListener
AsyncListener getAsyncListener()Return anServletServerHttpRequest.RequestAsyncListenerthat completes the request body Publisher when the Servlet container notifies that request input has ended. The listener is not actually registered but is rather exposed forServletHttpHandlerAdapterto ensure events are delegated. -
getInputStream
Return theServletInputStreamfor the current response. -
readFromInputStream
Read from the request body InputStream and return a DataBuffer. Invoked only whenServletInputStream.isReady()returns "true".- 返回:
- a DataBuffer with data read, or
AbstractListenerReadPublisher.EMPTY_BUFFERif 0 bytes were read, orEOF_BUFFERif the input stream returned -1. - 抛出:
IOException
-
logBytesRead
protected final void logBytesRead(int read)
-