org.apache.wink.client.handlers
Class ProxyAuthSecurityHandler
java.lang.Object
org.apache.wink.client.handlers.AbstractAuthSecurityHandler
org.apache.wink.client.handlers.ProxyAuthSecurityHandler
- All Implemented Interfaces:
- ClientHandler
public class ProxyAuthSecurityHandler
- extends AbstractAuthSecurityHandler
- implements ClientHandler
SecurityHandler for a client to perform http proxy auth:
Usage:
ClientConfig config = new ClientConfig();
ProxyAuthSecurityHandler proxyAuthSecHandler = new ProxyAuthSecurityHandler();
proxyAuthSecHandler.setUserName("username");
proxyAuthSecHandler.setPassword("password");
config.handlers(proxyAuthSecurityHandler);
// create the rest client instance
RestClient client = new RestClient(config);
// create the resource instance to interact with Resource
resource = client.resource("http://localhost:8080/path/to/resource");
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ProxyAuthSecurityHandler
public ProxyAuthSecurityHandler()
ProxyAuthSecurityHandler
public ProxyAuthSecurityHandler(String username,
String password)
handle
public ClientResponse handle(ClientRequest request,
HandlerContext context)
throws Exception
- Performs basic HTTP authentication and proxy authentication, if
necessary.
- Specified by:
handle
in interface ClientHandler
- Parameters:
client
- request objecthandler
- context object
- Returns:
- a client response object that may contain an HTTP Authorization
header
- Throws:
Exception
- any exception can be thrown by a handler and it will be
caught by the underlying client implementation and wrapped in
a ClientRuntimeException
Copyright © 2009-2012 The Apache Software Foundation. All Rights Reserved.