Interface Request

  • All Superinterfaces:
    ReadStream<Buffer>
    All Known Implementing Classes:
    RequestWrapper

    public interface Request
    extends ReadStream<Buffer>
    Represents a server-side HTTP request.
    Author:
    David BRASSELY (david.brassely at graviteesource.com), GraviteeSource Team
    • Method Detail

      • transactionId

        String transactionId()
        Propagated transaction id between multiple requests.
        Returns:
        Transaction ID.
      • uri

        String uri()
        The URL the client used to make the request.
        Returns:
        the URI of the request.
      • path

        String path()
        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.
        Returns:
        The path part of the uri.
      • pathInfo

        String pathInfo()
        Return the path without the context-path.
        Returns:
      • contextPath

        String contextPath()
        Returns the portion of the request URI that indicates the context of the request.
        Returns:
      • parameters

        io.gravitee.common.util.MultiValueMap<String,​String> parameters()
        Returns:
        the query parameters in the request
      • pathParameters

        io.gravitee.common.util.MultiValueMap<String,​String> pathParameters()
        Returns:
        the path parameters in the request
      • headers

        HttpHeaders headers()
        Returns:
        the headers in the request.
      • method

        io.gravitee.common.http.HttpMethod method()
        Returns:
        the HTTP method for the request.
      • version

        io.gravitee.common.http.HttpVersion version()
        Returns:
        the HTTP version of the request
      • timestamp

        long timestamp()
        The timestamp for when this request was received. Specifically, this is the timestamp of creation of the request object.
        Returns:
        the instant timestamp for the request.
      • remoteAddress

        String remoteAddress()
        Returns the Internet Protocol (IP) address of the client or last proxy that sent the request.
        Returns:
        a String containing the IP address of the client that sent the request.
      • localAddress

        String localAddress()
        Returns the Internet Protocol (IP) address of the interface on which the request was received.
        Returns:
        a String containing the IP address on which the request was received.
      • sslSession

        SSLSession sslSession()
        Returns:
        SSLSession associated to the request. Returns null if not an SSL connection.
        See Also:
        SSLSession
      • metrics

        io.gravitee.reporter.api.http.Metrics metrics()
      • ended

        boolean ended()
      • timeoutHandler

        Request timeoutHandler​(Handler<Long> timeoutHandler)
        Define an Handler when the request timeout has been reached
        Parameters:
        timeoutHandler - The handler to call when the timeout has been reached
        Returns:
        The current request
      • timeoutHandler

        Handler<Long> timeoutHandler()
        Returns the timeout handler
        Returns:
      • isWebSocket

        boolean isWebSocket()
      • customFrameHandler

        Request customFrameHandler​(Handler<HttpFrame> frameHandler)
        For HTTP/2 request
        Parameters:
        frameHandler - The handler to call when getting a custom HTTP Frame
        Returns:
      • closeHandler

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

        String host()
        Allows to retrieve the request host. This method should be preferred over retrieving the host from http headers.
        Returns:
        the host.