com.google.appengine.api.taskqueue
Class TaskHandle
- java.lang.Object
-
- com.google.appengine.api.taskqueue.TaskHandle
-
- All Implemented Interfaces:
- java.io.Serializable
public final class TaskHandle extends java.lang.Object implements java.io.Serializable
Created fromQueue.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.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description TaskHandle(java.lang.String name, java.lang.String queueName, long etaMillis)
Deprecated.TaskHandle(TaskOptions options, java.lang.String queueName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description boolean
equals(java.lang.Object obj)
java.util.List<java.util.Map.Entry<java.lang.String,java.lang.String>>
extractParams()
Attempts to decode thepayload
byte array in ouroptions
into a list ofMap.Entry<String, String>
.long
getEtaMillis()
Returns a time comparable toSystem.currentTimeMillis()
when this task is scheduled for execution.java.lang.String
getName()
Returns the name of this task.byte[]
getPayload()
Returns binary payload data of this task.java.lang.String
getQueueName()
Returns the name of the queue that this task was submitted into.java.lang.Integer
getRetryCount()
Returns number of leases that had been performed on this task.java.lang.String
getTag()
Returns tag of this task.byte[]
getTagAsBytes()
Returns tag of this task.int
hashCode()
java.lang.String
toString()
-
-
-
Constructor Detail
-
TaskHandle
public TaskHandle(TaskOptions options, java.lang.String queueName)
-
TaskHandle
@Deprecated public TaskHandle(java.lang.String name, java.lang.String queueName, long etaMillis)
Deprecated. UseTaskHandle(TaskOptions, String)
-
-
Method Detail
-
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
-
getName
public java.lang.String getName()
Returns the name of this task. This may have been generated by a call toQueue.add()
if the name was not otherwise specified.
-
getQueueName
public java.lang.String getQueueName()
Returns the name of the queue that this task was submitted into.
-
getEtaMillis
public long getEtaMillis()
Returns a time comparable toSystem.currentTimeMillis()
when this task is scheduled for execution.
-
getRetryCount
public java.lang.Integer getRetryCount()
Returns number of leases that had been performed on this task. Can returnnull
.
-
getPayload
public byte[] getPayload()
Returns binary payload data of this task. Can returnnull
.
-
getTag
public java.lang.String getTag() throws java.io.UnsupportedEncodingException
Returns tag of this task. Can returnnull
.- Throws:
java.io.UnsupportedEncodingException
-
getTagAsBytes
public byte[] getTagAsBytes()
Returns tag of this task. Can returnnull
.
-
extractParams
public java.util.List<java.util.Map.Entry<java.lang.String,java.lang.String>> extractParams() throws java.io.UnsupportedEncodingException, java.lang.UnsupportedOperationException
Attempts to decode thepayload
byte array in ouroptions
into a list ofMap.Entry<String, String>
.- Throws:
java.io.UnsupportedEncodingException
- if the payload cannot be decoded as aapplication/x-www-form-urlencoded
string.java.lang.UnsupportedOperationException
- if theoptions
has no payload or the payload bytes could not be interpreted as application/x-www-form-urlencoded key-value pairs.
-
-