public class

DefaultRetryPolicy

extends Object
implements RetryPolicy
java.lang.Object
   ↳ com.android.volley.DefaultRetryPolicy

Class Overview

Default retry policy for requests.

Summary

Constants
float DEFAULT_BACKOFF_MULT The default backoff multiplier
int DEFAULT_MAX_RETRIES The default number of retries
int DEFAULT_TIMEOUT_MS The default socket timeout in milliseconds
Public Constructors
DefaultRetryPolicy()
Constructs a new retry policy using the default timeouts.
DefaultRetryPolicy(int initialTimeoutMs, int maxNumRetries, float backoffMultiplier)
Constructs a new retry policy.
Public Methods
float getBackoffMultiplier()
Returns the backoff multiplier for the policy.
int getCurrentRetryCount()
Returns the current retry count.
int getCurrentTimeout()
Returns the current timeout.
void retry(VolleyError error)
Prepares for the next retry by applying a backoff to the timeout.
Protected Methods
boolean hasAttemptRemaining()
Returns true if this policy has attempts remaining, false otherwise.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.android.volley.RetryPolicy

Constants

public static final float DEFAULT_BACKOFF_MULT

The default backoff multiplier

Constant Value: 1.0

public static final int DEFAULT_MAX_RETRIES

The default number of retries

Constant Value: 1 (0x00000001)

public static final int DEFAULT_TIMEOUT_MS

The default socket timeout in milliseconds

Constant Value: 2500 (0x000009c4)

Public Constructors

public DefaultRetryPolicy ()

Constructs a new retry policy using the default timeouts.

public DefaultRetryPolicy (int initialTimeoutMs, int maxNumRetries, float backoffMultiplier)

Constructs a new retry policy.

Parameters
initialTimeoutMs The initial timeout for the policy.
maxNumRetries The maximum number of retries.
backoffMultiplier Backoff multiplier for the policy.

Public Methods

public float getBackoffMultiplier ()

Returns the backoff multiplier for the policy.

public int getCurrentRetryCount ()

Returns the current retry count.

public int getCurrentTimeout ()

Returns the current timeout.

public void retry (VolleyError error)

Prepares for the next retry by applying a backoff to the timeout.

Parameters
error The error code of the last attempt.
Throws
VolleyError

Protected Methods

protected boolean hasAttemptRemaining ()

Returns true if this policy has attempts remaining, false otherwise.