org.apache.camel.component.http4
Class HttpComponent

java.lang.Object
  extended by org.apache.camel.support.ServiceSupport
      extended by org.apache.camel.impl.DefaultComponent
          extended by org.apache.camel.impl.HeaderFilterStrategyComponent
              extended by org.apache.camel.component.http4.HttpComponent
All Implemented Interfaces:
org.apache.camel.CamelContextAware, org.apache.camel.Component, org.apache.camel.Service, org.apache.camel.ShutdownableService, org.apache.camel.spi.HeaderFilterStrategyAware, org.apache.camel.StatefulService, org.apache.camel.SuspendableService

public class HttpComponent
extends org.apache.camel.impl.HeaderFilterStrategyComponent

Defines the HTTP4 Component

Version:

Field Summary
protected  org.apache.http.conn.HttpClientConnectionManager clientConnectionManager
           
protected  int connectionsPerRoute
           
protected  long connectionTimeToLive
           
protected  org.apache.http.client.CookieStore cookieStore
           
protected  HttpBinding httpBinding
           
protected  HttpClientConfigurer httpClientConfigurer
           
protected  org.apache.http.protocol.HttpContext httpContext
           
protected  int maxTotalConnections
           
protected  org.apache.camel.util.jsse.SSLContextParameters sslContextParameters
           
protected  org.apache.http.conn.ssl.X509HostnameVerifier x509HostnameVerifier
           
 
Fields inherited from class org.apache.camel.support.ServiceSupport
shutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending
 
Constructor Summary
HttpComponent()
           
 
Method Summary
 void connect(HttpConsumer consumer)
          Connects the URL specified on the endpoint to the specified processor.
protected  org.apache.http.conn.HttpClientConnectionManager createConnectionManager(org.apache.http.config.Registry<org.apache.http.conn.socket.ConnectionSocketFactory> registry)
           
protected  org.apache.http.config.Registry<org.apache.http.conn.socket.ConnectionSocketFactory> createConnectionRegistry(org.apache.http.conn.ssl.X509HostnameVerifier x509HostnameVerifier, org.apache.camel.util.jsse.SSLContextParameters sslContextParams)
           
protected  org.apache.camel.Endpoint createEndpoint(String uri, String remaining, Map<String,Object> parameters)
           
protected  HttpClientConfigurer createHttpClientConfigurer(Map<String,Object> parameters, boolean secure)
          Creates the HttpClientConfigurer based on the given parameters
 void disconnect(HttpConsumer consumer)
          Disconnects the URL specified on the endpoint from the specified processor.
 void doStart()
           
 void doStop()
           
 org.apache.http.conn.HttpClientConnectionManager getClientConnectionManager()
           
 int getConnectionsPerRoute()
           
 long getConnectionTimeToLive()
           
 org.apache.http.client.CookieStore getCookieStore()
           
 HttpBinding getHttpBinding()
           
 HttpClientConfigurer getHttpClientConfigurer()
           
 org.apache.http.protocol.HttpContext getHttpContext()
           
 int getMaxTotalConnections()
           
 org.apache.camel.util.jsse.SSLContextParameters getSslContextParameters()
           
 org.apache.http.conn.ssl.X509HostnameVerifier getX509HostnameVerifier()
           
 void setClientConnectionManager(org.apache.http.conn.HttpClientConnectionManager clientConnectionManager)
           
 void setConnectionsPerRoute(int connectionsPerRoute)
           
 void setConnectionTimeToLive(long connectionTimeToLive)
           
 void setCookieStore(org.apache.http.client.CookieStore cookieStore)
           
 void setHttpBinding(HttpBinding httpBinding)
           
 void setHttpClientConfigurer(HttpClientConfigurer httpClientConfigurer)
           
 void setHttpContext(org.apache.http.protocol.HttpContext httpContext)
           
 void setMaxTotalConnections(int maxTotalConnections)
           
 void setSslContextParameters(org.apache.camel.util.jsse.SSLContextParameters sslContextParameters)
           
 void setX509HostnameVerifier(org.apache.http.conn.ssl.X509HostnameVerifier x509HostnameVerifier)
           
protected  boolean useIntrospectionOnEndpoint()
           
 
Methods inherited from class org.apache.camel.impl.HeaderFilterStrategyComponent
getHeaderFilterStrategy, setEndpointHeaderFilterStrategy, setHeaderFilterStrategy
 
Methods inherited from class org.apache.camel.impl.DefaultComponent
afterConfiguration, createComponentConfiguration, createConfiguration, createEndpoint, getAndRemoveOrResolveReferenceParameter, getAndRemoveOrResolveReferenceParameter, getAndRemoveParameter, getAndRemoveParameter, getCamelContext, ifStartsWithReturnRemainder, preProcessUri, resolveAndRemoveReferenceListParameter, resolveAndRemoveReferenceListParameter, resolveAndRemoveReferenceParameter, resolveAndRemoveReferenceParameter, setCamelContext, setProperties, useRawUri, validateParameters, validateURI
 
Methods inherited from class org.apache.camel.support.ServiceSupport
doResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, resume, shutdown, start, stop, suspend
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

