public interface

BackoffPolicy

com.google.gdata.client.uploader.BackoffPolicy

Class Overview

Policy class for determining how long to wait before retrying an HTTP request.

Summary

Constants
long STOP Value indicating that no more retries should be made, .
Fields
public static final BackoffPolicy DEFAULT Default backoff policy with a factor of 2, starting at 500ms and getting capped at 64000ms.
Public Methods
abstract long getNextBackoffMs()
Gets the number of milliseconds to wait before retrying an HTTP request.
abstract void reset()
Resets the policy to begin from its initial state.

Constants

public static final long STOP

Value indicating that no more retries should be made, .

Constant Value: -1 (0xffffffffffffffff)

Fields

public static final BackoffPolicy DEFAULT

Default backoff policy with a factor of 2, starting at 500ms and getting capped at 64000ms.

Public Methods

public abstract long getNextBackoffMs ()

Gets the number of milliseconds to wait before retrying an HTTP request. If STOP is returned, no retries should be made. This method should be used as follows:

   long backoffTime = backoffPolicy.getNextBackoffMs();
   if (backoffTime = BackoffPolicy.STOP) {
     // Stop retrying.
   } else {
     // Retry after backoffTime.
   }
 

Returns
  • the number of milliseconds to wait when backing off requests, or STOP if no more retries should be made

public abstract void reset ()

Resets the policy to begin from its initial state.