类 AbstractServerHttpRequest

java.lang.Object
cn.taketoday.http.server.reactive.AbstractServerHttpRequest
所有已实现的接口:
HttpMessage, HttpRequest, ReactiveHttpInputMessage, ServerHttpRequest
直接已知子类:
DefaultServerHttpRequestBuilder.MutatedServerHttpRequest, ReactorNetty2ServerHttpRequest, ReactorServerHttpRequest, ServletServerHttpRequest, UndertowServerHttpRequest

public abstract class AbstractServerHttpRequest extends Object implements ServerHttpRequest
Common base class for ServerHttpRequest implementations.
从以下版本开始:
4.0
作者:
Rossen Stoyanchev
  • 字段详细资料

    • QUERY_PATTERN

      private static final Pattern QUERY_PATTERN
    • uri

      private final URI uri
    • path

      private final RequestPath path
    • headers

      private final HttpHeaders headers
    • queryParams

      @Nullable private cn.taketoday.util.MultiValueMap<String,String> queryParams
    • cookies

      @Nullable private cn.taketoday.util.MultiValueMap<String,HttpCookie> cookies
    • sslInfo

      @Nullable private SslInfo sslInfo
    • id

      @Nullable private String id
    • logPrefix

      @Nullable private String logPrefix
    • method

      @Nullable private HttpMethod method
  • 构造器详细资料

    • AbstractServerHttpRequest

      public AbstractServerHttpRequest(URI uri, @Nullable String contextPath, cn.taketoday.util.MultiValueMap<String,String> headers)
      Constructor with the URI and headers for the request.
      参数:
      uri - the URI for the request
      contextPath - the context path for the request
      headers - the headers for the request (as MultiValueMap)
    • AbstractServerHttpRequest

      public AbstractServerHttpRequest(URI uri, @Nullable String contextPath, HttpHeaders headers)
      Constructor with the URI and headers for the request.
      参数:
      uri - the URI for the request
      contextPath - the context path for the request
      headers - the headers for the request (as HttpHeaders)
    • AbstractServerHttpRequest

      public AbstractServerHttpRequest(HttpMethod method, URI uri, @Nullable String contextPath, cn.taketoday.util.MultiValueMap<String,String> headers)
      Constructor with the method, URI and headers for the request.
      参数:
      method - the HTTP method for the request
      uri - the URI for the request
      contextPath - the context path for the request
      headers - the headers for the request (as MultiValueMap)
  • 方法详细资料

    • getId

      public String getId()
      从接口复制的说明: ServerHttpRequest
      Return an id that represents the underlying connection, if available, or the request for the purpose of correlating log messages.
      指定者:
      getId 在接口中 ServerHttpRequest
    • initId

      @Nullable protected String initId()
      Obtain the request id to use, or null in which case the Object identity of this request instance is used.
    • getMethod

      public HttpMethod getMethod()
      从接口复制的说明: HttpRequest
      Return the HTTP method of the request.
      指定者:
      getMethod 在接口中 HttpRequest
      返回:
      the HTTP method as an HttpMethod value
      另请参阅:
    • getURI

      public URI getURI()
      从接口复制的说明: HttpRequest
      Return the URI of the request (including a query string if any, but only if it is well-formed for a URI representation).
      指定者:
      getURI 在接口中 HttpRequest
      返回:
      the URI of the request (never null)
    • getPath

      public RequestPath getPath()
      从接口复制的说明: ServerHttpRequest
      Returns a structured representation of the full request path up to but not including the query.

      The returned path is sub-divided into a RequestPath.contextPath() portion and the remaining pathWithinApplication portion. The latter can be passed into methods of PathPattern for path matching purposes.

      指定者:
      getPath 在接口中 ServerHttpRequest
    • getHeaders

      public HttpHeaders getHeaders()
      从接口复制的说明: HttpMessage
      Return the headers of this message.
      指定者:
      getHeaders 在接口中 HttpMessage
      返回:
      a corresponding HttpHeaders object (never null)
    • getQueryParams

      public cn.taketoday.util.MultiValueMap<String,String> getQueryParams()
      从接口复制的说明: ServerHttpRequest
      Return a read-only map with parsed and decoded query parameter values.
      指定者:
      getQueryParams 在接口中 ServerHttpRequest
    • initQueryParams

      protected cn.taketoday.util.MultiValueMap<String,String> initQueryParams()
      A method for parsing of the query into name-value pairs. The return value is turned into an immutable map and cached.

      Note that this method is invoked lazily on first access to getQueryParams(). The invocation is not synchronized but the parsing is thread-safe nevertheless.

    • decodeQueryParam

      private String decodeQueryParam(String value)
    • getCookies

      public cn.taketoday.util.MultiValueMap<String,HttpCookie> getCookies()
      从接口复制的说明: ServerHttpRequest
      Return a read-only map of cookies sent by the client.
      指定者:
      getCookies 在接口中 ServerHttpRequest
    • initCookies

      protected abstract cn.taketoday.util.MultiValueMap<String,HttpCookie> initCookies()
      Obtain the cookies from the underlying "native" request and adapt those to an HttpCookie map. The return value is turned into an immutable map and cached.

      Note that this method is invoked lazily on access to getCookies(). Sub-classes should synchronize cookie initialization if the underlying "native" request does not provide thread-safe access to cookie data.

    • getSslInfo

      @Nullable public SslInfo getSslInfo()
      从接口复制的说明: ServerHttpRequest
      Return the SSL session information if the request has been transmitted over a secure protocol including SSL certificates, if available.
      指定者:
      getSslInfo 在接口中 ServerHttpRequest
      返回:
      the session information, or null if none available
    • initSslInfo

      @Nullable protected abstract SslInfo initSslInfo()
      Obtain SSL session information from the underlying "native" request.
      返回:
      the session information, or null if none available
    • getNativeRequest

      public abstract <T> T getNativeRequest()
      Return the underlying server response.
    • getLogPrefix

      String getLogPrefix()
      For internal use in logging at the HTTP adapter layer.
    • initLogPrefix

      protected String initLogPrefix()
      Subclasses can override this to provide the prefix to use for log messages.

      By default, this is getId().