httpClientConfigurer

protected HttpClientConfigurer httpClientConfigurer

clientConnectionManager

protected org.apache.http.conn.HttpClientConnectionManager clientConnectionManager

httpBinding

protected HttpBinding httpBinding

httpContext

protected org.apache.http.protocol.HttpContext httpContext

sslContextParameters

protected org.apache.camel.util.jsse.SSLContextParameters sslContextParameters

x509HostnameVerifier

protected org.apache.http.conn.ssl.X509HostnameVerifier x509HostnameVerifier

cookieStore

protected org.apache.http.client.CookieStore cookieStore

maxTotalConnections

protected int maxTotalConnections

connectionsPerRoute

protected int connectionsPerRoute

connectionTimeToLive

protected long connectionTimeToLive
Constructor Detail

HttpComponent

public HttpComponent()
Method Detail

connect

public void connect(HttpConsumer consumer)
             throws Exception
Connects the URL specified on the endpoint to the specified processor.

Parameters:
consumer - the consumer
Throws:
Exception - can be thrown

disconnect

public void disconnect(HttpConsumer consumer)
                throws Exception
Disconnects the URL specified on the endpoint from the specified processor.

Parameters:
consumer - the consumer
Throws:
Exception - can be thrown

createHttpClientConfigurer

protected HttpClientConfigurer createHttpClientConfigurer(Map<String,Object> parameters,
                                                          boolean secure)
                                                   throws Exception
Creates the HttpClientConfigurer based on the given parameters

Parameters:
parameters - the map of parameters
secure - whether the endpoint is secure (eg https4)
Returns:
the configurer
Throws:
Exception - is thrown if error creating configurer

createEndpoint

protected org.apache.camel.Endpoint createEndpoint(String uri,
                                                   String remaining,
                                                   Map<String,Object> parameters)
                                            throws Exception
Specified by:
createEndpoint in class org.apache.camel.impl.DefaultComponent
Throws:
Exception

createConnectionRegistry

protected org.apache.http.config.Registry<org.apache.http.conn.socket.ConnectionSocketFactory> createConnectionRegistry(org.apache.http.conn.ssl.X509HostnameVerifier x509HostnameVerifier,
                                                                                                                        org.apache.camel.util.jsse.SSLContextParameters sslContextParams)
                                                                                                                 throws GeneralSecurityException,
                                                                                                                        IOException
Throws:
GeneralSecurityException
IOException

createConnectionManager

protected org.apache.http.conn.HttpClientConnectionManager createConnectionManager(org.apache.http.config.Registry<org.apache.http.conn.socket.ConnectionSocketFactory> registry)

useIntrospectionOnEndpoint

protected boolean useIntrospectionOnEndpoint()
Overrides:
useIntrospectionOnEndpoint in class org.apache.camel.impl.DefaultComponent

getHttpClientConfigurer

public HttpClientConfigurer getHttpClientConfigurer()

setHttpClientConfigurer

public void setHttpClientConfigurer(HttpClientConfigurer httpClientConfigurer)

getClientConnectionManager

public org.apache.http.conn.HttpClientConnectionManager getClientConnectionManager()

setClientConnectionManager

public void setClientConnectionManager(org.apache.http.conn.HttpClientConnectionManager clientConnectionManager)

getHttpBinding

public HttpBinding getHttpBinding()

setHttpBinding

public void setHttpBinding(HttpBinding httpBinding)

getHttpContext

public org.apache.http.protocol.HttpContext getHttpContext()

setHttpContext

public void setHttpContext(org.apache.http.protocol.HttpContext httpContext)

getSslContextParameters

public org.apache.camel.util.jsse.SSLContextParameters getSslContextParameters()

setSslContextParameters

public void setSslContextParameters(org.apache.camel.util.jsse.SSLContextParameters sslContextParameters)

getX509HostnameVerifier

public org.apache.http.conn.ssl.X509HostnameVerifier getX509HostnameVerifier()

setX509HostnameVerifier

public void setX509HostnameVerifier(org.apache.http.conn.ssl.X509HostnameVerifier x509HostnameVerifier)

getMaxTotalConnections

public int getMaxTotalConnections()

setMaxTotalConnections

public void setMaxTotalConnections(int maxTotalConnections)

getConnectionsPerRoute

public int getConnectionsPerRoute()

setConnectionsPerRoute

public void setConnectionsPerRoute(int connectionsPerRoute)

getConnectionTimeToLive

public long getConnectionTimeToLive()

setConnectionTimeToLive

public void setConnectionTimeToLive(long connectionTimeToLive)

getCookieStore

public org.apache.http.client.CookieStore getCookieStore()

setCookieStore

public void setCookieStore(org.apache.http.client.CookieStore cookieStore)

doStart

public void doStart()
             throws Exception
Overrides:
doStart in class org.apache.camel.impl.DefaultComponent
Throws:
Exception

doStop

public void doStop()
            throws Exception
Overrides:
doStop in class org.apache.camel.impl.DefaultComponent
Throws:
Exception


Apache Camel