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 static Object |
extractResponseBody(org.apache.commons.httpclient.HttpMethod method,
org.apache.camel.Exchange exchange)
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, toStringdoResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, resume, shutdown, start, stop, suspendpublic HttpProducer(HttpEndpoint endpoint)
public HttpEndpoint getEndpoint()
getEndpoint in interface org.apache.camel.ProducergetEndpoint in class org.apache.camel.impl.DefaultProducerprotected 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
IOExceptionClassNotFoundExceptionprotected Exception populateHttpOperationFailedException(org.apache.camel.Exchange exchange, org.apache.commons.httpclient.HttpMethod method, int responseCode) throws IOException, ClassNotFoundException
IOExceptionClassNotFoundExceptionprotected 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 static Object extractResponseBody(org.apache.commons.httpclient.HttpMethod method, org.apache.camel.Exchange exchange) throws IOException, ClassNotFoundException
method - the method that was executedIOException - can be thrownClassNotFoundExceptionprotected org.apache.commons.httpclient.HttpMethod createMethod(org.apache.camel.Exchange exchange)
throws Exception
exchange - the exchangeorg.apache.camel.CamelExchangeException - is thrown if error creating RequestEntityExceptionprotected 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