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

public Class DefaultUserTokenHandler

extends Object
implements UserTokenHandler
Class Inheritance
All Implemented Interfaces
org.apache.http.client.UserTokenHandler
Annotations
@Contract
threading:IMMUTABLE
Imports
java.security.Principal, javax.net.ssl.SSLSession, org.apache.http.HttpConnection, org.apache.http.annotation.Contract, .ThreadingBehavior, org.apache.http.auth.AuthScheme, .AuthState, .Credentials, org.apache.http.client.UserTokenHandler, org.apache.http.client.protocol.HttpClientContext, org.apache.http.conn.ManagedHttpClientConnection, org.apache.http.protocol.HttpContext

Default implementation of UserTokenHandler. This class will use an instance of Principal as a state object for HTTP connections, if it can be obtained from the given execution context. This helps ensure persistent connections created with a particular user identity within a particular security context can be reused by the same user only.

DefaultUserTokenHandler will use the user principal of connection based authentication schemes such as NTLM or that of the SSL session with the client authentication turned on. If both are unavailable, null token will be returned.

Since
4.0

Field Summary

Modifier and TypeField and Description
public static final DefaultUserTokenHandler

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static Principal
getAuthPrincipal(final AuthState authState)

public Object
getUserToken(final HttpContext
the execution context
context
)

Implements org.apache.http.client.UserTokenHandler.getUserToken.

The token object returned by this method is expected to uniquely identify the current user if the context is user specific or to be null if it is not.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

INSTANCEback to summary
public static final DefaultUserTokenHandler INSTANCE

Constructor Detail

DefaultUserTokenHandlerback to summary
public DefaultUserTokenHandler()

Method Detail

getAuthPrincipalback to summary
private static Principal getAuthPrincipal(final AuthState authState)
getUserTokenback to summary
public Object getUserToken(final HttpContext context)

Implements org.apache.http.client.UserTokenHandler.getUserToken.

Doc from org.apache.http.client.UserTokenHandler.getUserToken.

The token object returned by this method is expected to uniquely identify the current user if the context is user specific or to be null if it is not.

Parameters
context:HttpContext

the execution context

Returns:Object

user token that uniquely identifies the user or null if the context is not user specific.

Annotations
@Override