Class RequestWrapper

java.lang.Object
io.gravitee.gateway.api.RequestWrapper
All Implemented Interfaces:
Request, ReadStream<Buffer>

public abstract class RequestWrapper extends Object implements Request
Author:
David BRASSELY (david.brassely at graviteesource.com), GraviteeSource Team
  • Field Details

    • request

      protected final Request request
  • Constructor Details

    • RequestWrapper

      public RequestWrapper(Request request)
  • Method Details

    • bodyHandler

      public ReadStream<Buffer> bodyHandler(Handler<Buffer> bodyHandler)
      Specified by:
      bodyHandler in interface ReadStream<Buffer>
    • endHandler

      public ReadStream<Buffer> endHandler(Handler<Void> endHandler)
      Specified by:
      endHandler in interface ReadStream<Buffer>
    • pause

      public ReadStream<Buffer> pause()
      Specified by:
      pause in interface ReadStream<Buffer>
    • resume

      public ReadStream<Buffer> resume()
      Specified by:
      resume in interface ReadStream<Buffer>
    • id

      public String id()
      Specified by:
      id in interface Request
    • transactionId

      public String transactionId()
      Description copied from interface: Request
      Propagated transaction id between multiple requests.
      Specified by:
      transactionId in interface Request
      Returns:
      Transaction ID.
    • uri

      public String uri()
      Description copied from interface: Request
      The URL the client used to make the request.
      Specified by:
      uri in interface Request
      Returns:
      the URI of the request.
    • path

      public String path()
      Description copied from interface: Request
      Returns the part of this request's URL from the protocol name up to the query string in the first line of the HTTP request.
      Specified by:
      path in interface Request
      Returns:
      The path part of the uri.
    • pathInfo

      public String pathInfo()
      Description copied from interface: Request
      Return the path without the context-path.
      Specified by:
      pathInfo in interface Request
      Returns:
    • contextPath

      public String contextPath()
      Description copied from interface: Request
      Returns the portion of the request URI that indicates the context of the request.
      Specified by:
      contextPath in interface Request
      Returns:
    • parameters

      public io.gravitee.common.util.MultiValueMap<String,String> parameters()
      Specified by:
      parameters in interface Request
      Returns:
      the query parameters in the request
    • pathParameters

      public io.gravitee.common.util.MultiValueMap<String,String> pathParameters()
      Specified by:
      pathParameters in interface Request
      Returns:
      the path parameters in the request
    • headers

      public HttpHeaders headers()
      Specified by:
      headers in interface Request
      Returns:
      the headers in the request.
    • method

      public io.gravitee.common.http.HttpMethod method()
      Specified by:
      method in interface Request
      Returns:
      the HTTP method for the request.
    • scheme

      public String scheme()
      Specified by:
      scheme in interface Request
    • version

      public io.gravitee.common.http.HttpVersion version()
      Specified by:
      version in interface Request
      Returns:
      the HTTP version of the request
    • timestamp

      public long timestamp()
      Description copied from interface: Request
      The timestamp for when this request was received. Specifically, this is the timestamp of creation of the request object.
      Specified by:
      timestamp in interface Request
      Returns:
      the instant timestamp for the request.
    • remoteAddress

      public String remoteAddress()
      Description copied from interface: Request
      Returns the Internet Protocol (IP) address of the client or last proxy that sent the request.
      Specified by:
      remoteAddress in interface Request
      Returns:
      a String containing the IP address of the client that sent the request.
    • localAddress

      public String localAddress()
      Description copied from interface: Request
      Returns the Internet Protocol (IP) address of the interface on which the request was received.
      Specified by:
      localAddress in interface Request
      Returns:
      a String containing the IP address on which the request was received.
    • metrics

      public io.gravitee.reporter.api.http.Metrics metrics()
      Specified by:
      metrics in interface Request
    • sslSession

      public SSLSession sslSession()
      Specified by:
      sslSession in interface Request
      Returns:
      SSLSession associated to the request. Returns null if not an SSL connection.
      See Also:
    • ended

      public boolean ended()
      Specified by:
      ended in interface Request
    • timeoutHandler

      public Request timeoutHandler(Handler<Long> timeoutHandler)
      Description copied from interface: Request
      Define an Handler when the request timeout has been reached
      Specified by:
      timeoutHandler in interface Request
      Parameters:
      timeoutHandler - The handler to call when the timeout has been reached
      Returns:
      The current request
    • timeoutHandler

      public Handler<Long> timeoutHandler()
      Description copied from interface: Request
      Returns the timeout handler
      Specified by:
      timeoutHandler in interface Request
      Returns:
    • isWebSocket

      public boolean isWebSocket()
      Specified by:
      isWebSocket in interface Request
    • websocket

      public WebSocket websocket()
      Specified by:
      websocket in interface Request
    • customFrameHandler

      public Request customFrameHandler(Handler<HttpFrame> frameHandler)
      Description copied from interface: Request
      For HTTP/2 request
      Specified by:
      customFrameHandler in interface Request
      Parameters:
      frameHandler - The handler to call when getting a custom HTTP Frame
      Returns:
    • closeHandler

      public Request closeHandler(Handler<Void> closeHandler)
      Specified by:
      closeHandler in interface Request
      Parameters:
      closeHandler - The handler to call when the underlying connection is closed
      Returns:
      the request
    • host

      public String host()
      Description copied from interface: Request
      Allows to retrieve the request host. This method should be preferred over retrieving the host from http headers.
      Specified by:
      host in interface Request
      Returns:
      the host.