org.apache.camel.component.http
Class HttpEndpoint

java.lang.Object
  extended by org.apache.camel.impl.ServiceSupport
      extended by org.apache.camel.impl.DefaultEndpoint
          extended by org.apache.camel.impl.ScheduledPollEndpoint
              extended by org.apache.camel.impl.DefaultPollingEndpoint
                  extended by org.apache.camel.component.http.HttpEndpoint
All Implemented Interfaces:
CamelContextAware, Endpoint, IsSingleton, Service, ShutdownableService, HasId, HeaderFilterStrategyAware
Direct Known Subclasses:
JettyHttpEndpoint, ServletEndpoint

public class HttpEndpoint
extends DefaultPollingEndpoint
implements HeaderFilterStrategyAware

Represents a HTTP endpoint

Version:

Constructor Summary
HttpEndpoint()
           
HttpEndpoint(String endPointURI, HttpComponent component, URI httpURI)
           
HttpEndpoint(String endPointURI, HttpComponent component, URI httpURI, org.apache.commons.httpclient.params.HttpClientParams clientParams, org.apache.commons.httpclient.HttpConnectionManager httpConnectionManager, HttpClientConfigurer clientConfigurer)
           
HttpEndpoint(String endPointURI, HttpComponent component, URI httpURI, org.apache.commons.httpclient.HttpConnectionManager httpConnectionManager)
           
 
Method Summary
 void connect(HttpConsumer consumer)
           
 org.apache.commons.httpclient.HttpClient createHttpClient()
          Factory method used by producers and consumers to create a new HttpClient instance
 PollingConsumer createPollingConsumer()
          Creates a new Polling Consumer so that the caller can poll message exchanges from the consumer using PollingConsumer.receive(), PollingConsumer.receiveNoWait() or PollingConsumer.receive(long) whenever it is ready to do so rather than using the Event Based Consumer returned by Endpoint.createConsumer(Processor)
 Producer createProducer()
          Creates a new producer which is used send messages into the endpoint
 void disconnect(HttpConsumer consumer)
           
 String getAuthMethodPriority()
           
 HttpBinding getBinding()
           
 org.apache.commons.httpclient.params.HttpClientParams getClientParams()
          Provide access to the client parameters used on new HttpClient instances used by producers or consumers of this endpoint.
 HeaderFilterStrategy getHeaderFilterStrategy()
          Gets the header filter strategy used
 HttpClientConfigurer getHttpClientConfigurer()
           
 org.apache.commons.httpclient.HttpConnectionManager getHttpConnectionManager()
           
 URI getHttpUri()
           
 String getPath()
           
 int getPort()
           
 String getProtocol()
           
 String getProxyHost()
           
 int getProxyPort()
           
 boolean isBridgeEndpoint()
           
 boolean isChunked()
           
 boolean isDisableStreamCache()
           
 boolean isLenientProperties()
          Should all properties be known or does the endpoint allow unknown options?

lenient = false means that the endpoint should validate that all given options is known and configured properly.

 boolean isMatchOnUriPrefix()
           
 boolean isSingleton()
          Whether this class supports being singleton or not.
 boolean isThrowExceptionOnFailure()
           
 boolean isTransferException()
           
 void setAuthMethodPriority(String authMethodPriority)
           
 void setBinding(HttpBinding binding)
           
 void setBridgeEndpoint(boolean bridge)
           
 void setChunked(boolean chunked)
           
 void setClientParams(org.apache.commons.httpclient.params.HttpClientParams clientParams)
          Provide access to the client parameters used on new HttpClient instances used by producers or consumers of this endpoint.
 void setDisableStreamCache(boolean disable)
           
 void setHeaderFilterStrategy(HeaderFilterStrategy headerFilterStrategy)
          Sets the header filter strategy to use
 void setHttpClientConfigurer(HttpClientConfigurer httpClientConfigurer)
          Register a custom configuration strategy for new HttpClient instances created by producers or consumers such as to configure authentication mechanisms etc
 void setHttpConnectionManager(org.apache.commons.httpclient.HttpConnectionManager httpConnectionManager)
           
 void setHttpUri(URI httpUri)
           
 void setMatchOnUriPrefix(boolean match)
           
 void setProxyHost(String proxyHost)
           
 void setProxyPort(int proxyPort)
           
 void setThrowExceptionOnFailure(boolean throwExceptionOnFailure)
           
 void setTransferException(boolean transferException)
           
 
Methods inherited from class org.apache.camel.impl.DefaultPollingEndpoint
createConsumer
 
Methods inherited from class org.apache.camel.impl.ScheduledPollEndpoint
configureConsumer, configureProperties, getConsumerProperties, setConsumerProperties
 
Methods inherited from class org.apache.camel.impl.DefaultEndpoint
createEndpointUri, createExchange, createExchange, createExchange, doStart, doStop, equals, getCamelContext, getComponent, getEndpointKey, getEndpointUri, getExchangePattern, getExchangeType, getId, hashCode, isSynchronous, sanitizeUri, setCamelContext, setEndpointUri, setEndpointUriIfNotSpecified, setExchangePattern, setSynchronous, toString
 
Methods inherited from class org.apache.camel.impl.ServiceSupport
addChildService, doResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspended, isSuspending, removeChildService, resume, shutdown, start, start, stop, suspend
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.camel.Service
start, stop
 

Constructor Detail

HttpEndpoint

public HttpEndpoint()

HttpEndpoint

public HttpEndpoint(String endPointURI,
                    HttpComponent component,
                    URI httpURI)
             throws URISyntaxException
Throws:
URISyntaxException

HttpEndpoint

public HttpEndpoint(String endPointURI,
                    HttpComponent component,
                    URI httpURI,
                    org.apache.commons.httpclient.HttpConnectionManager httpConnectionManager)
             throws URISyntaxException
