Package org.apache.http.impl.client
Class DefaultUserTokenHandler
- java.lang.Object
-
- org.apache.http.impl.client.DefaultUserTokenHandler
-
- All Implemented Interfaces:
UserTokenHandler
@Contract(threading=IMMUTABLE) public class DefaultUserTokenHandler extends java.lang.Object implements UserTokenHandler
Default implementation ofUserTokenHandler
. This class will use an instance ofPrincipal
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
Fields Modifier and Type Field Description static DefaultUserTokenHandler
INSTANCE
-
Constructor Summary
Constructors Constructor Description DefaultUserTokenHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
getUserToken(HttpContext context)
The token object returned by this method is expected to uniquely identify the current user if the context is user specific or to benull
if it is not.
-
-
-
Field Detail
-
INSTANCE
public static final DefaultUserTokenHandler INSTANCE
-
-
Method Detail
-
getUserToken
public java.lang.Object getUserToken(HttpContext context)
Description copied from interface:UserTokenHandler
The token object returned by this method is expected to uniquely identify the current user if the context is user specific or to benull
if it is not.- Specified by:
getUserToken
in interfaceUserTokenHandler
- Parameters:
context
- the execution context- Returns:
- user token that uniquely identifies the user or
null
if the context is not user specific.
-
-