@Contract(threading=SAFE) public class BasicCredentialsProvider extends java.lang.Object implements CredentialsProvider
CredentialsProvider.| Modifier and Type | Field and Description |
|---|---|
private java.util.concurrent.ConcurrentHashMap<AuthScope,Credentials> |
credMap |
| Constructor and Description |
|---|
BasicCredentialsProvider()
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clears all credentials.
|
Credentials |
getCredentials(AuthScope authscope)
Get the
credentials for the given authentication scope. |
private static Credentials |
matchCredentials(java.util.Map<AuthScope,Credentials> map,
AuthScope authscope)
Find matching
credentials for the given authentication scope. |
void |
setCredentials(AuthScope authscope,
Credentials credentials)
Sets the
credentials for the given authentication
scope. |
java.lang.String |
toString() |
private final java.util.concurrent.ConcurrentHashMap<AuthScope,Credentials> credMap
public void setCredentials(AuthScope authscope, Credentials credentials)
CredentialsProvidercredentials for the given authentication
scope. Any previous credentials for the given scope will be overwritten.setCredentials in interface CredentialsProviderauthscope - the authentication scopecredentials - the authentication credentials
for the given scope.CredentialsProvider.getCredentials(AuthScope)private static Credentials matchCredentials(java.util.Map<AuthScope,Credentials> map, AuthScope authscope)
credentials for the given authentication scope.map - the credentials hash mapauthscope - the authentication scopepublic Credentials getCredentials(AuthScope authscope)
CredentialsProvidercredentials for the given authentication scope.getCredentials in interface CredentialsProviderauthscope - the authentication scopeCredentialsProvider.setCredentials(AuthScope, Credentials)public void clear()
CredentialsProviderclear in interface CredentialsProviderpublic java.lang.String toString()
toString in class java.lang.Object