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
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final org.slf4j.Logger
private final Map
<BasicAuthCache.Key, byte[]> private final SchemePortResolver
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
get
(org.apache.hc.core5.http.HttpHost host) Returns the authentication state with the given authentication scope from the cache if available.Returns the authentication state with the given authentication scope from the cache if available.private BasicAuthCache.Key
void
put
(org.apache.hc.core5.http.HttpHost host, String pathPrefix, AuthScheme authScheme) Stores the authentication state with the given authentication scope in the cache.void
put
(org.apache.hc.core5.http.HttpHost host, AuthScheme authScheme) Stores the authentication state with the given authentication scope in the cache.void
remove
(org.apache.hc.core5.http.HttpHost host) Removes the authentication state with the given authentication scope from the cache if found.void
Removes the authentication state with the given authentication scope from the cache if found.toString()
-
Field Details
-
LOG
private static final org.slf4j.Logger LOG -
map
-
schemePortResolver
-
-
Constructor Details
-
BasicAuthCache
Default constructor.- Since:
- 4.3
-
BasicAuthCache
public BasicAuthCache()
-
-
Method Details
-
key
private BasicAuthCache.Key key(String scheme, org.apache.hc.core5.net.NamedEndpoint authority, String pathPrefix) -
put
Description copied from interface:AuthCache
Stores the authentication state with the given authentication scope in the cache. -
get
Description copied from interface:AuthCache
Returns the authentication state with the given authentication scope from the cache if available. -
remove
public void remove(org.apache.hc.core5.http.HttpHost host) Description copied from interface:AuthCache
Removes the authentication state with the given authentication scope from the cache if found. -
put
Description copied from interface:AuthCache
Stores the authentication state with the given authentication scope in the cache. -
get
Description copied from interface:AuthCache
Returns the authentication state with the given authentication scope from the cache if available. -
remove
Description copied from interface:AuthCache
Removes the authentication state with the given authentication scope from the cache if found. -
clear
public void clear() -
toString
-