Class ServerWebRequest

java.lang.Object
io.microsphere.spring.webflux.context.request.ServerWebRequest
All Implemented Interfaces:
org.springframework.web.context.request.NativeWebRequest, org.springframework.web.context.request.RequestAttributes, org.springframework.web.context.request.WebRequest

public class ServerWebRequest extends Object implements org.springframework.web.context.request.NativeWebRequest
The adapter implementation of NativeWebRequest based on ServerWebExchange
Since:
1.0.0
Author:
Mercy
See Also:
  • ServerWebExchange
  • ServerHttpRequest
  • ServerHttpResponse
  • NativeWebRequest
  • Field Details

  • Constructor Details

    • ServerWebRequest

      public ServerWebRequest(org.springframework.web.server.ServerWebExchange exchange)
  • Method Details

    • getNativeRequest

      @Nonnull public Object getNativeRequest()
      Specified by:
      getNativeRequest in interface org.springframework.web.context.request.NativeWebRequest
    • getNativeResponse

      @Nonnull public Object getNativeResponse()
      Specified by:
      getNativeResponse in interface org.springframework.web.context.request.NativeWebRequest
    • getNativeRequest

      @Nullable public <T> T getNativeRequest(Class<T> requiredType)
      Specified by:
      getNativeRequest in interface org.springframework.web.context.request.NativeWebRequest
    • getNativeResponse

      @Nullable public <T> T getNativeResponse(Class<T> requiredType)
      Specified by:
      getNativeResponse in interface org.springframework.web.context.request.NativeWebRequest
    • getHeader

      @Nullable public String getHeader(String headerName)
      Specified by:
      getHeader in interface org.springframework.web.context.request.WebRequest
    • getHeaderValues

      @Nullable public String[] getHeaderValues(String headerName)
      Specified by:
      getHeaderValues in interface org.springframework.web.context.request.WebRequest
    • getHeaderNames

      @Nonnull public Iterator<String> getHeaderNames()
      Specified by:
      getHeaderNames in interface org.springframework.web.context.request.WebRequest
    • getParameter

      @Nullable public String getParameter(String paramName)
      Specified by:
      getParameter in interface org.springframework.web.context.request.WebRequest
    • getParameterValues

      @Nullable public String[] getParameterValues(String paramName)
      Specified by:
      getParameterValues in interface org.springframework.web.context.request.WebRequest
    • getParameterNames

      @Nonnull public Iterator<String> getParameterNames()
      Specified by:
      getParameterNames in interface org.springframework.web.context.request.WebRequest
    • getParameterMap

      @Nonnull public Map<String,String[]> getParameterMap()
      Specified by:
      getParameterMap in interface org.springframework.web.context.request.WebRequest
    • getLocale

      @Nullable public Locale getLocale()
      Specified by:
      getLocale in interface org.springframework.web.context.request.WebRequest
    • getContextPath

      @Nonnull public String getContextPath()
      Specified by:
      getContextPath in interface org.springframework.web.context.request.WebRequest
    • getRemoteUser

      @Nullable public String getRemoteUser()
      Specified by:
      getRemoteUser in interface org.springframework.web.context.request.WebRequest
    • getUserPrincipal

      @Nullable public Principal getUserPrincipal()
      Specified by:
      getUserPrincipal in interface org.springframework.web.context.request.WebRequest
    • isUserInRole

      public boolean isUserInRole(String role)
      Specified by:
      isUserInRole in interface org.springframework.web.context.request.WebRequest
    • isSecure

      public boolean isSecure()
      Specified by:
      isSecure in interface org.springframework.web.context.request.WebRequest
    • checkNotModified

      public boolean checkNotModified(long lastModifiedTimestamp)
      Specified by:
      checkNotModified in interface org.springframework.web.context.request.WebRequest
    • checkNotModified

      public boolean checkNotModified(String etag)
      Specified by:
      checkNotModified in interface org.springframework.web.context.request.WebRequest
    • checkNotModified

      public boolean checkNotModified(String etag, long lastModifiedTimestamp)
      Specified by:
      checkNotModified in interface org.springframework.web.context.request.WebRequest
    • getDescription

      @Nonnull public String getDescription(boolean includeClientInfo)
      Specified by:
      getDescription in interface org.springframework.web.context.request.WebRequest
    • getAttribute

      @Nullable public Object getAttribute(String name, int scope)
      Specified by:
      getAttribute in interface org.springframework.web.context.request.RequestAttributes
    • setAttribute

      public void setAttribute(String name, Object value, int scope)
      Specified by:
      setAttribute in interface org.springframework.web.context.request.RequestAttributes
    • removeAttribute

      public void removeAttribute(String name, int scope)
      Specified by:
      removeAttribute in interface org.springframework.web.context.request.RequestAttributes
    • getAttributeNames

      @Nonnull public String[] getAttributeNames(int scope)
      Specified by:
      getAttributeNames in interface org.springframework.web.context.request.RequestAttributes
    • registerDestructionCallback

      public void registerDestructionCallback(String name, Runnable callback, int scope)
      Specified by:
      registerDestructionCallback in interface org.springframework.web.context.request.RequestAttributes
    • resolveReference

      @Nullable public Object resolveReference(String key)
      Specified by:
      resolveReference in interface org.springframework.web.context.request.RequestAttributes
    • getSessionId

      @Nonnull public String getSessionId()
      Specified by:
      getSessionId in interface org.springframework.web.context.request.RequestAttributes
    • getSessionMutex

      @Nonnull public Object getSessionMutex()
      Specified by:
      getSessionMutex in interface org.springframework.web.context.request.RequestAttributes
    • getExchange

      @Nonnull public org.springframework.web.server.ServerWebExchange getExchange()
      Get the ServerWebExchange
      Returns:
      the ServerWebExchange
    • getRequest

      @Nonnull public org.springframework.http.server.reactive.ServerHttpRequest getRequest()
      Get the ServerHttpRequest
      Returns:
      the ServerHttpRequest
    • getResponse

      @Nonnull public org.springframework.http.server.reactive.ServerHttpResponse getResponse()
      Get the ServerHttpResponse
      Returns:
      the ServerHttpResponse
    • getRequestHeaders

      @Nonnull public org.springframework.http.HttpHeaders getRequestHeaders()
      Get the HttpHeaders
      Returns:
      the mutable HttpHeaders
    • getQueryParams

      @Nonnull @Immutable public org.springframework.util.MultiValueMap<String,String> getQueryParams()
      Get a read-only map with parsed and decoded query parameter values.
      Returns:
      a read-only map with parsed and decoded query parameter values
    • getSession

      @Nonnull public org.springframework.web.server.WebSession getSession()
    • toArray

      @Nullable protected String[] toArray(List<String> values)