Top Description Fields Constructors Methods
io.vertx.core.http.impl

public Class Http1xServerRequest

extends HttpServerRequestInternal
implements HttpRequest
Class Inheritance
All Implemented Interfaces
io.vertx.core.spi.observability.HttpRequest
Imports
io.netty.handler.codec.DecoderResult, io.netty.handler.codec.http.HttpHeaders, io.netty.handler.codec.http.*, io.netty.handler.codec.http.multipart.Attribute, .HttpPostRequestDecoder, .InterfaceHttpData, io.vertx.codegen.annotations.Nullable, io.vertx.core.Context, .Future, .Handler, .MultiMap, io.vertx.core.buffer.Buffer, io.vertx.core.http.Cookie, .HttpVersion, io.vertx.core.http.*, io.vertx.core.http.impl.headers.HeadersAdaptor, io.vertx.core.impl.ContextInternal, .VertxInternal, io.vertx.core.impl.future.PromiseInternal, io.vertx.core.net.HostAndPort, .NetSocket, .SocketAddress, io.vertx.core.net.impl.HostAndPortImpl, io.vertx.core.spi.metrics.HttpServerMetrics, io.vertx.core.spi.tracing.SpanKind, .TagExtractor, .VertxTracer, io.vertx.core.streams.impl.InboundBuffer, javax.net.ssl.SSLPeerUnverifiedException, javax.security.cert.X509Certificate, java.nio.charset.Charset, .StandardCharsets, java.util.Objects, .Set

This class is optimised for performance when used on the same event loop that is was passed to the handler with. However it can be used safely from other threads.

The internal state is protected by using the connection as a lock. If always used on the same event loop, then we benefit from biased locking which makes the overhead of synchronized near zero.

It's important we don't have different locks for connection and request/response to avoid deadlock conditions

Author
Tim Fox

Field Summary

Modifier and TypeField and Description
private String
private MultiMap
private HostAndPort
private long
private final Http1xServerConnection
pack-priv final ContextInternal
private HttpPostRequestDecoder
private boolean
private HttpEventHandler
private boolean
private MultiMap
private HttpMethod
pack-priv Object
pack-priv Http1xServerRequest
private static final HostAndPort
private MultiMap
private Charset
private String
private InboundBuffer<Object>
private String
private HttpRequest
private Http1xServerResponse
private boolean
pack-priv Object
private Handler<HttpServerFileUpload>
private String
private HttpVersion

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public String
private MultiMap
public HostAndPort
public synchronized Future<Buffer>
body()

Implements io.vertx.core.http.HttpServerRequest.body.

Convenience method for receiving the entire request body in one piece.

public long
private void
private void
public HttpConnection
public Context
public Set<Cookie>
cookies()

Implements io.vertx.core.http.HttpServerRequest.cookies.

Returns a modifiable set of parsed cookies from the COOKIE header.

public Set<Cookie>
cookies(String
the name to be matches
name
)

Implements io.vertx.core.http.HttpServerRequest.cookies.

Returns a read only set of parsed cookies that match the given name, or an empty set.

public HttpServerRequest
public DecoderResult
public synchronized Future<Void>
end()

Implements io.vertx.core.http.HttpServerRequest.end.

Returns a future signaling when the request has been fully received successfully or failed.

private void
public HttpServerRequest
private HttpEventHandler
pack-priv void
enqueue(Http1xServerRequest
the enqueued request
request
)

Enqueue a pipelined request.

private HttpEventHandler
eventHandler(boolean create)

public HttpServerRequest
public HttpServerRequest
fetch(long amount)

Implements io.vertx.core.http.HttpServerRequest.fetch.

Fetch the specified amount of elements.

public MultiMap
formAttributes()

Implements io.vertx.core.http.HttpServerRequest.formAttributes.

Returns a map of all form attributes in the request.

public Cookie
getCookie(String
the cookie name
name
)

Implements io.vertx.core.http.HttpServerRequest.getCookie.

Get the cookie with the specified name.

public Cookie
getCookie(String
the cookie name
name
,
String
the cookie domain
domain
,
String
the cookie path
path
)

