org.apache.calcite.avatica.remote

## Class AvaticaCommonsHttpClientSpnegoImpl

- java.lang.Object
- - org.apache.calcite.avatica.remote.AvaticaCommonsHttpClientSpnegoImpl

All Implemented Interfaces:
  AvaticaHttpClient

    public class AvaticaCommonsHttpClientSpnegoImpl
    extends Object
    implements AvaticaHttpClient

Implementation of an AvaticaHttpClient which uses SPNEGO.

### Nested Class Summary

Nested Classes
`private static class` `AvaticaCommonsHttpClientSpnegoImpl.EmptyCredentials` A credentials implementation which returns null.

### Field Summary

Fields
`(package private) org.apache.http.impl.client.BasicAuthCache` `authCache`
`(package private) org.apache.http.config.Lookup<org.apache.http.auth.AuthSchemeProvider>` `authRegistry`
`static String` `CACHED_CONNECTIONS_MAX_DEFAULT`
`static String` `CACHED_CONNECTIONS_MAX_KEY`
`static String` `CACHED_CONNECTIONS_MAX_PER_ROUTE_DEFAULT`
`static String` `CACHED_CONNECTIONS_MAX_PER_ROUTE_KEY`
`(package private) org.apache.http.impl.client.CloseableHttpClient` `client`
`(package private) org.apache.http.impl.client.BasicCredentialsProvider` `credentialsProvider`
`(package private) org.apache.http.HttpHost` `host`
`private static org.slf4j.Logger` `LOG`
`(package private) org.apache.http.impl.conn.PoolingHttpClientConnectionManager` `pool`
`private static boolean` `STRIP_PORT_ON_SERVER_LOOKUP`
`(package private) URL` `url`
`private static boolean` `USE_CANONICAL_HOSTNAME`

### Constructor Summary

Constructors
Constructor and Description
`AvaticaCommonsHttpClientSpnegoImpl(URL url)` Constructs an http client with the expectation that the user is already logged in with their Kerberos identity via JAAS.
`AvaticaCommonsHttpClientSpnegoImpl(URL url, GSSCredential credential)` Constructs an HTTP client with user specified by the given credentials.

### Method Summary

Methods
`byte[]` `send(byte[] request)` Sends a serialized request to the Avatica server.
`private static URI` `toURI(URL url)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### LOG

    private static final org.slf4j.Logger LOG

#### CACHED_CONNECTIONS_MAX_KEY

    public static final String CACHED_CONNECTIONS_MAX_KEY

See Also:
  Constant Field Values

#### CACHED_CONNECTIONS_MAX_DEFAULT

    public static final String CACHED_CONNECTIONS_MAX_DEFAULT

See Also:
  Constant Field Values

#### CACHED_CONNECTIONS_MAX_PER_ROUTE_KEY

    public static final String CACHED_CONNECTIONS_MAX_PER_ROUTE_KEY

See Also:
  Constant Field Values

#### CACHED_CONNECTIONS_MAX_PER_ROUTE_DEFAULT

    public static final String CACHED_CONNECTIONS_MAX_PER_ROUTE_DEFAULT

See Also:
  Constant Field Values

#### USE_CANONICAL_HOSTNAME

    private static final boolean USE_CANONICAL_HOSTNAME

See Also:
  Constant Field Values

#### STRIP_PORT_ON_SERVER_LOOKUP

    private static final boolean STRIP_PORT_ON_SERVER_LOOKUP

See Also:
  Constant Field Values

#### url

    final URL url

#### host

    final org.apache.http.HttpHost host

#### pool

    final org.apache.http.impl.conn.PoolingHttpClientConnectionManager pool

#### authRegistry

    final org.apache.http.config.Lookup<org.apache.http.auth.AuthSchemeProvider> authRegistry

#### credentialsProvider

    final org.apache.http.impl.client.BasicCredentialsProvider credentialsProvider

#### authCache

    final org.apache.http.impl.client.BasicAuthCache authCache

#### client

    final org.apache.http.impl.client.CloseableHttpClient client

### Constructor Detail

#### AvaticaCommonsHttpClientSpnegoImpl

    public AvaticaCommonsHttpClientSpnegoImpl(URL url)

Constructs an http client with the expectation that the user is already logged in with their Kerberos identity via JAAS.

Parameters:
  `url` - The URL for the Avatica server

#### AvaticaCommonsHttpClientSpnegoImpl

    public AvaticaCommonsHttpClientSpnegoImpl(URL url,
                                      GSSCredential credential)

Constructs an HTTP client with user specified by the given credentials.

Parameters:
  `url` - The URL for the Avatica server
  `credential` - The GSS credentials

### Method Detail

#### send

    public byte[] send(byte[] request)

Description copied from interface: `AvaticaHttpClient`
Sends a serialized request to the Avatica server.

Specified by:
  `send` in interface `AvaticaHttpClient`
Parameters:
  `request` - The serialized request.
Returns:
  The serialized response.

#### toURI

    private static URI toURI(URL url)
                      throws RuntimeException

Throws:
  `RuntimeException`