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 java.lang.Object implements AuthCache
Default implementation ofAuthCache. This implements expectsAuthSchemeto beSerializablein order to be cacheable.Instances of this class are thread safe as of version 4.4.
- Since:
- 4.1
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classBasicAuthCache.Key
-
Field Summary
Fields Modifier and Type Field Description private static org.slf4j.LoggerLOGprivate java.util.Map<BasicAuthCache.Key,byte[]>mapprivate SchemePortResolverschemePortResolver
-
Constructor Summary
Constructors Constructor Description BasicAuthCache()BasicAuthCache(SchemePortResolver schemePortResolver)Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()AuthSchemeget(org.apache.hc.core5.http.HttpHost host)Returns the authentication state with the given authentication scope from the cache if available.AuthSchemeget(org.apache.hc.core5.http.HttpHost host, java.lang.String pathPrefix)Returns the authentication state with the given authentication scope from the cache if available.private BasicAuthCache.Keykey(java.lang.String scheme, org.apache.hc.core5.net.NamedEndpoint authority, java.lang.String pathPrefix)voidput(org.apache.hc.core5.http.HttpHost host, java.lang.String pathPrefix, AuthScheme authScheme)Stores the authentication state with the given authentication scope in the cache.voidput(org.apache.hc.core5.http.HttpHost host, AuthScheme authScheme)Stores the authentication state with the given authentication scope in the cache.voidremove(org.apache.hc.core5.http.HttpHost host)Removes the authentication state with the given authentication scope from the cache if found.voidremove(org.apache.hc.core5.http.HttpHost host, java.lang.String pathPrefix)Removes the authentication state with the given authentication scope from the cache if found.java.lang.StringtoString()
-
-
-
Field Detail
-
LOG
private static final org.slf4j.Logger LOG
-
map
private final java.util.Map<BasicAuthCache.Key,byte[]> map
-
schemePortResolver
private final SchemePortResolver schemePortResolver
-
-
Constructor Detail
-
BasicAuthCache
public BasicAuthCache(SchemePortResolver schemePortResolver)
Default constructor.- Since:
- 4.3
-
BasicAuthCache
public BasicAuthCache()
-
-
Method Detail
-
key
private BasicAuthCache.Key key(java.lang.String scheme, org.apache.hc.core5.net.NamedEndpoint authority, java.lang.String pathPrefix)
-
put
public void put(org.apache.hc.core5.http.HttpHost host, AuthScheme authScheme)Description copied from interface:AuthCacheStores the authentication state with the given authentication scope in the cache.
-
get
public AuthScheme get(org.apache.hc.core5.http.HttpHost host)
Description copied from interface:AuthCacheReturns 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:AuthCacheRemoves the authentication state with the given authentication scope from the cache if found.
-
put
public void put(org.apache.hc.core5.http.HttpHost host, java.lang.String pathPrefix, AuthScheme authScheme)Description copied from interface:AuthCacheStores the authentication state with the given authentication scope in the cache.
-
get
public AuthScheme get(org.apache.hc.core5.http.HttpHost host, java.lang.String pathPrefix)
Description copied from interface:AuthCacheReturns the authentication state with the given authentication scope from the cache if available.
-
remove
public void remove(org.apache.hc.core5.http.HttpHost host, java.lang.String pathPrefix)Description copied from interface:AuthCacheRemoves the authentication state with the given authentication scope from the cache if found.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-