public abstract class RestCallInterceptor extends Object
Useful if you want to prevent RestCallExceptions
from being thrown on error conditions.
Constructor and Description |
---|
RestCallInterceptor() |
Modifier and Type | Method and Description |
---|---|
void |
onClose(RestCall restCall)
Called when
RestCall.close() is called. |
void |
onConnect(RestCall restCall,
int statusCode,
org.apache.http.HttpRequest req,
org.apache.http.HttpResponse res)
Called immediately after an HTTP response has been received.
|
void |
onInit(RestCall restCall)
Called when
RestCall object is created. |
void |
onRetry(RestCall restCall,
int statusCode,
org.apache.http.HttpRequest req,
org.apache.http.HttpResponse res,
Exception ex)
Called if retry is going to be attempted.
|
public RestCallInterceptor()
public void onInit(RestCall restCall)
RestCall
object is created.restCall
- The restCall object invoking this method.public void onConnect(RestCall restCall, int statusCode, org.apache.http.HttpRequest req, org.apache.http.HttpResponse res)
statusCode
- The HTTP status code received.restCall
- The restCall object invoking this method.req
- The HTTP request object.res
- The HTTP response object.public void onRetry(RestCall restCall, int statusCode, org.apache.http.HttpRequest req, org.apache.http.HttpResponse res, Exception ex)
statusCode
- The HTTP status code received.restCall
- The restCall object invoking this method.req
- The HTTP request object.res
- The HTTP response object.ex
- The exception thrown from the client.public void onClose(RestCall restCall) throws RestCallException
RestCall.close()
is called.restCall
- The restCall object invoking this method.RestCallException
- Error occurred during call.Copyright © 2016–2019 The Apache Software Foundation. All rights reserved.