Class BasicCredentialsProvider
- java.lang.Object
-
- org.apache.hc.client5.http.impl.auth.BasicCredentialsProvider
-
- All Implemented Interfaces:
CredentialsProvider
,CredentialsStore
@Contract(threading=SAFE) public class BasicCredentialsProvider extends java.lang.Object implements CredentialsStore
Default implementation ofCredentialsStore
.- Since:
- 4.0
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.concurrent.ConcurrentHashMap<AuthScope,Credentials>
credMap
-
Constructor Summary
Constructors Constructor Description BasicCredentialsProvider()
Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
Clears all credentials.Credentials
getCredentials(AuthScope authScope, org.apache.hc.core5.http.protocol.HttpContext context)
Returnscredentials
for the given authentication scope, if available.void
setCredentials(AuthScope authScope, Credentials credentials)
Sets thecredentials
for the given authentication scope.java.lang.String
toString()
-
-
-
Field Detail
-
credMap
private final java.util.concurrent.ConcurrentHashMap<AuthScope,Credentials> credMap
-
-
Method Detail
-
setCredentials
public void setCredentials(AuthScope authScope, Credentials credentials)
Description copied from interface:CredentialsStore
Sets thecredentials
for the given authentication scope. Any previous credentials for the given scope will be overwritten.- Specified by:
setCredentials
in interfaceCredentialsStore
- Parameters:
authScope
- theauthentication scope
credentials
- the authenticationcredentials
for the given scope.- See Also:
CredentialsProvider.getCredentials(AuthScope, org.apache.hc.core5.http.protocol.HttpContext)
-
getCredentials
public Credentials getCredentials(AuthScope authScope, org.apache.hc.core5.http.protocol.HttpContext context)
Description copied from interface:CredentialsProvider
Returnscredentials
for the given authentication scope, if available.- Specified by:
getCredentials
in interfaceCredentialsProvider
- Parameters:
authScope
- theauthentication scope
context
- thehttp context
- Returns:
- the credentials
-
clear
public void clear()
Description copied from interface:CredentialsStore
Clears all credentials.- Specified by:
clear
in interfaceCredentialsStore
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-