|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.camel.impl.ServiceSupport
org.apache.camel.impl.DefaultProducer
org.apache.camel.component.http4.HttpProducer
public class HttpProducer
| Field Summary |
|---|
| Fields inherited from class org.apache.camel.impl.DefaultProducer |
|---|
log |
| Constructor Summary | |
|---|---|
HttpProducer(HttpEndpoint endpoint)
|
|
| Method Summary | |
|---|---|
protected org.apache.http.client.methods.HttpRequestBase |
createMethod(Exchange exchange)
Creates the HttpMethod to use to call the remote server, either its GET or POST. |
protected org.apache.http.HttpEntity |
createRequestEntity(Exchange exchange)
Creates a holder object for the data to send to the remote server. |
protected org.apache.http.HttpResponse |
executeMethod(org.apache.http.client.methods.HttpUriRequest httpRequest)
Strategy when executing the method (calling the remote server). |
protected static Object |
extractResponseBody(org.apache.http.client.methods.HttpRequestBase httpRequest,
org.apache.http.HttpResponse httpResponse,
Exchange exchange)
Extracts the response from the method as a InputStream. |
protected static Map<String,String> |
extractResponseHeaders(org.apache.http.Header[] responseHeaders)
Extracts the response headers |
HttpEndpoint |
getEndpoint()
Gets the endpoint this producer sends to. |
org.apache.http.client.HttpClient |
getHttpClient()
|
protected Exception |
populateHttpOperationFailedException(Exchange exchange,
org.apache.http.client.methods.HttpRequestBase httpRequest,
org.apache.http.HttpResponse httpResponse,
int responseCode)
|
protected void |
populateResponse(Exchange exchange,
org.apache.http.client.methods.HttpRequestBase httpRequest,
org.apache.http.HttpResponse httpResponse,
Message in,
HeaderFilterStrategy strategy,
int responseCode)
|
void |
process(Exchange exchange)
Processes the message exchange |
void |
setHttpClient(org.apache.http.client.HttpClient httpClient)
|
| Methods inherited from class org.apache.camel.impl.DefaultProducer |
|---|
createExchange, createExchange, createExchange, doStart, doStop, isSingleton, 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, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.apache.camel.Service |
|---|
start, stop |
| Constructor Detail |
|---|
public HttpProducer(HttpEndpoint endpoint)
| Method Detail |
|---|
public void process(Exchange exchange)
throws Exception
Processor
exchange - the message exchange
Exception - if an internal processing error has occurred.public HttpEndpoint getEndpoint()
Producer
getEndpoint in interface ProducergetEndpoint in class DefaultProducer
protected void populateResponse(Exchange exchange,
org.apache.http.client.methods.HttpRequestBase httpRequest,
org.apache.http.HttpResponse httpResponse,
Message in,
HeaderFilterStrategy strategy,
int responseCode)
throws IOException,
ClassNotFoundException
IOException
ClassNotFoundException
protected Exception populateHttpOperationFailedException(Exchange exchange,
org.apache.http.client.methods.HttpRequestBase httpRequest,
org.apache.http.HttpResponse httpResponse,
int responseCode)
throws IOException,
ClassNotFoundException
IOException
ClassNotFoundException
protected org.apache.http.HttpResponse executeMethod(org.apache.http.client.methods.HttpUriRequest httpRequest)
throws IOException
httpRequest - the http Request to execute
IOException - can be thrownprotected static Map<String,String> extractResponseHeaders(org.apache.http.Header[] responseHeaders)
responseHeaders - the headers
protected static Object extractResponseBody(org.apache.http.client.methods.HttpRequestBase httpRequest,
org.apache.http.HttpResponse httpResponse,
Exchange exchange)
throws IOException,
ClassNotFoundException
httpRequest - the method that was executed
IOException - can be thrown
ClassNotFoundException
protected org.apache.http.client.methods.HttpRequestBase createMethod(Exchange exchange)
throws URISyntaxException,
CamelExchangeException
exchange - the exchange
URISyntaxException - is thrown if the URI is invalid
CamelExchangeException - is thrown if error creating RequestEntity
protected org.apache.http.HttpEntity createRequestEntity(Exchange exchange)
throws CamelExchangeException
exchange - the exchange with the IN message with data to send
CamelExchangeException - is thrown if error creating RequestEntitypublic org.apache.http.client.HttpClient getHttpClient()
public void setHttpClient(org.apache.http.client.HttpClient httpClient)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||