org.apache.camel.component.http
Class HttpProducer
java.lang.Object
org.apache.camel.impl.ServiceSupport
org.apache.camel.impl.DefaultProducer<HttpExchange>
org.apache.camel.component.http.HttpProducer
- All Implemented Interfaces:
- Processor, Producer<HttpExchange>, Service
public class HttpProducer
- extends DefaultProducer<HttpExchange>
- implements Producer<HttpExchange>
- Version:
- $Revision: 797918 $
Method Summary |
protected org.apache.commons.httpclient.HttpMethod |
createMethod(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(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 InputStream |
extractResponseBody(org.apache.commons.httpclient.HttpMethod method,
Exchange exchange)
Extracts the response from the method as a InputStream. |
org.apache.commons.httpclient.HttpClient |
getHttpClient()
|
void |
process(Exchange exchange)
|
void |
setHttpClient(org.apache.commons.httpclient.HttpClient httpClient)
|
Methods inherited from class org.apache.camel.impl.ServiceSupport |
addChildService, getThreadName, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, nextThreadCounter, removeChildService, start, stop |
HTTP_URI
public static final String HTTP_URI
- See Also:
- Constant Field Values
HTTP_RESPONSE_CODE
public static final String HTTP_RESPONSE_CODE
- See Also:
- Constant Field Values
QUERY
public static final String QUERY
- See Also:
- Constant Field Values
HEADERS_TO_SKIP
@Deprecated
public static final Set<String> HEADERS_TO_SKIP
- Deprecated.
HttpProducer
public HttpProducer(HttpEndpoint endpoint)
process
public void process(Exchange exchange)
throws Exception
- Specified by:
process
in interface Processor
- Throws:
Exception
executeMethod
protected int executeMethod(org.apache.commons.httpclient.HttpMethod method)
throws IOException
- Strategy when executing the method (calling the remote server).
- Parameters:
method
- the method to execute
- Returns:
- the response code
- Throws:
IOException
- can be thrown
extractResponseBody
protected static InputStream extractResponseBody(org.apache.commons.httpclient.HttpMethod method,
Exchange exchange)
throws IOException
- Extracts the response from the method as a InputStream.
- Parameters:
method
- the method that was executed
- Returns:
- the response as a stream
- Throws:
IOException
- can be thrown
createMethod
protected org.apache.commons.httpclient.HttpMethod createMethod(Exchange exchange)
- Creates the HttpMethod to use to call the remote server, either its GET or POST.
- Parameters:
exchange
- the exchange
- Returns:
- the created method as either GET or POST
createRequestEntity
protected org.apache.commons.httpclient.methods.RequestEntity createRequestEntity(Exchange exchange)
- Creates a holder object for the data to send to the remote server.
- Parameters:
exchange
- the exchange with the IN message with data to send
- Returns:
- the data holder
getHttpClient
public org.apache.commons.httpclient.HttpClient getHttpClient()
setHttpClient
public void setHttpClient(org.apache.commons.httpclient.HttpClient httpClient)
Apache CAMEL