public final class LeaseOptions
extends java.lang.Object
LeaseOptions methods may be chained to specify
multiple options in the one LeaseOptions object.
Notes on usage:
The recommended way to
instantiate a LeaseOptions object is to statically import
LeaseOptions.Builder.* and invoke a static creation method followed by
instance mutators:
import static com.google.appengine.api.taskqueue.LeaseOptions.Builder.*; ... tasks = pullQueue.leaseTasks(withLeasePeriod(2, TimeUnit.HOURS).countLimit(1000));
| Modifier and Type | Class and Description |
|---|---|
static class |
LeaseOptions.Builder
Provides static creation methods for
LeaseOptions. |
| Constructor and Description |
|---|
LeaseOptions(LeaseOptions options)
A copy constructor for
LeaseOptions. |
| Modifier and Type | Method and Description |
|---|---|
LeaseOptions |
countLimit(long countLimit)
Sets the count limit for lease requests.
|
LeaseOptions |
deadlineInSeconds(java.lang.Double deadlineInSeconds)
Sets the deadline for lease requests.
|
boolean |
equals(java.lang.Object obj) |
LeaseOptions |
groupByTag()
Indicates that all tasks being leased must have the same tag.
|
int |
hashCode() |
LeaseOptions |
leasePeriod(long lease,
java.util.concurrent.TimeUnit unit)
Sets the lease period for lease requests.
|
LeaseOptions |
tag(byte[] tag)
Sets the tag for lease requests.
|
LeaseOptions |
tag(java.lang.String tag)
Sets the tag for lease requests.
|
java.lang.String |
toString() |
public LeaseOptions(LeaseOptions options)
LeaseOptions.public LeaseOptions leasePeriod(long lease, java.util.concurrent.TimeUnit unit)
java.lang.IllegalArgumentExceptionpublic LeaseOptions countLimit(long countLimit)
java.lang.IllegalArgumentExceptionpublic LeaseOptions deadlineInSeconds(java.lang.Double deadlineInSeconds)
java.lang.IllegalArgumentExceptionpublic LeaseOptions groupByTag()
java.lang.IllegalArgumentExceptionpublic LeaseOptions tag(byte[] tag)
java.lang.IllegalArgumentExceptionpublic LeaseOptions tag(java.lang.String tag)
java.lang.IllegalArgumentExceptionpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object