Top Description Fields Constructors Methods
org.apache.http.impl.client

public Class BasicCredentialsProvider

extends Object
implements CredentialsProvider
Class Inheritance
All Implemented Interfaces
org.apache.http.client.CredentialsProvider
Annotations
@Contract
threading:SAFE
Imports
java.util.Map, java.util.concurrent.ConcurrentHashMap, org.apache.http.annotation.Contract, .ThreadingBehavior, org.apache.http.auth.AuthScope, .Credentials, org.apache.http.client.CredentialsProvider, org.apache.http.util.Args

Default implementation of CredentialsProvider.
Since
4.0

Field Summary

Modifier and TypeField and Description
private final ConcurrentHashMap<AuthScope, Credentials>

Constructor Summary

AccessConstructor and Description
public
BasicCredentialsProvider()

Default constructor.

Method Summary

Modifier and TypeMethod and Description
public void
clear()

Implements org.apache.http.client.CredentialsProvider.clear.

Clears all credentials.
public Credentials
getCredentials(final AuthScope authscope)

Implements org.apache.http.client.CredentialsProvider.getCredentials.

Get the credentials for the given authentication scope.
private static Credentials

Returns:

the credentials
matchCredentials
(final Map<AuthScope, Credentials>
the credentials hash map
map
,
final AuthScope authscope)

Find matching credentials for the given authentication scope.

public void
setCredentials(final AuthScope authscope, final Credentials
the authentication credentials for the given scope.
credentials
)

Implements org.apache.http.client.CredentialsProvider.setCredentials.

Sets the credentials for the given authentication scope.
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

credMapback to summary
private final ConcurrentHashMap<AuthScope, Credentials> credMap

Constructor Detail

BasicCredentialsProviderback to summary
public BasicCredentialsProvider()

Default constructor.

Method Detail

clearback to summary
public void clear()

Implements org.apache.http.client.CredentialsProvider.clear.

Doc from org.apache.http.client.CredentialsProvider.clear.

Clears all credentials.

Annotations
@Override
getCredentialsback to summary
public Credentials getCredentials(final AuthScope authscope)

Implements org.apache.http.client.CredentialsProvider.getCredentials.

Doc from org.apache.http.client.CredentialsProvider.getCredentials.

Get the credentials for the given authentication scope.

Parameters
authscope:AuthScope

the authentication scope

Returns:Credentials

the credentials

Annotations
@Override
matchCredentialsback to summary
private static Credentials matchCredentials(final Map<AuthScope, Credentials> map, final AuthScope authscope)

Find matching credentials for the given authentication scope.

Parameters
map:Map<AuthScope, Credentials>

the credentials hash map

authscope:AuthScope

the authentication scope

Returns:Credentials

the credentials

setCredentialsback to summary
public void setCredentials(final AuthScope authscope, final Credentials credentials)

Implements org.apache.http.client.CredentialsProvider.setCredentials.

Doc from org.apache.http.client.CredentialsProvider.setCredentials.

Sets the credentials for the given authentication scope. Any previous credentials for the given scope will be overwritten.

Parameters
authscope:AuthScope

the authentication scope

credentials:Credentials

the authentication credentials for the given scope.

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override