Package org.apache.http.impl.client
Class BasicCredentialsProvider
- java.lang.Object
-
- org.apache.http.impl.client.BasicCredentialsProvider
-
- All Implemented Interfaces:
CredentialsProvider
@Contract(threading=SAFE) public class BasicCredentialsProvider extends java.lang.Object implements CredentialsProvider
Default implementation ofCredentialsProvider
.- 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 Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
Clears all credentials.Credentials
getCredentials(AuthScope authscope)
Get thecredentials
for the given authentication scope.private static Credentials
matchCredentials(java.util.Map<AuthScope,Credentials> map, AuthScope authscope)
Find matchingcredentials
for the given authentication scope.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:CredentialsProvider
Sets thecredentials
for the given authentication scope. Any previous credentials for the given scope will be overwritten.- Specified by:
setCredentials
in interfaceCredentialsProvider
- Parameters:
authscope
- theauthentication scope
credentials
- the authenticationcredentials
for the given scope.- See Also:
CredentialsProvider.getCredentials(AuthScope)
-
matchCredentials
private static Credentials matchCredentials(java.util.Map<AuthScope,Credentials> map, AuthScope authscope)
Find matchingcredentials
for the given authentication scope.- Parameters:
map
- the credentials hash mapauthscope
- theauthentication scope
- Returns:
- the credentials
-
getCredentials
public Credentials getCredentials(AuthScope authscope)
Description copied from interface:CredentialsProvider
Get thecredentials
for the given authentication scope.- Specified by:
getCredentials
in interfaceCredentialsProvider
- Parameters:
authscope
- theauthentication scope
- Returns:
- the credentials
- See Also:
CredentialsProvider.setCredentials(AuthScope, Credentials)
-
clear
public void clear()
Description copied from interface:CredentialsProvider
Clears all credentials.- Specified by:
clear
in interfaceCredentialsProvider
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-