org.jboss.soa.esb.http
Class Configurator

java.lang.Object
  extended by org.jboss.soa.esb.http.Configurator
Direct Known Subclasses:
AuthBASIC, AuthNTLM, HttpProtocol

public abstract class Configurator
extends java.lang.Object

HttpClient Configurator.

Configure some aspect of a HttpClient instance.

Author:
tom.fennelly@jboss.com

Constructor Summary
Configurator()
           
 
Method Summary
protected  void assertPropertyIsInteger(java.lang.String propertyValue, java.lang.String propertyName)
          Assert that the property value is an Integer.
protected  void assertPropertySetAndNotBlank(java.lang.String propertyValue, java.lang.String propertyName)
          Assert that the property value is not null and not blank.
abstract  void configure(org.apache.commons.httpclient.HttpClient httpClient, java.util.Properties properties)
           
protected  java.net.URI getTargetURI(java.util.Properties properties, boolean required)
          Gets a URI for the HttpClientFactory.TARGET_HOST_URL property, if set.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Configurator

public Configurator()
Method Detail

configure

public abstract void configure(org.apache.commons.httpclient.HttpClient httpClient,
                               java.util.Properties properties)
                        throws ConfigurationException
Throws:
ConfigurationException

getTargetURI

protected java.net.URI getTargetURI(java.util.Properties properties,
                                    boolean required)
                             throws ConfigurationException
Gets a URI for the HttpClientFactory.TARGET_HOST_URL property, if set.

Parameters:
properties - Properties.
required - If the HttpClientFactory.TARGET_HOST_URL property is required. An exception is thrown if this is true and the property is not present.
Returns:
URI for the HttpClientFactory.TARGET_HOST_URL property, otherwise null if not set.
Throws:
ConfigurationException - HttpClientFactory.TARGET_HOST_URL property is not set an required is true, or the configured URI is invalid.

assertPropertySetAndNotBlank

protected void assertPropertySetAndNotBlank(java.lang.String propertyValue,
                                            java.lang.String propertyName)
                                     throws ConfigurationException
Assert that the property value is not null and not blank.

Parameters:
propertyValue - The value of the property.
propertyName - The name of the property.
Throws:
ConfigurationException

assertPropertyIsInteger

protected void assertPropertyIsInteger(java.lang.String propertyValue,
                                       java.lang.String propertyName)
                                throws ConfigurationException
Assert that the property value is an Integer.

Parameters:
propertyValue - The value of the property.
propertyName - The name of the property.
Throws:
ConfigurationException