Package com.google.appengine.api.taskqueue (2.0.0)

Provides a mechanism to perform work initiated by a user request, outside of that request. See Also: com.google.appengine.api.taskqueue.Queue, The Task Queue Java API in the Google App Engine Developer's Guide.

Classes

DeferredTaskContext

Resources for managing DeferredTask.

IQueueFactoryProvider

Factory provider for IQueueFactory.

Note: This class is not intended for end users.

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 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));
 

LeaseOptions.Builder

Provides static creation methods for LeaseOptions.

QueueConstants

Describes various taskqueue limits.

QueueFactory

Creates Queue objects. QueueFactory is thread safe.

QueueStatistics

QueueStatistics allow observation of the rate that tasks on a given queue are being executed. Note that statistics provided are only approximate, and some statistics may be delayed or transiently unavailable.

RetryOptions

Contains various options for a task's retry strategy. Calls to RetryOptions methods may be chained to specify multiple options in the one RetryOptions object.

Notes on usage:
The recommended way to instantiate a RetryOptions object is to statically import 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));
 

RetryOptions.Builder

Provides static creation methods for RetryOptions.

TaskHandle

Created from Queue#add(TaskOptions). Contains the task name (generated if otherwise unspecified), task ETA (computed if not specified) and queue name. The queue name and task name uniquely identify the task for an application.

TaskOptions

Contains various options for a task following the builder pattern. Calls to TaskOptions methods may be chained to specify multiple options in the one TaskOptions object.

taskOptions can have either TaskOptions.Method PULL or a PUSH-related method, e.g. POST, GET, ... Tasks with PULL method can only be added into a PULL queue and PUSH tasks can only be added into a PUSH queue.

Notes on usage:
The recommended way to instantiate a TaskOptions object is to statically import Builder.* and invoke a static creation method followed by an instance mutator (if needed):


 import static com.google.appengine.api.taskqueue.TaskOptions.Builder.*;

 ...
 QueueFactory#getDefaultQueue().add(withUrl(url).etaMillis(eta));
 

TaskOptions.Builder

Provides static creation methods for TaskOptions.

TaskQueuePb

TaskQueuePb.TaskPayload

TaskQueuePb.TaskPayload.Builder

TaskQueuePb.TaskQueueAcl

TaskQueuePb.TaskQueueAcl.Builder

TaskQueuePb.TaskQueueAddRequest

TaskQueuePb.TaskQueueAddRequest.Builder

TaskQueuePb.TaskQueueAddRequest.CronTimetable

TaskQueuePb.TaskQueueAddRequest.CronTimetable.Builder

TaskQueuePb.TaskQueueAddRequest.Header

TaskQueuePb.TaskQueueAddRequest.Header.Builder

TaskQueuePb.TaskQueueAddResponse

TaskQueuePb.TaskQueueAddResponse.Builder

TaskQueuePb.TaskQueueBulkAddRequest

TaskQueuePb.TaskQueueBulkAddRequest.Builder

TaskQueuePb.TaskQueueBulkAddResponse

TaskQueuePb.TaskQueueBulkAddResponse.Builder

TaskQueuePb.TaskQueueBulkAddResponse.TaskResult

TaskQueuePb.TaskQueueBulkAddResponse.TaskResult.Builder

TaskQueuePb.TaskQueueDeleteGroupRequest

TaskQueuePb.TaskQueueDeleteGroupRequest.Builder

TaskQueuePb.TaskQueueDeleteGroupResponse

TaskQueuePb.TaskQueueDeleteGroupResponse.Builder

TaskQueuePb.TaskQueueDeleteQueueRequest

TaskQueuePb.TaskQueueDeleteQueueRequest.Builder

TaskQueuePb.TaskQueueDeleteQueueResponse

TaskQueuePb.TaskQueueDeleteQueueResponse.Builder

TaskQueuePb.TaskQueueDeleteRequest

TaskQueuePb.TaskQueueDeleteRequest.Builder

TaskQueuePb.TaskQueueDeleteResponse

TaskQueuePb.TaskQueueDeleteResponse.Builder

TaskQueuePb.TaskQueueFetchQueueStatsRequest

