org.apache.camel.component.ahc
Interface AhcBinding

All Known Implementing Classes:
DefaultAhcBinding

public interface AhcBinding

Binding from Camel to/from AsyncHttpClient


Method Summary
 void onComplete(AhcEndpoint endpoint, org.apache.camel.Exchange exchange, String url, ByteArrayOutputStream os, int contentLength, int statusCode, String statusText)
          Callback from the AsyncHttpClient when complete and all the response has been received.
 void onHeadersReceived(AhcEndpoint endpoint, org.apache.camel.Exchange exchange, com.ning.http.client.HttpResponseHeaders headers)
          Callback from the AsyncHttpClient when the HTTP headers was received
 void onStatusReceived(AhcEndpoint endpoint, org.apache.camel.Exchange exchange, com.ning.http.client.HttpResponseStatus responseStatus)
          Callback from the AsyncHttpClient when the HTTP response status was received
 void onThrowable(AhcEndpoint endpoint, org.apache.camel.Exchange exchange, Throwable t)
          Callback from the AsyncHttpClient when an exception occurred sending the request.
 com.ning.http.client.Request prepareRequest(AhcEndpoint endpoint, org.apache.camel.Exchange exchange)
          Prepares the AHC Request to be send.
 

Method Detail

prepareRequest

com.ning.http.client.Request prepareRequest(AhcEndpoint endpoint,
                                            org.apache.camel.Exchange exchange)
                                            throws Exception
Prepares the AHC Request to be send.

Parameters:
endpoint - the endpoint
exchange - the exchange
Returns:
the request to send using the AsyncHttpClient
Throws:
Exception - is thrown if error occurred preparing the request

onThrowable

void onThrowable(AhcEndpoint endpoint,
                 org.apache.camel.Exchange exchange,
                 Throwable t)
                 throws Exception
Callback from the AsyncHttpClient when an exception occurred sending the request.

Parameters:
endpoint - the endpoint
exchange - the exchange
t - the thrown exception
Throws:
Exception - is thrown if error occurred in the callback

onStatusReceived

void onStatusReceived(AhcEndpoint endpoint,
                      org.apache.camel.Exchange exchange,
                      com.ning.http.client.HttpResponseStatus responseStatus)
                      throws Exception
Callback from the AsyncHttpClient when the HTTP response status was received

Parameters:
endpoint - the endpoint
exchange - the exchange
responseStatus - the HTTP response status
Throws:
Exception - is thrown if error occurred in the callback

onHeadersReceived

void onHeadersReceived(AhcEndpoint endpoint,
                       org.apache.camel.Exchange exchange,
                       com.ning.http.client.HttpResponseHeaders headers)
                       throws Exception
Callback from the AsyncHttpClient when the HTTP headers was received

Parameters:
endpoint - the endpoint
exchange - the exchange
headers - the HTTP headers
Throws:
Exception - is thrown if error occurred in the callback

onComplete

void onComplete(AhcEndpoint endpoint,
                org.apache.camel.Exchange exchange,
                String url,
                ByteArrayOutputStream os,
                int contentLength,
                int statusCode,
                String statusText)
                throws Exception
Callback from the AsyncHttpClient when complete and all the response has been received.

Parameters:
endpoint - the endpoint
exchange - the exchange
url - the url requested
os - output stream with the HTTP response body
contentLength - length of the response body
statusCode - the http response code
statusText - the http status text
Throws:
Exception - is thrown if error occurred in the callback


Apache CAMEL