Package io.gravitee.gateway.api
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 Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description RequestcloseHandler(Handler<Void> closeHandler)StringcontextPath()Returns the portion of the request URI that indicates the context of the request.RequestcustomFrameHandler(Handler<HttpFrame> frameHandler)For HTTP/2 requestbooleanended()HttpHeadersheaders()Stringhost()Allows to retrieve the request host.Stringid()booleanisWebSocket()StringlocalAddress()Returns the Internet Protocol (IP) address of the interface on which the request was received.io.gravitee.common.http.HttpMethodmethod()io.gravitee.reporter.api.http.Metricsmetrics()io.gravitee.common.util.MultiValueMap<String,String>parameters()Stringpath()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.StringpathInfo()Return thepathwithout thecontext-path.io.gravitee.common.util.MultiValueMap<String,String>pathParameters()StringremoteAddress()Returns the Internet Protocol (IP) address of the client or last proxy that sent the request.Stringscheme()SSLSessionsslSession()Handler<Long>timeoutHandler()Returns the timeout handlerRequesttimeoutHandler(Handler<Long> timeoutHandler)Define anHandlerwhen the request timeout has been reachedlongtimestamp()The timestamp for when this request was received.StringtransactionId()Propagated transaction id between multiple requests.Stringuri()The URL the client used to make the request.io.gravitee.common.http.HttpVersionversion()WebSocketwebsocket()-
Methods inherited from interface io.gravitee.gateway.api.stream.ReadStream
bodyHandler, endHandler, pause, resume
-
-
-
-
Method Detail
-
id
String id()
-
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 thepathwithout thecontext-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.
-
scheme
String scheme()
-
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
Stringcontaining 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
Stringcontaining the IP address on which the request was received.
-
sslSession
SSLSession sslSession()
- Returns:
- SSLSession associated to the request. Returns
nullif 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 anHandlerwhen the request timeout has been reached- Parameters:
timeoutHandler- The handler to call when the timeout has been reached- Returns:
- The current request
-
isWebSocket
boolean isWebSocket()
-
websocket
WebSocket websocket()
-
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.
-
-