Class TaskHandle (2.0.0)

public final class TaskHandle implements 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.

Inheritance

Object > TaskHandle

Implements

Serializable

Constructors

TaskHandle(TaskOptions options, String queueName)

public TaskHandle(TaskOptions options, String queueName)
Parameters
Name Description
options TaskOptions
queueName String

TaskHandle(String name, String queueName, long etaMillis) (deprecated)

public TaskHandle(String name, String queueName, long etaMillis)
Parameters
Name Description
name String
queueName String
etaMillis long

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

extractParams()

public List<Map.Entry<String,String>> extractParams()

Attempts to decode the payload byte array in our options into a list of Map.Entry<String, String>.

Returns
Type Description
List<Entry<String,String>>
Exceptions
Type Description
UnsupportedEncodingException

if the payload cannot be decoded as a application/x-www-form-urlencoded string.

UnsupportedOperationException

if the payload cannot be decoded as a application/x-www-form-urlencoded string.

getEtaMillis()

public long getEtaMillis()

Returns a time comparable to System#currentTimeMillis() when this task is scheduled for execution.

Returns
Type Description
long

getName()

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

Returns
Type Description
String

getPayload()

public byte[] getPayload()

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

Returns
Type Description
byte[]

getQueueName()

public String getQueueName()

Returns the name of the queue that this task was submitted into.

Returns
Type Description
String

getRetryCount()

public Integer getRetryCount()

Returns number of leases that had been performed on this task. Can return null.

Returns
Type Description
Integer

getTag()

public String getTag()

Returns tag of this task. Can return null.

Returns
Type Description
String
Exceptions
Type Description
UnsupportedEncodingException

getTagAsBytes()

public byte[] getTagAsBytes()

Returns tag of this task. Can return null.

Returns
Type Description
byte[]

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

toString()

public String toString()
Returns
Type Description
String
Overrides