TaskQueuePb.TaskQueueFetchQueueStatsRequest.Builder

TaskQueuePb.TaskQueueFetchQueueStatsResponse

TaskQueuePb.TaskQueueFetchQueueStatsResponse.Builder

TaskQueuePb.TaskQueueFetchQueueStatsResponse.QueueStats

TaskQueuePb.TaskQueueFetchQueueStatsResponse.QueueStats.Builder

TaskQueuePb.TaskQueueFetchQueuesRequest

TaskQueuePb.TaskQueueFetchQueuesRequest.Builder

TaskQueuePb.TaskQueueFetchQueuesResponse

TaskQueuePb.TaskQueueFetchQueuesResponse.Builder

TaskQueuePb.TaskQueueFetchQueuesResponse.Queue

TaskQueuePb.TaskQueueFetchQueuesResponse.Queue.Builder

TaskQueuePb.TaskQueueFetchTaskRequest

TaskQueuePb.TaskQueueFetchTaskRequest.Builder

TaskQueuePb.TaskQueueFetchTaskResponse

TaskQueuePb.TaskQueueFetchTaskResponse.Builder

TaskQueuePb.TaskQueueForceRunRequest

TaskQueuePb.TaskQueueForceRunRequest.Builder

TaskQueuePb.TaskQueueForceRunResponse

TaskQueuePb.TaskQueueForceRunResponse.Builder

TaskQueuePb.TaskQueueHttpHeader

TaskQueuePb.TaskQueueHttpHeader.Builder

TaskQueuePb.TaskQueueMode

TaskQueuePb.TaskQueueMode.Builder

TaskQueuePb.TaskQueueModifyTaskLeaseRequest

TaskQueuePb.TaskQueueModifyTaskLeaseRequest.Builder

TaskQueuePb.TaskQueueModifyTaskLeaseResponse

TaskQueuePb.TaskQueueModifyTaskLeaseResponse.Builder

TaskQueuePb.TaskQueuePauseQueueRequest

TaskQueuePb.TaskQueuePauseQueueRequest.Builder

TaskQueuePb.TaskQueuePauseQueueResponse

TaskQueuePb.TaskQueuePauseQueueResponse.Builder

TaskQueuePb.TaskQueuePurgeQueueRequest

TaskQueuePb.TaskQueuePurgeQueueRequest.Builder

TaskQueuePb.TaskQueuePurgeQueueResponse

TaskQueuePb.TaskQueuePurgeQueueResponse.Builder

TaskQueuePb.TaskQueueQueryAndOwnTasksRequest

TaskQueuePb.TaskQueueQueryAndOwnTasksRequest.Builder

TaskQueuePb.TaskQueueQueryAndOwnTasksResponse

TaskQueuePb.TaskQueueQueryAndOwnTasksResponse.Builder

TaskQueuePb.TaskQueueQueryAndOwnTasksResponse.Task

TaskQueuePb.TaskQueueQueryAndOwnTasksResponse.Task.Builder

TaskQueuePb.TaskQueueQueryTasksRequest

TaskQueuePb.TaskQueueQueryTasksRequest.Builder

TaskQueuePb.TaskQueueQueryTasksResponse

TaskQueuePb.TaskQueueQueryTasksResponse.Builder

TaskQueuePb.TaskQueueQueryTasksResponse.Task

TaskQueuePb.TaskQueueQueryTasksResponse.Task.Builder

TaskQueuePb.TaskQueueQueryTasksResponse.Task.CronTimetable

TaskQueuePb.TaskQueueQueryTasksResponse.Task.CronTimetable.Builder

TaskQueuePb.TaskQueueQueryTasksResponse.Task.Header

TaskQueuePb.TaskQueueQueryTasksResponse.Task.Header.Builder

TaskQueuePb.TaskQueueQueryTasksResponse.Task.RunLog

TaskQueuePb.TaskQueueQueryTasksResponse.Task.RunLog.Builder

TaskQueuePb.TaskQueueRetryParameters

TaskQueuePb.TaskQueueRetryParameters.Builder

TaskQueuePb.TaskQueueScannerQueueInfo

