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
NameDescription
optionsTaskOptions
queueNameString

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

public TaskHandle(String name, String queueName, long etaMillis)
Parameters
NameDescription
nameString
queueNameString
etaMillislong

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
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
TypeDescription
List<Entry<String,String>>
Exceptions
TypeDescription
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
TypeDescription
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
TypeDescription
String

getPayload()

public byte[] getPayload()

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

Returns
TypeDescription
byte[]

getQueueName()

public String getQueueName()

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

Returns
TypeDescription
String

getRetryCount()

public Integer getRetryCount()

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

Returns
TypeDescription
Integer

getTag()

public String getTag()

Returns tag of this task. Can return null.

Returns
TypeDescription
String
Exceptions
TypeDescription
UnsupportedEncodingException

getTagAsBytes()

public byte[] getTagAsBytes()

Returns tag of this task. Can return null.

Returns
TypeDescription
byte[]

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

toString()

public String toString()
Returns
TypeDescription
String
Overrides