org.apache.hc.client5.http.impl.auth

## Class BasicAuthCache

- java.lang.Object
- - org.apache.hc.client5.http.impl.auth.BasicAuthCache

All Implemented Interfaces:
  AuthCache

    @Contract(threading=SAFE_CONDITIONAL)
    public class BasicAuthCache
    extends Object
    implements AuthCache

Default implementation of `AuthCache`. This implements expects `AuthScheme` to be `Serializable` in order to be cacheable.

Instances of this class are thread safe as of version 4.4.

Since:
  4.1

### Constructor Summary

Constructors
Constructor and Description
`BasicAuthCache()`
`BasicAuthCache(SchemePortResolver schemePortResolver)` Default constructor.

### Method Summary

Methods
`void` `clear()`
`AuthScheme` `get(org.apache.hc.core5.http.HttpHost host)`
`protected org.apache.hc.core5.http.HttpHost` `getKey(org.apache.hc.core5.http.HttpHost host)`
`void` `put(org.apache.hc.core5.http.HttpHost host, AuthScheme authScheme)`
`void` `remove(org.apache.hc.core5.http.HttpHost host)`
`String` `toString()`

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

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

### Constructor Detail

#### BasicAuthCache

    public BasicAuthCache(SchemePortResolver schemePortResolver)

Default constructor.

Since:
  4.3

#### BasicAuthCache

    public BasicAuthCache()

### Method Detail

#### getKey

    protected org.apache.hc.core5.http.HttpHost getKey(org.apache.hc.core5.http.HttpHost host)

#### put

    public void put(org.apache.hc.core5.http.HttpHost host,
           AuthScheme authScheme)

Specified by:
  `put` in interface `AuthCache`

#### get

    public AuthScheme get(org.apache.hc.core5.http.HttpHost host)

Specified by:
  `get` in interface `AuthCache`

#### remove

    public void remove(org.apache.hc.core5.http.HttpHost host)

Specified by:
  `remove` in interface `AuthCache`

#### clear

    public void clear()

Specified by:
  `clear` in interface `AuthCache`

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`