Class LeaseOptions
java.lang.Object
com.google.appengine.api.taskqueue.LeaseOptions
Contains various options for lease requests following the builder pattern. Calls to
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));
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
Provides static creation methods forLeaseOptions
. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncountLimit
(long countLimit) Sets the count limit for lease requests.deadlineInSeconds
(@Nullable Double deadlineInSeconds) Sets the deadline for lease requests.boolean
Indicates that all tasks being leased must have the same tag.int
hashCode()
leasePeriod
(long lease, TimeUnit unit) Sets the lease period for lease requests.tag
(byte[] tag) Sets the tag for lease requests.Sets the tag for lease requests.toString()
-
Constructor Details
-
LeaseOptions
A copy constructor forLeaseOptions
.
-
-
Method Details
-
leasePeriod
Sets the lease period for lease requests. Must be positive.- Throws:
IllegalArgumentException
-
countLimit
Sets the count limit for lease requests. Must be positive.- Throws:
IllegalArgumentException
-
deadlineInSeconds
Sets the deadline for lease requests. Must be positive.- Throws:
IllegalArgumentException
-
groupByTag
Indicates that all tasks being leased must have the same tag. Redundant if tag is specified.- Throws:
IllegalArgumentException
-
tag
Sets the tag for lease requests. Must not be null.- Throws:
IllegalArgumentException
-
tag
Sets the tag for lease requests. Must not be null.- Throws:
IllegalArgumentException
-
hashCode
public int hashCode() -
equals
-
toString
-