java.lang.Object
io.helidon.webclient.http2.Http2ClientImpl
- All Implemented Interfaces:
RuntimeType.Api<Http2ClientConfig>
,HttpClient<Http2ClientRequest>
,ReleasableResource
,Http2Client
,HttpClientSpi
Implementation of HTTP2 client.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.helidon.webclient.spi.HttpClientSpi
HttpClientSpi.SupportLevel
-
Field Summary
Fields inherited from interface io.helidon.webclient.http2.Http2Client
PROTOCOL, PROTOCOL_ID
-
Method Summary
Modifier and TypeMethodDescriptionclientRequest
(FullClientRequest<?> clientRequest, ClientUri clientUri) Create a client request based on the provided HTTP request that is for the version of this client.void
Gracefully close all opened client specific connections.Create a request for a method.The prototype as it was received when creating this runtime object instance.supports
(FullClientRequest<?> clientRequest, ClientUri clientUri) Return whether this HTTP version can handle the provided request.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.helidon.webclient.api.HttpClient
delete, delete, get, get, head, head, options, options, patch, patch, post, post, put, put, trace, trace
Methods inherited from interface io.helidon.webclient.spi.HttpClientSpi
isTcp
Methods inherited from interface io.helidon.webclient.api.ReleasableResource
releaseResource
-
Method Details
-
method
Description copied from interface:HttpClient
Create a request for a method.- Specified by:
method
in interfaceHttpClient<Http2ClientRequest>
- Parameters:
method
- HTTP method- Returns:
- a new request (not thread safe)
-
prototype
Description copied from interface:RuntimeType.Api
The prototype as it was received when creating this runtime object instance.- Specified by:
prototype
in interfaceRuntimeType.Api<Http2ClientConfig>
- Returns:
- prototype object used to create this instance
-
supports
Description copied from interface:HttpClientSpi
Return whether this HTTP version can handle the provided request.Examples:
- HTTP/1.1 always returns true, as it is the fallback protocol of all other protocols
- HTTP/2 returns true when upgrade is enabled, false when prior-knowledge is specified (as we can always attempt to upgrade and fallback to 1.1 in the first case, but we would fail with prior-knowledge, unless the endpoint is known to be HTTP/2
- HTTP/3 would always return true, as it cannot fallback once a connection is attempted
- An explicit protocol id is configured for the request -
HttpClientRequest.protocolId(String)
- There is no fallback protocol enabled, in such a case, we use the one with highest priority - see
WebClientConfig.BuilderBase.addProtocolPreference(String)
- We get an
Alt-Svc
header from a response that points us to a protocol version (we only support permanent protocol changes,Alt-Svc
with timeout will be ignored - This protocol version already handled a request to such an endpoint and has the connection available
- Specified by:
supports
in interfaceHttpClientSpi
- Parameters:
clientRequest
- HTTP requestclientUri
- URI to invoke- Returns:
true
if we are sure we can handle this request with this protocol version
-
clientRequest
Description copied from interface:HttpClientSpi
Create a client request based on the provided HTTP request that is for the version of this client.- Specified by:
clientRequest
in interfaceHttpClientSpi
- Parameters:
clientRequest
- request configurationclientUri
- URI to invoke (resolved)- Returns:
- a new request
-
closeResource
public void closeResource()Description copied from interface:HttpClient
Gracefully close all opened client specific connections.- Specified by:
closeResource
in interfaceHttpClient<Http2ClientRequest>
- Specified by:
closeResource
in interfaceReleasableResource
-