Package com.google.api.client.util

Examples of com.google.api.client.util.ExponentialBackOff


   */
  protected void configure(final HttpRequest request) {
    request.getHeaders().setAuthorization(String.format("OAuth %s", token));
    request.setParser(new JsonObjectParser(jsonFactory));

    final ExponentialBackOff backoff = new ExponentialBackOff.Builder().setInitialIntervalMillis(500)
        .setMaxElapsedTimeMillis(60000).setMaxIntervalMillis(30000).setMultiplier(1.5)
        .setRandomizationFactor(0.5).build();
    request.setUnsuccessfulResponseHandler(new HttpBackOffUnsuccessfulResponseHandler(backoff));
  }
View Full Code Here

TOP

Related Classes of com.google.api.client.util.ExponentialBackOff

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.