TaskQueuePb.TaskQueueScannerQueueInfo.Builder

TaskQueuePb.TaskQueueServiceError

TaskQueuePb.TaskQueueServiceError.Builder

TaskQueuePb.TaskQueueUpdateQueueRequest

TaskQueuePb.TaskQueueUpdateQueueRequest.Builder

TaskQueuePb.TaskQueueUpdateQueueResponse

TaskQueuePb.TaskQueueUpdateQueueResponse.Builder

TaskQueuePb.TaskQueueUpdateStorageLimitRequest

TaskQueuePb.TaskQueueUpdateStorageLimitRequest.Builder

TaskQueuePb.TaskQueueUpdateStorageLimitResponse

TaskQueuePb.TaskQueueUpdateStorageLimitResponse.Builder

TaskQueuePbInternalDescriptors

Interfaces

DeferredTask

Interface for deferred tasks. Classes implementing this interface may use TaskOptions#payload(DeferredTask) to serialize the DeferredTask into the payload of the task definition. The DeferredTask#run() method will be called when the task is received by the built in DeferredTask servlet.

Normal return from this method is considered success and will not retry unless DeferredTaskContext#markForRetry is called. Exceptions thrown from this method will indicate a failure and will be processed as a retry attempt unless DeferredTaskContext#setDoNotRetry(boolean) was set to true.

IQueueFactory

Creates Queue objects. QueueFactory is thread safe.

Queue

Queue is used to manage a task queue.

Implementations of this interface must be threadsafe.

Queues are transactional. If a datastore transaction is in progress when #add() or #add(TaskOptions) is invoked, the task will only be added to the queue if the datastore transaction successfully commits. If you want to add a task to a queue and have that operation succeed or fail independently of an existing datastore transaction you can invoke #add(Transaction, TaskOptions) with a null transaction argument. Note that while the addition of the task to the queue can participate in an existing transaction, the execution of the task cannot participate in this transaction. In other words, when the transaction commits you are guaranteed that your task will be added and run, not that your task executed successfully.

Queues may be configured in either push or pull mode, but they share the same interface. However, only tasks with TaskOptions.Method#PULL may be added to pull queues. The tasks in push queues must be added with one of the other available methods.

Pull mode queues do not automatically deliver tasks to the application. The application is required to call leaseTasks to acquire a lease on the task and process them explicitly. Attempting to call leaseTasks on a push queue causes a InvalidQueueModeException to be thrown. When the task processing has finished processing a task that is leased, it should call #deleteTask(String). If deleteTask is not called before the lease expires, the task will again be available for lease.

Queue mode can be switched between push and pull. When switching from push to pull, tasks will stay in the task queue and are available for lease, but url and headers information will be ignored when returning the tasks. When switching from pull to push, existing tasks will remain in the queue but will fail on auto-execution because they lack a url. If the queue mode is once again changed to pull, these tasks will eventually be available for lease.

TaskQueuePb.TaskPayloadOrBuilder

TaskQueuePb.TaskQueueAclOrBuilder

TaskQueuePb.TaskQueueAddRequest.CronTimetableOrBuilder

TaskQueuePb.TaskQueueAddRequest.HeaderOrBuilder

TaskQueuePb.TaskQueueAddRequestOrBuilder

TaskQueuePb.TaskQueueAddResponseOrBuilder

TaskQueuePb.TaskQueueBulkAddRequestOrBuilder

TaskQueuePb.TaskQueueBulkAddResponse.TaskResultOrBuilder

TaskQueuePb.TaskQueueBulkAddResponseOrBuilder

TaskQueuePb.TaskQueueDeleteGroupRequestOrBuilder

TaskQueuePb.TaskQueueDeleteGroupResponseOrBuilder

TaskQueuePb.TaskQueueDeleteQueueRequestOrBuilder

TaskQueuePb.TaskQueueDeleteQueueResponseOrBuilder

TaskQueuePb.TaskQueueDeleteRequestOrBuilder

TaskQueuePb.TaskQueueDeleteResponseOrBuilder

TaskQueuePb.TaskQueueFetchQueueStatsRequestOrBuilder

