Package org.eclipse.jetty.client
Class WWWAuthenticationProtocolHandler
- java.lang.Object
-
- org.eclipse.jetty.client.AuthenticationProtocolHandler
-
- org.eclipse.jetty.client.WWWAuthenticationProtocolHandler
-
- All Implemented Interfaces:
ProtocolHandler
public class WWWAuthenticationProtocolHandler extends AuthenticationProtocolHandler
A protocol handler that handles the 401 response code in association with the
WWW-Authenticateheader.- See Also:
ProxyAuthenticationProtocolHandler
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringNAME-
Fields inherited from class org.eclipse.jetty.client.AuthenticationProtocolHandler
DEFAULT_MAX_CONTENT_LENGTH, LOG
-
-
Constructor Summary
Constructors Constructor Description WWWAuthenticationProtocolHandler(HttpClient client)WWWAuthenticationProtocolHandler(HttpClient client, int maxContentLength)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaccept(Request request, Response response)Inspects the givenrequestandresponseto detect whether this protocol handler should handle them.protected HttpHeadergetAuthenticateHeader()protected java.lang.StringgetAuthenticationAttribute()protected java.net.URIgetAuthenticationURI(Request request)protected HttpHeadergetAuthorizationHeader()java.lang.StringgetName()-
Methods inherited from class org.eclipse.jetty.client.AuthenticationProtocolHandler
getHeaderInfo, getHttpClient, getResponseListener
-
-
-
-
Field Detail
-
NAME
public static final java.lang.String NAME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
WWWAuthenticationProtocolHandler
public WWWAuthenticationProtocolHandler(HttpClient client)
-
WWWAuthenticationProtocolHandler
public WWWAuthenticationProtocolHandler(HttpClient client, int maxContentLength)
-
-
Method Detail
-
getName
public java.lang.String getName()
- Returns:
- a unique name among protocol handlers
-
accept
public boolean accept(Request request, Response response)
Description copied from interface:ProtocolHandlerInspects the given
requestandresponseto detect whether this protocol handler should handle them.For example, a redirect protocol handler can inspect the response code and return true if it is a redirect response code.
This method is being called just after the response line has been parsed, and before the response headers are available.
- Parameters:
request- the request to acceptresponse- the response to accept- Returns:
- true if this protocol handler can handle the given request and response
-
getAuthenticateHeader
protected HttpHeader getAuthenticateHeader()
- Specified by:
getAuthenticateHeaderin classAuthenticationProtocolHandler
-
getAuthorizationHeader
protected HttpHeader getAuthorizationHeader()
- Specified by:
getAuthorizationHeaderin classAuthenticationProtocolHandler
-
getAuthenticationURI
protected java.net.URI getAuthenticationURI(Request request)
- Specified by:
getAuthenticationURIin classAuthenticationProtocolHandler
-
getAuthenticationAttribute
protected java.lang.String getAuthenticationAttribute()
- Specified by:
getAuthenticationAttributein classAuthenticationProtocolHandler
-
-