Class HttpConnection
- All Implemented Interfaces:
MutinyDelegate
close()
closeHandler(java.lang.Runnable)
exceptionHandler(java.util.function.Consumer<java.lang.Throwable>)
original
non Mutiny-ified interface using Vert.x codegen.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionHttpConnection
(io.vertx.core.http.HttpConnection delegate) HttpConnection
(Object delegate) -
Method Summary
Modifier and TypeMethodDescriptionio.smallrye.mutiny.Uni<Void>
close()
Close the connection and all the currently active streams.Blocking variant ofclose()
.void
Variant ofclose()
that ignores the result of the operation.closeHandler
(Runnable handler) boolean
exceptionHandler
(Consumer<Throwable> handler) io.vertx.core.http.HttpConnection
int
goAway
(long errorCode) goAway
(long errorCode, int lastStreamId) goAwayHandler
(Consumer<io.vertx.core.http.GoAway> handler) int
hashCode()
boolean
isSsl()
localAddress
(boolean real) static HttpConnection
newInstance
(io.vertx.core.http.HttpConnection arg) io.smallrye.mutiny.Uni<Buffer>
Send a frame to the remote endpoint.pingAndAwait
(Buffer data) Blocking variant ofping(io.vertx.mutiny.core.buffer.Buffer)
.pingAndForget
(Buffer data) Variant ofping(io.vertx.mutiny.core.buffer.Buffer)
that ignores the result of the operation.pingHandler
(Consumer<Buffer> handler) remoteAddress
(boolean real) io.vertx.core.http.Http2Settings
remoteSettingsHandler
(Consumer<io.vertx.core.http.Http2Settings> handler) io.vertx.core.http.Http2Settings
settings()
setWindowSize
(int windowSize) io.smallrye.mutiny.Uni<Void>
shutdown()
Shutdown a 30 seconds timeout (shutdown(30, TimeUnit.SECONDS)
).io.smallrye.mutiny.Uni<Void>
shutdown
(long timeout) Deprecated.io.smallrye.mutiny.Uni<Void>
Initiate a graceful connection shutdown, the connection is taken out of service and closed when all the inflight requests are processed, otherwise after atimeout
the connection will be closed.Blocking variant ofshutdown()
.shutdownAndAwait
(long timeout) Deprecated.instead use#shutdown(long, TimeUnit, Handler)
shutdownAndAwait
(long timeout, TimeUnit unit) Blocking variant ofshutdown(long,TimeUnit)
.void
Variant ofshutdown()
that ignores the result of the operation.void
shutdownAndForget
(long timeout) Deprecated.instead use#shutdown(long, TimeUnit, Handler)
void
shutdownAndForget
(long timeout, TimeUnit unit) Variant ofshutdown(long,TimeUnit)
that ignores the result of the operation.shutdownHandler
(Runnable handler) toString()
io.smallrye.mutiny.Uni<Void>
updateSettings
(io.vertx.core.http.Http2Settings settings) Send to the remote endpoint an update of this endpoint settingsupdateSettingsAndAwait
(io.vertx.core.http.Http2Settings settings) Blocking variant ofupdateSettings(Http2Settings)
.updateSettingsAndForget
(io.vertx.core.http.Http2Settings settings) Variant ofupdateSettings(Http2Settings)
that ignores the result of the operation.
-
Field Details
-
__TYPE_ARG
-
-
Constructor Details
-
HttpConnection
public HttpConnection(io.vertx.core.http.HttpConnection delegate) -
HttpConnection
-
-
Method Details
-
getDelegate
public io.vertx.core.http.HttpConnection getDelegate()- Specified by:
getDelegate
in interfaceMutinyDelegate
- Returns:
- the delegate used by this Mutiny object of generated type
-
toString
-
equals
-
hashCode
public int hashCode() -
getWindowSize
public int getWindowSize()- Returns:
- the current connection window size or
-1
for HTTP/1.x
-
setWindowSize
- Parameters:
windowSize
- the new window size- Returns:
- a reference to this, so the API can be used fluently
-
goAway
- Parameters:
errorCode
-- Returns:
- the instance of HttpConnection to chain method calls.
-
goAway
- Parameters:
errorCode
-lastStreamId
-- Returns:
- the instance of HttpConnection to chain method calls.
-
goAway
- Parameters:
errorCode
- the error codelastStreamId
- the last stream iddebugData
- additional debug data sent to the remote endpoint- Returns:
- a reference to this, so the API can be used fluently
-
goAwayHandler
- Parameters:
handler
- the handler- Returns:
-
shutdownHandler
- Parameters:
handler
- the handler- Returns:
-
shutdown
Shutdown a 30 seconds timeout (shutdown(30, TimeUnit.SECONDS)
).Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
shutdownAndAwait
Blocking variant ofshutdown()
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Returns:
- the Void instance produced by the operation.
-
shutdownAndForget
public void shutdownAndForget()Variant ofshutdown()
that ignores the result of the operation.This method subscribes on the result of
shutdown()
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromshutdown()
but you don't need to compose it with other operations. -
shutdown
Deprecated.instead use#shutdown(long, TimeUnit, Handler)
Likeshutdown()
, in milliseconds.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
timeout
-- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
shutdownAndAwait
Deprecated.instead use#shutdown(long, TimeUnit, Handler)
Blocking variant ofshutdown(long)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
timeout
-- Returns:
- the Void instance produced by the operation.
-
shutdownAndForget
Deprecated.instead use#shutdown(long, TimeUnit, Handler)
Variant ofshutdown(long)
that ignores the result of the operation.This method subscribes on the result of
shutdown(long)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromshutdown(long)
but you don't need to compose it with other operations.- Parameters:
timeout
-
-
shutdown
Initiate a graceful connection shutdown, the connection is taken out of service and closed when all the inflight requests are processed, otherwise after atimeout
the connection will be closed. Client connection are immediately removed from the pool.- HTTP/2 connections will send a go away frame immediately to signal the other side the connection will close.
- HTTP/1.x connection will be closed.
Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
timeout
- the amount of time after which all resources are forcibly closedunit
- the of the timeout- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
shutdownAndAwait
Blocking variant ofshutdown(long,TimeUnit)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
timeout
- the amount of time after which all resources are forcibly closedunit
- the of the timeout- Returns:
- the Void instance produced by the operation.
-
shutdownAndForget
Variant ofshutdown(long,TimeUnit)
that ignores the result of the operation.This method subscribes on the result of
shutdown(long,TimeUnit)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromshutdown(long,TimeUnit)
but you don't need to compose it with other operations.- Parameters:
timeout
- the amount of time after which all resources are forcibly closedunit
- the of the timeout
-
closeHandler
- Parameters:
handler
- the handler to be notified- Returns:
-
close
Close the connection and all the currently active streams. An HTTP/2 connection will send a frame before.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
closeAndAwait
Blocking variant ofclose()
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Returns:
- the Void instance produced by the operation.
-
closeAndForget
public void closeAndForget() -
settings
public io.vertx.core.http.Http2Settings settings()- Returns:
- the latest server settings acknowledged by the remote endpoint - this is not implemented for HTTP/1.x
-
updateSettings
@CheckReturnValue public io.smallrye.mutiny.Uni<Void> updateSettings(io.vertx.core.http.Http2Settings settings) Send to the remote endpoint an update of this endpoint settings ThecompletionHandler
will be notified when the remote endpoint has acknowledged the settings. This is not implemented for HTTP/1.x.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
settings
- the new settings- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
updateSettingsAndAwait
Blocking variant ofupdateSettings(Http2Settings)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
settings
- the new settings- Returns:
- the Void instance produced by the operation.
-
updateSettingsAndForget
Variant ofupdateSettings(Http2Settings)
that ignores the result of the operation.This method subscribes on the result of
updateSettings(Http2Settings)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromupdateSettings(Http2Settings)
but you don't need to compose it with other operations.- Parameters:
settings
- the new settings- Returns:
- the instance of HttpConnection to chain method calls.
-
remoteSettings
public io.vertx.core.http.Http2Settings remoteSettings()- Returns:
- the current remote endpoint settings for this connection - this is not implemented for HTTP/1.x
-
remoteSettingsHandler
- Parameters:
handler
- the handler for remote endpoint settings- Returns:
-
ping
Send a frame to the remote endpoint. This is not implemented for HTTP/1.x.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
data
- the 8 bytes data of the frame- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
pingAndAwait
Blocking variant ofping(io.vertx.mutiny.core.buffer.Buffer)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
data
- the 8 bytes data of the frame- Returns:
- the Buffer instance produced by the operation.
-
pingAndForget
Variant ofping(io.vertx.mutiny.core.buffer.Buffer)
that ignores the result of the operation.This method subscribes on the result of
ping(io.vertx.mutiny.core.buffer.Buffer)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromping(io.vertx.mutiny.core.buffer.Buffer)
but you don't need to compose it with other operations.- Parameters:
data
- the 8 bytes data of the frame- Returns:
- the instance of HttpConnection to chain method calls.
-
pingHandler
- Parameters:
handler
- the handler to be called when a is received- Returns:
-
exceptionHandler
- Parameters:
handler
- the handler- Returns:
-
remoteAddress
- Returns:
- the remote address for this connection, possibly
null
(e.g a server bound on a domain socket). IfuseProxyProtocol
is set totrue
, the address returned will be of the actual connecting client.
-
remoteAddress
- Parameters:
real
-- Returns:
-
localAddress
- Returns:
- the local address for this connection, possibly
null
(e.g a server bound on a domain socket) IfuseProxyProtocol
is set totrue
, the address returned will be of the proxy.
-
localAddress
- Parameters:
real
-- Returns:
-
isSsl
public boolean isSsl()- Returns:
- true if this
HttpConnection
is encrypted via SSL/TLS.
-
indicatedServerName
- Returns:
- the indicated server name
-
sslSession
- Returns:
- SSLSession associated with the underlying socket. Returns null if connection is not SSL.
-
newInstance
-
#shutdown(long, TimeUnit, Handler)