TaskQueuePb.TaskQueueFetchQueueStatsResponse.QueueStatsOrBuilder

TaskQueuePb.TaskQueueFetchQueueStatsResponseOrBuilder

TaskQueuePb.TaskQueueFetchQueuesRequestOrBuilder

TaskQueuePb.TaskQueueFetchQueuesResponse.QueueOrBuilder

TaskQueuePb.TaskQueueFetchQueuesResponseOrBuilder

TaskQueuePb.TaskQueueFetchTaskRequestOrBuilder

TaskQueuePb.TaskQueueFetchTaskResponseOrBuilder

TaskQueuePb.TaskQueueForceRunRequestOrBuilder

TaskQueuePb.TaskQueueForceRunResponseOrBuilder

TaskQueuePb.TaskQueueHttpHeaderOrBuilder

TaskQueuePb.TaskQueueModeOrBuilder

TaskQueuePb.TaskQueueModifyTaskLeaseRequestOrBuilder

TaskQueuePb.TaskQueueModifyTaskLeaseResponseOrBuilder

TaskQueuePb.TaskQueuePauseQueueRequestOrBuilder

TaskQueuePb.TaskQueuePauseQueueResponseOrBuilder

TaskQueuePb.TaskQueuePurgeQueueRequestOrBuilder

TaskQueuePb.TaskQueuePurgeQueueResponseOrBuilder

TaskQueuePb.TaskQueueQueryAndOwnTasksRequestOrBuilder

TaskQueuePb.TaskQueueQueryAndOwnTasksResponse.TaskOrBuilder

TaskQueuePb.TaskQueueQueryAndOwnTasksResponseOrBuilder

TaskQueuePb.TaskQueueQueryTasksRequestOrBuilder

TaskQueuePb.TaskQueueQueryTasksResponse.Task.CronTimetableOrBuilder

TaskQueuePb.TaskQueueQueryTasksResponse.Task.HeaderOrBuilder

TaskQueuePb.TaskQueueQueryTasksResponse.Task.RunLogOrBuilder

TaskQueuePb.TaskQueueQueryTasksResponse.TaskOrBuilder

TaskQueuePb.TaskQueueQueryTasksResponseOrBuilder

TaskQueuePb.TaskQueueRetryParametersOrBuilder

TaskQueuePb.TaskQueueScannerQueueInfoOrBuilder

TaskQueuePb.TaskQueueServiceErrorOrBuilder

TaskQueuePb.TaskQueueUpdateQueueRequestOrBuilder

TaskQueuePb.TaskQueueUpdateQueueResponseOrBuilder

TaskQueuePb.TaskQueueUpdateStorageLimitRequestOrBuilder

TaskQueuePb.TaskQueueUpdateStorageLimitResponseOrBuilder

Enums

TaskOptions.Method

Methods supported by Queue. Tasks added to pull queues must have the #Method PULL. All other methods are appropriate for push queues. See Queue for more detail on pull and push mode queues.

TaskQueuePb.TaskQueueAddRequest.RequestMethod

TaskQueuePb.TaskQueueMode.Mode

TaskQueuePb.TaskQueueQueryTasksResponse.Task.RequestMethod

TaskQueuePb.TaskQueueServiceError.ErrorCode

Exceptions

DeferredTaskCreationException

Indicates a failure to create a task payload. This is most likely an issue with serialization.

InternalFailureException

Internal task queue error.

InvalidQueueModeException

Mismatch of task method and queue mode. e.g. Queue#leaseTasks(long, java.util.concurrent.TimeUnit, long) called on a push queue, Queue#add(TaskOptions) with method TaskOptions.Method PULL to a push queue, or with TaskOptions.Method not equal to PULL to a pull queue.

QueueFailureException

Unspecified queue failure.

QueueNameMismatchException

Queue name mismatch failure.

TaskAlreadyExistsException

One or more task names already exists in the queue.

TransactionalTaskException

Queue operation failure caused by Datastore exception

TransientFailureException

Intermittent failure.

The requested operation may succeed if attempted again.

UnsupportedTranslationException

Attempt to convert String to an unsupported charset.