com.google.appengine.api.taskqueue
Class RetryOptions
- java.lang.Object
-
- com.google.appengine.api.taskqueue.RetryOptions
-
- All Implemented Interfaces:
- java.io.Serializable
public final class RetryOptions extends java.lang.Object implements java.io.Serializable
Contains various options for a task's retry strategy. Calls toRetryOptions
methods may be chained to specify multiple options in the oneRetryOptions
object.Notes on usage:
The recommended way to instantiate aRetryOptions
object is to statically importRetryOptions.Builder
.* and invoke a static creation method followed by an instance mutator (if needed):import static com.google.appengine.api.taskqueue.RetryOptions.Builder.*; ... RetryOptions retry = withTaskRetryLimit(10).taskAgeLimitSeconds("4d") .minBackoffSeconds(120).maxBackoffSeconds(3600).maxDoublings(5);
QueueFactory.getDefaultQueue()
.add(retryOptions(retry));- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static class
RetryOptions.Builder
Provides static creation methods forRetryOptions
.
-
Constructor Summary
Constructors Constructor and Description RetryOptions(RetryOptions options)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description boolean
equals(java.lang.Object obj)
int
hashCode()
RetryOptions
maxBackoffSeconds(double maxBackoffSeconds)
Sets the maximum retry backoff interval, in seconds.RetryOptions
maxDoublings(int maxDoublings)
Sets the maximum times the retry backoff interval should double before rising linearly to the maximum.RetryOptions
minBackoffSeconds(double minBackoffSeconds)
Sets the minimum retry backoff interval, in seconds.RetryOptions
taskAgeLimitSeconds(long taskAgeLimitSeconds)
Sets the maximum age from the first attempt to execute a task after which any new task failure can be permanent.RetryOptions
taskRetryLimit(int taskRetryLimit)
Sets the number of retries allowed before a task can fail permanently.java.lang.String
toString()
-
-
-
Constructor Detail
-
RetryOptions
public RetryOptions(RetryOptions options)
-
-
Method Detail
-
taskRetryLimit
public RetryOptions taskRetryLimit(int taskRetryLimit)
Sets the number of retries allowed before a task can fail permanently. If both taskRetryLimit and taskAgeLimitSeconds are specified, then both limits must be exceeded before a task can fail permanently.
-
taskAgeLimitSeconds
public RetryOptions taskAgeLimitSeconds(long taskAgeLimitSeconds)
Sets the maximum age from the first attempt to execute a task after which any new task failure can be permanent. If both taskRetryLimit and taskAgeLimitSeconds are specified, then both limits must be exceeded before a task can fail permanently.- Parameters:
taskAgeLimitSeconds
- The age limit in seconds. Must not be negative.- Returns:
- the RetryOptions object for chaining.
-
minBackoffSeconds
public RetryOptions minBackoffSeconds(double minBackoffSeconds)
Sets the minimum retry backoff interval, in seconds.- Parameters:
minBackoffSeconds
- Seconds value for the minimum backoff interval.- Returns:
- the RetryOptions object for chaining.
-
maxBackoffSeconds
public RetryOptions maxBackoffSeconds(double maxBackoffSeconds)
Sets the maximum retry backoff interval, in seconds.- Parameters:
maxBackoffSeconds
- Seconds value for the maximum backoff interval.- Returns:
- the RetryOptions object for chaining.
-
maxDoublings
public RetryOptions maxDoublings(int maxDoublings)
Sets the maximum times the retry backoff interval should double before rising linearly to the maximum.- Parameters:
maxDoublings
- The number of allowed doublings. Must not be negative.- Returns:
- the RetryOptions object for chaining.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-