public class HttpProducer
extends org.apache.camel.impl.DefaultProducer
Constructor and Description |
---|
HttpProducer(HttpEndpoint endpoint) |
Modifier and Type | Method and Description |
---|---|
protected org.apache.commons.httpclient.HttpMethod |
createMethod(org.apache.camel.Exchange exchange)
Creates the HttpMethod to use to call the remote server, either its GET or POST.
|
protected org.apache.commons.httpclient.methods.RequestEntity |
createRequestEntity(org.apache.camel.Exchange exchange)
Creates a holder object for the data to send to the remote server.
|
protected int |
executeMethod(org.apache.commons.httpclient.HttpMethod method)
Strategy when executing the method (calling the remote server).
|
protected Object |
extractResponseBody(org.apache.commons.httpclient.HttpMethod method,
org.apache.camel.Exchange exchange,
boolean ignoreResponseBody)
Extracts the response from the method as a InputStream.
|
protected static Map<String,String> |
extractResponseHeaders(org.apache.commons.httpclient.Header[] responseHeaders)
Extracts the response headers
|
HttpEndpoint |
getEndpoint() |
org.apache.commons.httpclient.HttpClient |
getHttpClient() |
protected Exception |
populateHttpOperationFailedException(org.apache.camel.Exchange exchange,
org.apache.commons.httpclient.HttpMethod method,
int responseCode) |
protected void |
populateResponse(org.apache.camel.Exchange exchange,
org.apache.commons.httpclient.HttpMethod method,
org.apache.camel.Message in,
org.apache.camel.spi.HeaderFilterStrategy strategy,
int responseCode) |
void |
process(org.apache.camel.Exchange exchange) |
void |
setHttpClient(org.apache.commons.httpclient.HttpClient httpClient) |
createExchange, createExchange, createExchange, doStart, doStop, isSingleton, toString
doResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
public HttpProducer(HttpEndpoint endpoint)
public HttpEndpoint getEndpoint()
getEndpoint
in interface org.apache.camel.EndpointAware
getEndpoint
in class org.apache.camel.impl.DefaultProducer
protected void populateResponse(org.apache.camel.Exchange exchange, org.apache.commons.httpclient.HttpMethod method, org.apache.camel.Message in, org.apache.camel.spi.HeaderFilterStrategy strategy, int responseCode) throws IOException, ClassNotFoundException
IOException
ClassNotFoundException
protected Exception populateHttpOperationFailedException(org.apache.camel.Exchange exchange, org.apache.commons.httpclient.HttpMethod method, int responseCode) throws IOException, ClassNotFoundException
IOException
ClassNotFoundException
protected int executeMethod(org.apache.commons.httpclient.HttpMethod method) throws IOException
method
- the method to executeIOException
- can be thrownprotected static Map<String,String> extractResponseHeaders(org.apache.commons.httpclient.Header[] responseHeaders)
responseHeaders
- the headersprotected Object extractResponseBody(org.apache.commons.httpclient.HttpMethod method, org.apache.camel.Exchange exchange, boolean ignoreResponseBody) throws IOException, ClassNotFoundException
method
- the method that was executedignoreResponseBody
- if it is true, camel don't read the response and cached the input streamIOException
- can be thrownClassNotFoundException
protected org.apache.commons.httpclient.HttpMethod createMethod(org.apache.camel.Exchange exchange) throws Exception
exchange
- the exchangeorg.apache.camel.CamelExchangeException
- is thrown if error creating RequestEntityException
protected org.apache.commons.httpclient.methods.RequestEntity createRequestEntity(org.apache.camel.Exchange exchange) throws org.apache.camel.CamelExchangeException
exchange
- the exchange with the IN message with data to sendorg.apache.camel.CamelExchangeException
- is thrown if error creating RequestEntitypublic org.apache.commons.httpclient.HttpClient getHttpClient()
public void setHttpClient(org.apache.commons.httpclient.HttpClient httpClient)
Apache Camel