Package org.apache.camel.component.ahc
Interface AhcBinding
-
- All Known Implementing Classes:
DefaultAhcBinding
public interface AhcBinding
Binding from Camel to/fromcom.ning.http.client.AsyncHttpClient
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
onComplete(AhcEndpoint endpoint, org.apache.camel.Exchange exchange, String url, ByteArrayOutputStream os, int contentLength, int statusCode, String statusText)
Callback from thecom.ning.http.client.AsyncHttpClient
when complete and all the response has been received.void
onHeadersReceived(AhcEndpoint endpoint, org.apache.camel.Exchange exchange, io.netty.handler.codec.http.HttpHeaders headers)
Callback from thecom.ning.http.client.AsyncHttpClient
when the HTTP headers was receivedvoid
onStatusReceived(AhcEndpoint endpoint, org.apache.camel.Exchange exchange, org.asynchttpclient.HttpResponseStatus responseStatus)
Callback from thecom.ning.http.client.AsyncHttpClient
when the HTTP response status was receivedvoid
onThrowable(AhcEndpoint endpoint, org.apache.camel.Exchange exchange, Throwable t)
Callback from thecom.ning.http.client.AsyncHttpClient
when an exception occurred sending the request.org.asynchttpclient.Request
prepareRequest(AhcEndpoint endpoint, org.apache.camel.Exchange exchange)
Prepares the AHCRequest
to be send.
-
-
-
Method Detail
-
prepareRequest
org.asynchttpclient.Request prepareRequest(AhcEndpoint endpoint, org.apache.camel.Exchange exchange) throws Exception
Prepares the AHCRequest
to be send.- Parameters:
endpoint
- the endpointexchange
- the exchange- Returns:
- the request to send using the
com.ning.http.client.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 thecom.ning.http.client.AsyncHttpClient
when an exception occurred sending the request.- Parameters:
endpoint
- the endpointexchange
- the exchanget
- the thrown exception- Throws:
Exception
- is thrown if error occurred in the callback
-
onStatusReceived
void onStatusReceived(AhcEndpoint endpoint, org.apache.camel.Exchange exchange, org.asynchttpclient.HttpResponseStatus responseStatus) throws Exception
Callback from thecom.ning.http.client.AsyncHttpClient
when the HTTP response status was received- Parameters:
endpoint
- the endpointexchange
- the exchangeresponseStatus
- the HTTP response status- Throws:
Exception
- is thrown if error occurred in the callback
-
onHeadersReceived
void onHeadersReceived(AhcEndpoint endpoint, org.apache.camel.Exchange exchange, io.netty.handler.codec.http.HttpHeaders headers) throws Exception
Callback from thecom.ning.http.client.AsyncHttpClient
when the HTTP headers was received- Parameters:
endpoint
- the endpointexchange
- the exchangeheaders
- 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 thecom.ning.http.client.AsyncHttpClient
when complete and all the response has been received.- Parameters:
endpoint
- the endpointexchange
- the exchangeurl
- the url requestedos
- output stream with the HTTP response bodycontentLength
- length of the response bodystatusCode
- the http response codestatusText
- the http status text- Throws:
Exception
- is thrown if error occurred in the callback
-
-