public class YokeRequest
extends java.lang.Object
implements org.vertx.java.core.http.HttpServerRequest
Constructor and Description |
---|
YokeRequest(org.vertx.java.core.http.HttpServerRequest request,
YokeResponse response,
boolean secure,
java.util.Map<java.lang.String,java.lang.Object> context) |
Modifier and Type | Method and Description |
---|---|
java.net.URI |
absoluteURI() |
java.lang.String |
accepts(java.lang.String... types)
Check if the given type(s) is acceptable, returning the best match when true, otherwise null, in which
case you should respond with 406 "Not Acceptable".
|
java.lang.Object |
body()
The request setBody and eventually a parsed version of it in json or map
|
org.vertx.java.core.http.HttpServerRequest |
bodyHandler(org.vertx.java.core.Handler<org.vertx.java.core.buffer.Buffer> bodyHandler) |
long |
bodyLengthLimit()
Holds the maximum allowed length for the setBody data.
|
org.vertx.java.core.buffer.Buffer |
bufferBody()
The request setBody and eventually a parsed version of it in json or map
|
long |
contentLength()
Returns the content length of this request setBody or -1 if header is not present.
|
org.vertx.java.core.http.HttpServerRequest |
dataHandler(org.vertx.java.core.Handler<org.vertx.java.core.buffer.Buffer> handler) |
org.vertx.java.core.http.HttpServerRequest |
endHandler(org.vertx.java.core.Handler<java.lang.Void> endHandler) |
org.vertx.java.core.http.HttpServerRequest |
exceptionHandler(org.vertx.java.core.Handler<java.lang.Throwable> handler) |
java.util.Map<java.lang.String,org.vertx.java.core.http.HttpServerFileUpload> |
files()
The uploaded setFiles
|
org.vertx.java.core.MultiMap |
formAttributes() |
<R> R |
get(java.lang.String name)
Allow getting properties in a generified way.
|
<R> R |
get(java.lang.String name,
R defaultValue)
Allow getting properties in a generified way and return defaultValue if the key does not exist.
|
java.util.List<YokeCookie> |
getAllCookies(java.lang.String name)
Allow getting all Cookie by name.
|
java.util.List<java.lang.String> |
getAllHeaders(java.lang.String name)
Allow getting headers in a generified way.
|
YokeCookie |
getCookie(java.lang.String name)
Allow getting Cookie by name.
|
java.lang.String |
getHeader(java.lang.String name)
Allow getting headers in a generified way.
|
java.lang.String |
getHeader(java.lang.String name,
java.lang.String defaultValue)
Allow getting headers in a generified way and return defaultValue if the key does not exist.
|
java.lang.String |
getSessionId() |
boolean |
hasBody()
Returns true if this request has setBody
|
org.vertx.java.core.MultiMap |
headers() |
java.lang.String |
ip()
Returns the ip address of the client, when trust-proxy is true (default) then first look into X-Forward-For
Header
|
boolean |
isSecure() |
org.vertx.java.core.json.JsonObject |
jsonBody()
The request setBody and eventually a parsed version of it in json or map
|
java.lang.String |
method() |
org.vertx.java.core.net.NetSocket |
netSocket() |
java.lang.String |
originalMethod()
The original HTTP setMethod for the request.
|
org.vertx.java.core.MultiMap |
params() |
java.lang.String |
path() |
org.vertx.java.core.http.HttpServerRequest |
pause() |
javax.security.cert.X509Certificate[] |
peerCertificateChain() |
<R> R |
put(java.lang.String name,
R value)
Allows putting a value into the context
|
java.lang.String |
query() |
java.net.InetSocketAddress |
remoteAddress() |
YokeResponse |
response() |
org.vertx.java.core.http.HttpServerRequest |
resume() |
void |
setSessionId(java.lang.String sessionId) |
org.vertx.java.core.http.HttpServerRequest |
uploadHandler(org.vertx.java.core.Handler<org.vertx.java.core.http.HttpServerFileUpload> uploadHandler) |
java.lang.String |
uri() |
org.vertx.java.core.http.HttpVersion |
version() |
org.vertx.java.core.http.HttpServerRequest |
vertxHttpServerRequest()
Return the real request
|
public YokeRequest(org.vertx.java.core.http.HttpServerRequest request, YokeResponse response, boolean secure, java.util.Map<java.lang.String,java.lang.Object> context)
public <R> R get(java.lang.String name)
R
- The type of the returnname
- The key to getpublic <R> R get(java.lang.String name, R defaultValue)
R
- The type of the returnname
- The key to getdefaultValue
- value returned when the key does not existpublic <R> R put(java.lang.String name, R value)
R
- the type of the previous value if presentname
- the key to storevalue
- the value to storepublic java.lang.String getHeader(java.lang.String name)
name
- The key to getpublic java.util.List<java.lang.String> getAllHeaders(java.lang.String name)
name
- The key to getpublic java.lang.String getHeader(java.lang.String name, java.lang.String defaultValue)
name
- The key to getdefaultValue
- value returned when the key does not existpublic YokeCookie getCookie(java.lang.String name)
name
- The key to getpublic java.util.List<YokeCookie> getAllCookies(java.lang.String name)
name
- The key to getpublic java.lang.String originalMethod()
public long bodyLengthLimit()
public boolean hasBody()
public long contentLength()
public java.lang.Object body()
public org.vertx.java.core.json.JsonObject jsonBody()
public org.vertx.java.core.buffer.Buffer bufferBody()
public java.util.Map<java.lang.String,org.vertx.java.core.http.HttpServerFileUpload> files()
public void setSessionId(java.lang.String sessionId)
public java.lang.String getSessionId()
public boolean isSecure()
public java.lang.String accepts(java.lang.String... types)
public java.lang.String ip()
public org.vertx.java.core.http.HttpServerRequest vertxHttpServerRequest()
public org.vertx.java.core.http.HttpVersion version()
version
in interface org.vertx.java.core.http.HttpServerRequest
public java.lang.String method()
method
in interface org.vertx.java.core.http.HttpServerRequest
HttpServerRequest.method()
public java.lang.String uri()
uri
in interface org.vertx.java.core.http.HttpServerRequest
HttpServerRequest.uri()
public java.lang.String path()
path
in interface org.vertx.java.core.http.HttpServerRequest
HttpServerRequest.path()
public java.lang.String query()
query
in interface org.vertx.java.core.http.HttpServerRequest
HttpServerRequest.query()
public YokeResponse response()
response
in interface org.vertx.java.core.http.HttpServerRequest
HttpServerRequest.response()
public org.vertx.java.core.MultiMap headers()
headers
in interface org.vertx.java.core.http.HttpServerRequest
HttpServerRequest.headers()
public org.vertx.java.core.MultiMap params()
params
in interface org.vertx.java.core.http.HttpServerRequest
HttpServerRequest.params()
public java.net.InetSocketAddress remoteAddress()
remoteAddress
in interface org.vertx.java.core.http.HttpServerRequest
HttpServerRequest.remoteAddress()
public javax.security.cert.X509Certificate[] peerCertificateChain() throws javax.net.ssl.SSLPeerUnverifiedException
peerCertificateChain
in interface org.vertx.java.core.http.HttpServerRequest
javax.net.ssl.SSLPeerUnverifiedException
HttpServerRequest.peerCertificateChain()
public java.net.URI absoluteURI()
absoluteURI
in interface org.vertx.java.core.http.HttpServerRequest
HttpServerRequest.absoluteURI()
public org.vertx.java.core.http.HttpServerRequest bodyHandler(org.vertx.java.core.Handler<org.vertx.java.core.buffer.Buffer> bodyHandler)
bodyHandler
in interface org.vertx.java.core.http.HttpServerRequest
HttpServerRequest.bodyHandler(org.vertx.java.core.Handler)
public org.vertx.java.core.net.NetSocket netSocket()
netSocket
in interface org.vertx.java.core.http.HttpServerRequest
public org.vertx.java.core.http.HttpServerRequest uploadHandler(org.vertx.java.core.Handler<org.vertx.java.core.http.HttpServerFileUpload> uploadHandler)
uploadHandler
in interface org.vertx.java.core.http.HttpServerRequest
public org.vertx.java.core.MultiMap formAttributes()
formAttributes
in interface org.vertx.java.core.http.HttpServerRequest
public org.vertx.java.core.http.HttpServerRequest dataHandler(org.vertx.java.core.Handler<org.vertx.java.core.buffer.Buffer> handler)
dataHandler
in interface org.vertx.java.core.streams.ReadStream<org.vertx.java.core.http.HttpServerRequest>
ReadStream.dataHandler(org.vertx.java.core.Handler)
public org.vertx.java.core.http.HttpServerRequest pause()
pause
in interface org.vertx.java.core.streams.ReadStream<org.vertx.java.core.http.HttpServerRequest>
ReadStream.pause()
public org.vertx.java.core.http.HttpServerRequest resume()
resume
in interface org.vertx.java.core.streams.ReadStream<org.vertx.java.core.http.HttpServerRequest>
ReadStream.resume()
public org.vertx.java.core.http.HttpServerRequest endHandler(org.vertx.java.core.Handler<java.lang.Void> endHandler)
endHandler
in interface org.vertx.java.core.streams.ReadStream<org.vertx.java.core.http.HttpServerRequest>
ReadStream.endHandler(org.vertx.java.core.Handler)
public org.vertx.java.core.http.HttpServerRequest exceptionHandler(org.vertx.java.core.Handler<java.lang.Throwable> handler)
exceptionHandler
in interface org.vertx.java.core.streams.ExceptionSupport<org.vertx.java.core.http.HttpServerRequest>
ExceptionSupport.exceptionHandler(org.vertx.java.core.Handler)