Implements io.vertx.core.http.HttpServerRequest.getCookie.

Get the cookie with the specified <name, domain, path>.

public String
getFormAttribute(String
the attribute name
attributeName
)

Implements io.vertx.core.http.HttpServerRequest.getFormAttribute.

Return the first form attribute value with the specified name

public String
pack-priv void
handleBegin(boolean writable, boolean keepAlive)

pack-priv void
handleContent(Buffer buffer)
References Deprecated Buffer is deprecated or references (maybe indirectly) at least one deprecated element.

pack-priv void
pack-priv void
public HttpServerRequest
public MultiMap
public @Nullable String
public int
public boolean
isEnded()

Implements io.vertx.core.http.HttpServerRequest.isEnded.

Has the request ended?

public synchronized boolean
public boolean
isValidAuthority()

Overrides io.vertx.core.http.impl.HttpServerRequestInternal.isValidAuthority.

This method act as authority()!= null, trying to not allocated a new object if the authority is not yet parsed.

public HttpMethod
public Object
pack-priv HttpRequest
pack-priv Http1xServerRequest

Returns:

the next request following this one
next
()

private void
onData(Buffer data)
References Deprecated Buffer is deprecated or references (maybe indirectly) at least one deprecated element.

private void
public MultiMap
params(boolean
whether semicolon is treated as a normal character or a query parameter separator
semicolonIsNormalChar
)

Implements io.vertx.core.http.HttpServerRequest.params.

public String
public HttpServerRequest
pause()

Implements io.vertx.core.http.HttpServerRequest.pause.

Pause the ReadStream, it sets the buffer in fetch mode and clears the actual demand.

public X509Certificate[]
peerCertificateChain()

Implements io.vertx.core.http.HttpServerRequest.peerCertificateChain.

References Deprecated X509Certificate is deprecated or references (maybe indirectly) at least one deprecated element.

Note

Java SE 5+ recommends to use javax.net.ssl.SSLSession#getPeerCertificates() instead of of javax.net.ssl.SSLSession#getPeerCertificateChain() which this method is based on.

private Handler<Void>
private Handler<Object>
public String
public SocketAddress
private void
private void
private void
public Http1xServerResponse
public HttpServerRequest
resume()

Implements io.vertx.core.http.HttpServerRequest.resume.

Resume reading, and sets the buffer in flowing mode.

public HttpServerRequest
routed(String
The route this request has been routed to.
route
)

Overrides default io.vertx.core.http.HttpServerRequest.routed.

Marks this request as being routed to the given route.

public String
public HttpServerRequest
setExpectMultipart(boolean
true - if you are expecting a multi-part body
expect
)

Implements io.vertx.core.http.HttpServerRequest.setExpectMultipart.

Call this with true if you are expecting a multi-part body to be submitted in the request.

public HttpServerRequest
setParamsCharset(String
the charset to use for decoding query params
charset
)

Implements io.vertx.core.http.HttpServerRequest.setParamsCharset.

Override the charset to use for decoding the query parameter map, when none is set, UTF8 is used.

pack-priv void
public HttpServerRequest
streamPriorityHandler(Handler<StreamPriority>
the handler to be called when stream priority changes
handler
)

Implements io.vertx.core.http.HttpServerRequest.streamPriorityHandler.

Set an handler for stream priority changes

This is not implemented for HTTP/1.x.

public Future<NetSocket>
toNetSocket()

Implements io.vertx.core.http.HttpServerRequest.toNetSocket.

Like toNetSocket(Handler) but returns a Future of the asynchronous result

public Future<ServerWebSocket>
toWebSocket()

Implements io.vertx.core.http.HttpServerRequest.toWebSocket.

Like toWebSocket(Handler) but returns a Future of the asynchronous result

pack-priv Object
public HttpServerRequest
public String
public HttpVersion
pack-priv Future<ServerWebSocket>

Returns:

a future of the un-accepted WebSocket
webSocket
()

private void
webSocket(PromiseInternal<ServerWebSocket> promise)

Handle the request when a WebSocket upgrade header is present.