Top Description Fields Constructors Methods
org.apache.hc.client5.http.impl.auth

public Class BasicCredentialsProvider

extends Object
implements CredentialsStore
Class Inheritance
All Implemented Interfaces
org.apache.hc.client5.http.auth.CredentialsStore, org.apache.hc.client5.http.auth.CredentialsProvider
Annotations
@Contract
threading:SAFE
Imports
java.util.concurrent.ConcurrentHashMap, org.apache.hc.client5.http.auth.AuthScope, .Credentials, .CredentialsStore, org.apache.hc.core5.annotation.Contract, .ThreadingBehavior, org.apache.hc.core5.http.protocol.HttpContext, org.apache.hc.core5.util.Args

Default implementation of CredentialsStore.
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
public Credentials
getCredentials(final AuthScope authScope, final HttpContext context)

Implements org.apache.hc.client5.http.auth.CredentialsProvider.getCredentials.

Returns credentials for the given authentication scope, if available.
public void
setCredentials(final AuthScope authScope, final Credentials
the authentication credentials for the given scope.
credentials
)

Implements org.apache.hc.client5.http.auth.CredentialsStore.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.hc.client5.http.auth.CredentialsStore.clear.

Doc from org.apache.hc.client5.http.auth.CredentialsStore.clear.

Clears all credentials.

Annotations
@Override
getCredentialsback to summary
public Credentials getCredentials(final AuthScope authScope, final HttpContext context)

Implements org.apache.hc.client5.http.auth.CredentialsProvider.getCredentials.

Doc from org.apache.hc.client5.http.auth.CredentialsProvider.getCredentials.

Returns credentials for the given authentication scope, if available.

Parameters
authScope:AuthScope

the authentication scope

context:HttpContext

the http context

Returns:Credentials

the credentials

Annotations
@Override
setCredentialsback to summary
public void setCredentials(final AuthScope authScope, final Credentials credentials)

Implements org.apache.hc.client5.http.auth.CredentialsStore.setCredentials.

Doc from org.apache.hc.client5.http.auth.CredentialsStore.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