Package io.gravitee.gateway.api
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
-
-
Constructor Summary
Constructors Constructor Description RequestWrapper(Request request)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ReadStream<Buffer>bodyHandler(Handler<Buffer> bodyHandler)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()ReadStream<Buffer>endHandler(Handler<Void> endHandler)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()ReadStream<Buffer>pause()StringremoteAddress()Returns the Internet Protocol (IP) address of the client or last proxy that sent the request.ReadStream<Buffer>resume()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()
-
-
-
Field Detail
-
request
protected final Request request
-
-
Constructor Detail
-
RequestWrapper
public RequestWrapper(Request request)
-
-
Method Detail
-
bodyHandler
public ReadStream<Buffer> bodyHandler(Handler<Buffer> bodyHandler)
- Specified by:
bodyHandlerin interfaceReadStream<Buffer>
-
endHandler
public ReadStream<Buffer> endHandler(Handler<Void> endHandler)
- Specified by:
endHandlerin interfaceReadStream<Buffer>
-
pause
public ReadStream<Buffer> pause()
- Specified by:
pausein interfaceReadStream<Buffer>
-
resume
public ReadStream<Buffer> resume()
- Specified by:
resumein interfaceReadStream<Buffer>
-
transactionId
public String transactionId()
Description copied from interface:RequestPropagated transaction id between multiple requests.- Specified by:
transactionIdin interfaceRequest- Returns:
- Transaction ID.
-
uri
public String uri()
Description copied from interface:RequestThe URL the client used to make the request.
-
path
public String path()
Description copied from interface:RequestReturns the part of this request's URL from the protocol name up to the query string in the first line of the HTTP request.
-
pathInfo
public String pathInfo()
Description copied from interface:RequestReturn thepathwithout thecontext-path.
-
contextPath
public String contextPath()
Description copied from interface:RequestReturns the portion of the request URI that indicates the context of the request.- Specified by:
contextPathin interfaceRequest- Returns:
-
parameters
public io.gravitee.common.util.MultiValueMap<String,String> parameters()
- Specified by:
parametersin interfaceRequest- Returns:
- the query parameters in the request
-
pathParameters
public io.gravitee.common.util.MultiValueMap<String,String> pathParameters()
- Specified by:
pathParametersin interfaceRequest- Returns:
- the path parameters in the request
-
headers
public HttpHeaders headers()
-
method
public io.gravitee.common.http.HttpMethod method()
-
version
public io.gravitee.common.http.HttpVersion version()
-
timestamp
public long timestamp()
Description copied from interface:RequestThe timestamp for when this request was received. Specifically, this is the timestamp of creation of the request object.
-
remoteAddress
public String remoteAddress()
Description copied from interface:RequestReturns the Internet Protocol (IP) address of the client or last proxy that sent the request.- Specified by:
remoteAddressin interfaceRequest- Returns:
- a
Stringcontaining the IP address of the client that sent the request.
-
localAddress
public String localAddress()
Description copied from interface:RequestReturns the Internet Protocol (IP) address of the interface on which the request was received.- Specified by:
localAddressin interfaceRequest- Returns:
- a
Stringcontaining the IP address on which the request was received.
-
metrics
public io.gravitee.reporter.api.http.Metrics metrics()
-
sslSession
public SSLSession sslSession()
- Specified by:
sslSessionin interfaceRequest- Returns:
- SSLSession associated to the request. Returns
nullif not an SSL connection. - See Also:
SSLSession
-
timeoutHandler
public Request timeoutHandler(Handler<Long> timeoutHandler)
Description copied from interface:RequestDefine anHandlerwhen the request timeout has been reached- Specified by:
timeoutHandlerin interfaceRequest- 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:RequestReturns the timeout handler- Specified by:
timeoutHandlerin interfaceRequest- Returns:
-
isWebSocket
public boolean isWebSocket()
- Specified by:
isWebSocketin interfaceRequest
-
customFrameHandler
public Request customFrameHandler(Handler<HttpFrame> frameHandler)
Description copied from interface:RequestFor HTTP/2 request- Specified by:
customFrameHandlerin interfaceRequest- Parameters:
frameHandler- The handler to call when getting a custom HTTP Frame- Returns:
-
closeHandler
public Request closeHandler(Handler<Void> closeHandler)
- Specified by:
closeHandlerin interfaceRequest- Parameters:
closeHandler- The handler to call when the underlying connection is closed- Returns:
- the request
-
-