public interface HttpConnection
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the connection and all the currently active streams.
|
HttpConnection |
closeHandler(Handler<Void> handler)
Set a close handler.
|
HttpConnection |
exceptionHandler(Handler<Throwable> handler)
Set an handler called when a connection error happens
|
default int |
getWindowSize() |
default HttpConnection |
goAway(long errorCode)
Like
goAway(long, int) with a last stream id -1 which means to disallow any new stream creation. |
default HttpConnection |
goAway(long errorCode,
int lastStreamId)
Like
goAway(long, int, Buffer) with no buffer. |
HttpConnection |
goAway(long errorCode,
int lastStreamId,
Buffer debugData)
Send a go away frame to the remote endpoint of the connection.
|
HttpConnection |
goAwayHandler(Handler<GoAway> handler)
Set an handler called when a GOAWAY frame is received.
|
String |
indicatedServerName()
Returns the SNI server name presented during the SSL handshake by the client.
|
boolean |
isSsl() |
SocketAddress |
localAddress() |
X509Certificate[] |
peerCertificateChain()
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.
|
HttpConnection |
ping(Buffer data,
Handler<AsyncResult<Buffer>> pongHandler)
Send a PING frame to the remote endpoint.
|
HttpConnection |
pingHandler(Handler<Buffer> handler)
Set an handler notified when a PING frame is received from the remote endpoint.
|
SocketAddress |
remoteAddress() |
Http2Settings |
remoteSettings() |
HttpConnection |
remoteSettingsHandler(Handler<Http2Settings> handler)
Set an handler that is called when remote endpoint
Http2Settings are updated. |
Http2Settings |
settings() |
default HttpConnection |
setWindowSize(int windowSize)
Update the current connection wide window size to a new size.
|
default HttpConnection |
shutdown()
Initiate a graceful connection shutdown, the connection is taken out of service and closed when all current requests
are processed, otherwise after 30 seconds the connection will be closed.
|
HttpConnection |
shutdown(long timeoutMs)
Like
shutdown() but with a configurable timeout value. |
HttpConnection |
shutdownHandler(Handler<Void> handler)
Set an handler called when a GOAWAY frame has been sent or received and all connections are closed.
|
SSLSession |
sslSession() |
HttpConnection |
updateSettings(Http2Settings settings)
Send to the remote endpoint an update of the server settings.
|
HttpConnection |
updateSettings(Http2Settings settings,
Handler<AsyncResult<Void>> completionHandler)
Send to the remote endpoint an update of this endpoint settings
The
completionHandler will be notified when the remote endpoint has acknowledged the settings. |
default int getWindowSize()
-1
for HTTP/1.xdefault HttpConnection setWindowSize(int windowSize)
windowSize
- the new window sizedefault HttpConnection goAway(long errorCode)
goAway(long, int)
with a last stream id -1
which means to disallow any new stream creation.default HttpConnection goAway(long errorCode, int lastStreamId)
goAway(long, int, Buffer)
with no buffer.HttpConnection goAway(long errorCode, int lastStreamId, Buffer debugData)
errorCode
and debugData
lastStreamId
will be closed0
when all the remaining streams are closed this connection will be closed automaticallyerrorCode
- the GOAWAY error codelastStreamId
- the last stream iddebugData
- additional debug data sent to the remote endpointHttpConnection goAwayHandler(Handler<GoAway> handler)
handler
- the handlerHttpConnection shutdownHandler(Handler<Void> handler)
handler
- the handlerdefault HttpConnection shutdown()
HttpConnection shutdown(long timeoutMs)
shutdown()
but with a configurable timeout value.timeoutMs
- the timeout in millisecondsHttpConnection closeHandler(Handler<Void> handler)
handler
- the handler to be notifiedvoid close()
Http2Settings settings()
HttpConnection updateSettings(Http2Settings settings)
settings
- the new settingsHttpConnection updateSettings(Http2Settings settings, Handler<AsyncResult<Void>> completionHandler)
completionHandler
will be notified when the remote endpoint has acknowledged the settings.
This is not implemented for HTTP/1.x.settings
- the new settingscompletionHandler
- the handler notified when the settings have been acknowledged by the remote endpointHttp2Settings remoteSettings()
HttpConnection remoteSettingsHandler(Handler<Http2Settings> handler)
Http2Settings
are updated.
This is not implemented for HTTP/1.x.handler
- the handler for remote endpoint settingsHttpConnection ping(Buffer data, Handler<AsyncResult<Buffer>> pongHandler)
data
- the 8 bytes data of the framepongHandler
- an async result handler notified with pong reply or the failureHttpConnection pingHandler(Handler<Buffer> handler)
handler
- the handler to be called when a PING is receivedHttpConnection exceptionHandler(Handler<Throwable> handler)
handler
- the handlerSocketAddress remoteAddress()
null
(e.g a server bound on a domain socket)SocketAddress localAddress()
null
(e.g a server bound on a domain socket)boolean isSsl()
HttpConnection
is encrypted via SSL/TLS.SSLSession sslSession()
SSLSession
X509Certificate[] peerCertificateChain() throws SSLPeerUnverifiedException
sslSession()
to
access that method.SSLPeerUnverifiedException
- SSL peer's identity has not been verified.SSLSession.getPeerCertificateChain()
,
sslSession()
String indicatedServerName()
Copyright © 2023 Eclipse. All rights reserved.