Package org.apache.http.impl.nio.client
Class DefaultAsyncUserTokenHandler
- java.lang.Object
-
- org.apache.http.impl.nio.client.DefaultAsyncUserTokenHandler
-
- All Implemented Interfaces:
org.apache.http.client.UserTokenHandler
@Contract(threading=IMMUTABLE) public class DefaultAsyncUserTokenHandler extends java.lang.Object implements org.apache.http.client.UserTokenHandler
Default implementation ofUserTokenHandler
for asynchrounous HTTP client communication. This class will use an instance ofPrincipal
as a state object for non-blocking 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.This implementation will use the user principle 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 DefaultAsyncUserTokenHandler
INSTANCE
-
Constructor Summary
Constructors Constructor Description DefaultAsyncUserTokenHandler()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static java.security.Principal
getAuthPrincipal(org.apache.http.auth.AuthState authState)
java.lang.Object
getUserToken(org.apache.http.protocol.HttpContext context)
-
-
-
Field Detail
-
INSTANCE
public static final DefaultAsyncUserTokenHandler INSTANCE
-
-
Method Detail
-
getUserToken
public java.lang.Object getUserToken(org.apache.http.protocol.HttpContext context)
- Specified by:
getUserToken
in interfaceorg.apache.http.client.UserTokenHandler
-
getAuthPrincipal
private static java.security.Principal getAuthPrincipal(org.apache.http.auth.AuthState authState)
-
-