Class AvaticaCommonsHttpClientImpl
java.lang.Object
org.apache.calcite.avatica.remote.AvaticaCommonsHttpClientImpl
- All Implemented Interfaces:
AvaticaHttpClient,GSSAuthenticateable,HttpClientPoolConfigurable,UsernamePasswordAuthenticateable
public class AvaticaCommonsHttpClientImpl
extends Object
implements AvaticaHttpClient, HttpClientPoolConfigurable, UsernamePasswordAuthenticateable, GSSAuthenticateable
A common class to invoke HTTP requests against the Avatica server agnostic of the data being
sent and received across the wire.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.apache.hc.client5.http.impl.auth.BasicAuthCacheprotected org.apache.hc.core5.http.config.Lookup<org.apache.hc.client5.http.auth.AuthSchemeFactory>protected org.apache.hc.client5.http.impl.classic.CloseableHttpClientprotected org.apache.hc.client5.http.auth.UsernamePasswordCredentialsprotected org.apache.hc.client5.http.auth.CredentialsProviderprotected org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManagerprotected org.apache.hc.core5.http.config.Registry<org.apache.hc.client5.http.socket.ConnectionSocketFactory>protected final URIprotected Object -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidinitializeClient(org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager pool) byte[]send(byte[] request) Sends a serialized request to the Avatica server.voidsetGSSCredential(GSSCredential credential) Sets the GSS Credential If credential is null, then the current subject will be usedvoidsetHttpClientPool(org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager pool) Sets a PoolingHttpClientConnectionManager containing the collection of SSL/TLS server keys and truststores to use for HTTPS calls.voidsetUsernamePassword(AuthenticationType authType, String username, String password) Sets the username, password and method to be used for authentication.
-
Field Details
-
uri
-
authCache
protected org.apache.hc.client5.http.impl.auth.BasicAuthCache authCache -
client
protected org.apache.hc.client5.http.impl.classic.CloseableHttpClient client -
socketFactoryRegistry
protected org.apache.hc.core5.http.config.Registry<org.apache.hc.client5.http.socket.ConnectionSocketFactory> socketFactoryRegistry -
pool
protected org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager pool -
credentials
protected org.apache.hc.client5.http.auth.UsernamePasswordCredentials credentials -
credentialsProvider
protected org.apache.hc.client5.http.auth.CredentialsProvider credentialsProvider -
authRegistry
protected org.apache.hc.core5.http.config.Lookup<org.apache.hc.client5.http.auth.AuthSchemeFactory> authRegistry -
userToken
-
-
Constructor Details
-
AvaticaCommonsHttpClientImpl
-
-
Method Details
-
initializeClient
protected void initializeClient(org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager pool) -
send
public byte[] send(byte[] request) Description copied from interface:AvaticaHttpClientSends a serialized request to the Avatica server.- Specified by:
sendin interfaceAvaticaHttpClient- Parameters:
request- The serialized request.- Returns:
- The serialized response.
-
setUsernamePassword
Description copied from interface:UsernamePasswordAuthenticateableSets the username, password and method to be used for authentication.- Specified by:
setUsernamePasswordin interfaceUsernamePasswordAuthenticateable- Parameters:
authType- Type of authenticationusername- Usernamepassword- Password
-
setGSSCredential
Description copied from interface:GSSAuthenticateableSets the GSS Credential If credential is null, then the current subject will be used- Specified by:
setGSSCredentialin interfaceGSSAuthenticateable- Parameters:
credential- GSS Credentials
-
setHttpClientPool
public void setHttpClientPool(org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager pool) Description copied from interface:HttpClientPoolConfigurableSets a PoolingHttpClientConnectionManager containing the collection of SSL/TLS server keys and truststores to use for HTTPS calls.- Specified by:
setHttpClientPoolin interfaceHttpClientPoolConfigurable- Parameters:
pool- The http connection pool
-