new HttpBackOffIOExceptionHandler(new ExponentialBackOff()).setSleeper(sleeper));
public LoggingIOExceptionHandler(BackOff backOff) { delegate = new HttpBackOffIOExceptionHandler(backOff); }
@Override public void initialize(HttpRequest httpRequest) throws IOException { httpRequest.setIOExceptionHandler( new HttpBackOffIOExceptionHandler(new ExponentialBackOff())); httpRequest.setUnsuccessfulResponseHandler( new HttpBackOffUnsuccessfulResponseHandler(new ExponentialBackOff())); } }
request.setIOExceptionHandler(new HttpBackOffIOExceptionHandler( new ExponentialBackOff()).setSleeper(sleeper));
@Override public void initialize(HttpRequest httpRequest) throws IOException { httpRequest.setIOExceptionHandler( new HttpBackOffIOExceptionHandler(new ExponentialBackOff())); httpRequest.setUnsuccessfulResponseHandler( new HttpBackOffUnsuccessfulResponseHandler(new ExponentialBackOff())); } }
request.setIOExceptionHandler(new HttpBackOffIOExceptionHandler( new ExponentialBackOff()).setSleeper(sleeper));
= new HttpBackOffUnsuccessfulResponseHandler(new ExponentialBackOff()); final HttpIOExceptionHandler ioExceptionHandler = new HttpBackOffIOExceptionHandler(new ExponentialBackOff());
request.setIOExceptionHandler(new HttpBackOffIOExceptionHandler( new ExponentialBackOff()).setSleeper(sleeper));
request.setParser(new JsonObjectParser(jsonFactory)); request.setIOExceptionHandler(new HttpBackOffIOExceptionHandler(new ExponentialBackOff())); request.setUnsuccessfulResponseHandler( new HttpBackOffUnsuccessfulResponseHandler(new ExponentialBackOff()).setBackOffRequired(
/** Initializes the given request. */ @Override public final void initialize(final HttpRequest request) { request.setReadTimeout(2 * ONEMINITUES); // 2 minutes read timeout final HttpUnsuccessfulResponseHandler backoffHandler = new HttpBackOffUnsuccessfulResponseHandler(new ExponentialBackOff()).setSleeper(sleeper); request.setInterceptor(wrappedCredential); request.setUnsuccessfulResponseHandler( (request1, response, supportsRetry) -> { if (wrappedCredential.handleResponse(request1, response, supportsRetry)) { // If credential decides it can handle it, the return code or message indicated // something specific to authentication, and no backoff is desired. return true; } else if (backoffHandler.handleResponse(request1, response, supportsRetry)) { // Otherwise, we defer to the judgement of our internal backoff handler. LOG.info("Retrying " + request1.getUrl().toString()); return true; } else { return false; } }); request.setIOExceptionHandler( new HttpBackOffIOExceptionHandler(new ExponentialBackOff()).setSleeper(sleeper)); } }
request.setParser(new JsonObjectParser(jsonFactory)); request.setIOExceptionHandler(new HttpBackOffIOExceptionHandler(new ExponentialBackOff())); request.setUnsuccessfulResponseHandler( new HttpBackOffUnsuccessfulResponseHandler(new ExponentialBackOff()).setBackOffRequired(
new HttpBackOffIOExceptionHandler(new ExponentialBackOff()) .setSleeper(sleeper));
private HttpRequest generateHttpRequest( PropertyResolver propertyResolver, HttpTransport httpTransport) throws IOException { HttpRequest httpRequest = httpTransport .createRequestFactory() .buildGetRequest(new GenericUrl(propertyResolver.getResolvedString())); httpRequest.setUnsuccessfulResponseHandler( new HttpBackOffUnsuccessfulResponseHandler(new ExponentialBackOff()) .setBackOffRequired(HttpBackOffUnsuccessfulResponseHandler.BackOffRequired.ALWAYS)); httpRequest.setIOExceptionHandler(new HttpBackOffIOExceptionHandler(new ExponentialBackOff())); return httpRequest; }
new HttpBackOffIOExceptionHandler(new ExponentialBackOff()); if (sleeperOverride != null) { exceptionHandler.setSleeper(sleeperOverride);
new HttpBackOffIOExceptionHandler(new ExponentialBackOff()); if (sleeperOverride != null) { exceptionHandler.setSleeper(sleeperOverride);