eu.emi.client.security
Class CustomHostConfiguration

java.lang.Object
  extended by org.apache.commons.httpclient.HostConfiguration
      extended by eu.emi.client.security.CustomHostConfiguration
All Implemented Interfaces:
Cloneable

public class CustomHostConfiguration
extends org.apache.commons.httpclient.HostConfiguration
implements Cloneable

Code from Apache Commons HTTPClient "contrib"
A kind of HostConfiguration that gets its Host from a factory. This is useful for integrating a specialized Protocol or SocketFactory; for example, a SecureSocketFactory that authenticates via SSL. Use HttpClient.setHostConfiguration to install a HostConfigurationWithHostFactory that contains the specialized HostFactory, Protocol or SocketFactory.

An alternative is to use Protocol.registerProtocol to register a specialized Protocol. But that has drawbacks: it makes it hard to integrate modules (e.g. web applications in a servlet container) with different strategies, because they share the specialized Protocol (Protocol.PROTOCOLS is static). And it can't support different Protocols for different hosts or ports (since the host and port aren't parameters to Protocol.getProtocol).

Author:
John Kristian

Field Summary
 
Fields inherited from class org.apache.commons.httpclient.HostConfiguration
ANY_HOST_CONFIGURATION
 
Constructor Summary
CustomHostConfiguration(HttpHostFactory factory)
           
 
Method Summary
 Object clone()
           
 void setHost(String host)
           
 void setHost(String host, int port)
           
 void setHost(String host, int port, String scheme)
           
 
Methods inherited from class org.apache.commons.httpclient.HostConfiguration
equals, getHost, getHostURL, getLocalAddress, getParams, getPort, getProtocol, getProxyHost, getProxyPort, getVirtualHost, hashCode, hostEquals, isHostSet, isProxySet, proxyEquals, setHost, setHost, setHost, setHost, setLocalAddress, setParams, setProxy, setProxyHost, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CustomHostConfiguration

public CustomHostConfiguration(HttpHostFactory factory)
Method Detail

clone

public Object clone()
Overrides:
clone in class org.apache.commons.httpclient.HostConfiguration

setHost

public void setHost(String host)
Overrides:
setHost in class org.apache.commons.httpclient.HostConfiguration

setHost

public void setHost(String host,
                    int port)
Overrides:
setHost in class org.apache.commons.httpclient.HostConfiguration

setHost

public void setHost(String host,
                    int port,
                    String scheme)
Overrides:
setHost in class org.apache.commons.httpclient.HostConfiguration


Copyright © 2012 EMI. All Rights Reserved.