# TaskHandle
Date: 2012-02-24

## 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 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.

See Also:
  Serialized Form

Constructor Summary
`TaskHandle(java.lang.String name, java.lang.String queueName, long etaMillis)` Deprecated. Use {@link TaskHandle#TaskHandle(TaskOptions, String)
`TaskHandle(TaskOptions options, java.lang.String queueName)`

Method Summary
`boolean` `equals(java.lang.Object obj)`
`java.util.List<java.util.Map.Entry<java.lang.String,java.lang.String>>` `extractParams()` Attempts to decode the `payload` byte array in our `options` into a list of Map.Entry<String, String>.
`long` `getEtaMillis()` Returns a time comparable to `System.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()`

Methods inherited from class java.lang.Object
`getClass, notify, notifyAll, wait, wait, wait`

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. Use {@link TaskHandle#TaskHandle(TaskOptions, String)

Method Detail

### hashCode

    public int hashCode()

  Overrides:
    `hashCode` in class `java.lang.Object`

### equals

    public boolean equals(java.lang.Object obj)

  Overrides:
    `equals` in class `java.lang.Object`

### toString

    public java.lang.String toString()

  Overrides:
    `toString` in class `java.lang.Object`

### getName

    public java.lang.String getName()

  Returns the name of this task. This may have been generated by a call to `Queue.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 to `System.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 return `null`.

### getPayload

    public byte[] getPayload()

  Returns binary payload data of this task. Can return `null`.

### getTag

    public java.lang.String getTag()
                            throws java.io.UnsupportedEncodingException

  Returns tag of this task. Can return `null`.

  Throws:
    `java.io.UnsupportedEncodingException`

### getTagAsBytes

    public byte[] getTagAsBytes()

  Returns tag of this task. Can return `null`.

### 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 the `payload` byte array in our `options` into a list of Map.Entry<String, String>.

  Throws:
    `java.io.UnsupportedEncodingException` - if the payload cannot be decoded as a `application/x-www-form-urlencoded` string.
    `java.lang.UnsupportedOperationException` - if the `options` has no payload or the payload bytes could not be interpreted as application/x-www-form-urlencoded key-value pairs.