Throws:
URISyntaxException

HttpEndpoint

public HttpEndpoint(String endPointURI,
                    HttpComponent component,
                    URI httpURI,
                    org.apache.commons.httpclient.params.HttpClientParams clientParams,
                    org.apache.commons.httpclient.HttpConnectionManager httpConnectionManager,
                    HttpClientConfigurer clientConfigurer)
             throws URISyntaxException
Throws:
URISyntaxException
Method Detail

createProducer

public Producer createProducer()
                        throws Exception
Description copied from interface: Endpoint
Creates a new producer which is used send messages into the endpoint

Specified by:
createProducer in interface Endpoint
Returns:
a newly created producer
Throws:
Exception - can be thrown

createPollingConsumer

public PollingConsumer createPollingConsumer()
                                      throws Exception
Description copied from interface: Endpoint
Creates a new Polling Consumer so that the caller can poll message exchanges from the consumer using PollingConsumer.receive(), PollingConsumer.receiveNoWait() or PollingConsumer.receive(long) whenever it is ready to do so rather than using the Event Based Consumer returned by Endpoint.createConsumer(Processor)

Specified by:
createPollingConsumer in interface Endpoint
Overrides:
createPollingConsumer in class DefaultEndpoint
Returns:
a newly created pull consumer
Throws:
Exception - if the pull consumer could not be created

createHttpClient

public org.apache.commons.httpclient.HttpClient createHttpClient()
Factory method used by producers and consumers to create a new HttpClient instance


connect

public void connect(HttpConsumer consumer)
             throws Exception
Throws:
Exception

disconnect

public void disconnect(HttpConsumer consumer)
                throws Exception
Throws:
Exception

isLenientProperties

public boolean isLenientProperties()
Description copied from interface: Endpoint
Should all properties be known or does the endpoint allow unknown options?

lenient = false means that the endpoint should validate that all given options is known and configured properly. lenient = true means that the endpoint allows additional unknown options to be passed to it but does not throw a ResolveEndpointFailedException when creating the endpoint.

This options is used by a few components for instance the HTTP based that can have dynamic URI options appended that is targeted for an external system.

Most endpoints is configured to be not lenient.

Specified by:
isLenientProperties in interface Endpoint
Overrides:
isLenientProperties in class DefaultEndpoint
Returns:
whether properties is lenient or not

isSingleton

public boolean isSingleton()
Description copied from interface: IsSingleton
Whether this class supports being singleton or not.

Specified by:
isSingleton in interface IsSingleton
Returns:
true to be a single shared instance, false to create new instances.

getClientParams

public org.apache.commons.httpclient.params.HttpClientParams getClientParams()
Provide access to the client parameters used on new HttpClient instances used by producers or consumers of this endpoint.


setClientParams

public void setClientParams(org.apache.commons.httpclient.params.HttpClientParams clientParams)
Provide access to the client parameters used on new HttpClient instances used by producers or consumers of this endpoint.


getHttpClientConfigurer

public HttpClientConfigurer getHttpClientConfigurer()

setHttpClientConfigurer

public void setHttpClientConfigurer(HttpClientConfigurer httpClientConfigurer)
Register a custom configuration strategy for new HttpClient instances created by producers or consumers such as to configure authentication mechanisms etc

Parameters:
httpClientConfigurer - the strategy for configuring new HttpClient instances

getBinding

public HttpBinding getBinding()

setBinding

public void setBinding(HttpBinding binding)

getPath

public String getPath()

getPort

public int getPort()

getProtocol

public String getProtocol()

getHttpUri

public URI getHttpUri()

setHttpUri

public void setHttpUri(URI httpUri)

getHttpConnectionManager

public org.apache.commons.httpclient.HttpConnectionManager getHttpConnectionManager()

setHttpConnectionManager

public void setHttpConnectionManager(org.apache.commons.httpclient.HttpConnectionManager httpConnectionManager)

getHeaderFilterStrategy

public HeaderFilterStrategy getHeaderFilterStrategy()
Description copied from interface: HeaderFilterStrategyAware
Gets the header filter strategy used

Specified by:
getHeaderFilterStrategy in interface HeaderFilterStrategyAware
Returns:
the strategy

setHeaderFilterStrategy

public void setHeaderFilterStrategy(HeaderFilterStrategy headerFilterStrategy)
Description copied from interface: HeaderFilterStrategyAware
Sets the header filter strategy to use

Specified by:
setHeaderFilterStrategy in interface HeaderFilterStrategyAware
Parameters:
headerFilterStrategy - the strategy

isThrowExceptionOnFailure

public boolean isThrowExceptionOnFailure()

setThrowExceptionOnFailure

public void setThrowExceptionOnFailure(boolean throwExceptionOnFailure)

isBridgeEndpoint

public boolean isBridgeEndpoint()

setBridgeEndpoint

public void setBridgeEndpoint(boolean bridge)

isMatchOnUriPrefix

public boolean isMatchOnUriPrefix()

setMatchOnUriPrefix

public void setMatchOnUriPrefix(boolean match)

isDisableStreamCache

public boolean isDisableStreamCache()

setDisableStreamCache

public void setDisableStreamCache(boolean disable)

isChunked

public boolean isChunked()

setChunked

public void setChunked(boolean chunked)

getProxyHost

public String getProxyHost()

setProxyHost

public void setProxyHost(String proxyHost)

getProxyPort

public int getProxyPort()

setProxyPort

public void setProxyPort(int proxyPort)

getAuthMethodPriority

public String getAuthMethodPriority()

setAuthMethodPriority

public void setAuthMethodPriority(String authMethodPriority)

isTransferException

public boolean isTransferException()

setTransferException

public void setTransferException(boolean transferException)


Apache CAMEL