Class JaxRsRequest

java.lang.Object
se.fortnox.reactivewizard.jaxrs.JaxRsRequest

public class JaxRsRequest extends Object
Represents an incoming request. Helps with extracting different types of data from the request.
  • Constructor Details

    • JaxRsRequest

      protected JaxRsRequest(reactor.netty.http.server.HttpServerRequest req, Matcher matcher, byte[] body, ByteBufCollector collector)
    • JaxRsRequest

      public JaxRsRequest(reactor.netty.http.server.HttpServerRequest request)
    • JaxRsRequest

      public JaxRsRequest(reactor.netty.http.server.HttpServerRequest request, ByteBufCollector collector)
  • Method Details

    • create

      protected JaxRsRequest create(reactor.netty.http.server.HttpServerRequest req, Matcher matcher, byte[] body, ByteBufCollector collector)
    • hasMethod

      public boolean hasMethod(io.netty.handler.codec.http.HttpMethod httpMethod)
    • getBody

      public byte[] getBody()
    • loadBody

      public reactor.core.publisher.Mono<JaxRsRequest> loadBody()
      Load the body.
      Returns:
      the body
    • getQueryParam

      public String getQueryParam(String key)
      Return the query param.
      Parameters:
      key - the param key
      Returns:
      the param
    • getQueryParam

      public String getQueryParam(String key, String defaultValue)
      Return the query param or default value, if non-existent..
      Parameters:
      key - the param key
      defaultValue - default value
      Returns:
      the param or default value
    • getPathParam

      public String getPathParam(String key)
      Return the path param.
      Parameters:
      key - the param key
      Returns:
      the path param
    • getPathParam

      public String getPathParam(String key, String defaultValue)
      Get path param or default value, if non-existent.
      Parameters:
      key - the param key
      defaultValue - the default value
      Returns:
      the path param or default value
    • getHeader

      public String getHeader(String key)
    • getHeader

      public String getHeader(String key, String defaultValue)
    • getFormParam

      public String getFormParam(String key)
    • getFormParam

      public String getFormParam(String key, String defaultValue)
    • getCookie

      public Set<io.netty.handler.codec.http.cookie.Cookie> getCookie(String key)
    • getCookieValue

      public String getCookieValue(String key)
    • getCookieValue

      public String getCookieValue(String key, String defaultValue)
      Return the cookie value or default value, if non-existent.
      Parameters:
      key - the cookie key
      defaultValue - the default value
      Returns:
      cookie or default value
    • getPath

      public String getPath()
    • getUri

      public String getUri()
    • matchesPath

      public boolean matchesPath(Pattern pathPattern)