org.apache.hc.client5.http.auth

## Interface AuthCache

- All Known Implementing Classes:
    BasicAuthCache

      public interface AuthCache

  This interface represents an cache of `AuthScheme` state information that can be re-used for preemptive authentication by subsequent requests.
  Since:
    4.1

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `clear()`
    `AuthScheme` | `get(HttpHost host)` Returns the authentication state with the given authentication scope from the cache if available.
    `default AuthScheme` | `get(HttpHost host, String pathPrefix)` Returns the authentication state with the given authentication scope from the cache if available.
    `void` | `put(HttpHost host, AuthScheme authScheme)` Stores the authentication state with the given authentication scope in the cache.
    `default void` | `put(HttpHost host, String pathPrefix, AuthScheme authScheme)` Stores the authentication state with the given authentication scope in the cache.
    `void` | `remove(HttpHost host)` Removes the authentication state with the given authentication scope from the cache if found.
    `default void` | `remove(HttpHost host, String pathPrefix)` Removes the authentication state with the given authentication scope from the cache if found.

- - ### Method Detail

    - #### put

          void put(HttpHost host,
                   AuthScheme authScheme)

      Stores the authentication state with the given authentication scope in the cache.
      Parameters:
        `host` - the authentication authority.
        `authScheme` - the cacheable authentication state.

    - #### get

          AuthScheme get(HttpHost host)

      Returns the authentication state with the given authentication scope from the cache if available.
      Parameters:
        `host` - the authentication authority.
      Returns:
        the authentication state ir `null` if not available in the cache.

    - #### remove

          void remove(HttpHost host)

      Removes the authentication state with the given authentication scope from the cache if found.
      Parameters:
        `host` - the authentication authority.

    - #### clear

          void clear()

    - #### put

          default void put(HttpHost host,
                           String pathPrefix,
                           AuthScheme authScheme)

      Stores the authentication state with the given authentication scope in the cache.
      Parameters:
        `host` - the authentication authority.
        `pathPrefix` - the path prefix (the path component up to the last segment separator). Can be `null`.
        `authScheme` - the cacheable authentication state.
      Since:
        5.2

    - #### get

          default AuthScheme get(HttpHost host,
                                 String pathPrefix)

      Returns the authentication state with the given authentication scope from the cache if available.
      Parameters:
        `host` - the authentication authority.
        `pathPrefix` - the path prefix (the path component up to the last segment separator). Can be `null`.
      Returns:
        the authentication state ir `null` if not available in the cache.
      Since:
        5.2

    - #### remove

          default void remove(HttpHost host,
                              String pathPrefix)

      Removes the authentication state with the given authentication scope from the cache if found.
      Parameters:
        `host` - the authentication authority.
        `pathPrefix` - the path prefix (the path component up to the last segment separator). Can be `null`.
      Since:
        5.2

Copyright © 1999–2021 The Apache Software Foundation. All rights reserved.