public class AsyncTask extends ModelBase implements Comparable<AsyncTask>
Constructor and Description |
---|
AsyncTask() |
AsyncTask(AsyncTaskHandler handler) |
AsyncTask(AsyncTaskHandler handler,
String customKey,
long executeAt) |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(AsyncTask o)
Implements the comparable interface to see which task should be executed sooner.
|
static AsyncTaskController |
controller() |
AsyncTask |
enqueue() |
long |
getCompletedAt()
When the task successfully completed, in epoch milliseconds
|
long |
getCreatedAt()
When the task was created, in epoch milliseconds
|
String |
getCustomKey()
A user generated unique key for the task, used for updating the task or preventing duplicates.
|
<V> V |
getData(Class<? extends V> cls)
Parses getDataJson() and returns the resulting class.
|
String |
getDataJson()
The async handler instance will be serialized to this field during task creation.
|
String |
getErrorMessage()
The stack trace from the last failure.
|
long |
getExecuteAt()
When the task should execute, in epoch milliseconds.
|
long |
getFailedAt()
When the task last failed, in epoch milliseconds
|
String |
getHandlerName()
The name of the handler class.
|
String |
getLocalMode() |
long |
getLockedAt()
When the task was locked, in epoch milliseconds
|
String |
getLockUuid()
A unique lock key, generated by the async persister when locking a task.
|
long |
getOriginallyScheduledFor()
When the task was scheduled for originally, before any failures that made the
coordinator reschedule it for a retried execution.
|
String |
getSecret()
A secret key, generated by the async persister, that can be used for
looking up the task object.
|
int |
getTryCount()
How many times the task has been tried to execute, incremented every time the task fails.
|
long |
getUpdatedAt()
When the task was last updated, in epoch milliseconds
|
boolean |
isNeverRetry()
If true, the task should never be retried on failure.
|
AsyncTask |
setCompletedAt(long completedAt) |
AsyncTask |
setCreatedAt(long createdAt) |
AsyncTask |
setCustomKey(String customKey) |
void |
setData(Object o)
JSON Stringifys the object and sets this.dataJson
|
AsyncTask |
setDataJson(String data) |
AsyncTask |
setErrorMessage(String errorMessage) |
AsyncTask |
setExecuteAt(long executeAt) |
AsyncTask |
setFailedAt(long failedAt) |
AsyncTask |
setHandler(AsyncTaskHandler handler)
Will use the handler class name, for later reloading, and then convert the handler to JSON
and assign the data to the dataJson field of this task.
|
AsyncTask |
setHandlerName(String handlerName) |
AsyncTask |
setLocalMode(String localMode) |
AsyncTask |
setLockedAt(long lockedAt) |
AsyncTask |
setLockUuid(String lockUuid) |
AsyncTask |
setNeverRetry(boolean neverRetry) |
AsyncTask |
setOriginallyScheduledFor(long originallyScheduledFor) |
AsyncTask |
setSecret(String secret) |
AsyncTask |
setTryCount(int tryCount) |
AsyncTask |
setUpdatedAt(long updatedAt) |
equals, getBucket, getCompoundId, getController, getDeleted, getId, getIsNewInsert, getLastModifiedMillis, getMeta, hashCode, setBucket, setDeleted, setId, setIsNewInsert, setLastModifiedMillis
public AsyncTask()
public AsyncTask(AsyncTaskHandler handler)
public AsyncTask(AsyncTaskHandler handler, String customKey, long executeAt)
public static AsyncTaskController controller()
public long getCreatedAt()
public AsyncTask setCreatedAt(long createdAt)
public long getUpdatedAt()
public AsyncTask setUpdatedAt(long updatedAt)
public String getHandlerName()
public AsyncTask setHandler(AsyncTaskHandler handler)
handler
- public AsyncTask setHandlerName(String handlerName)
public String getCustomKey()
public AsyncTask setCustomKey(String customKey)
public long getLockedAt()
public AsyncTask setLockedAt(long lockedAt)
public long getFailedAt()
public AsyncTask setFailedAt(long failedAt)
public long getCompletedAt()
public AsyncTask setCompletedAt(long completedAt)
public long getOriginallyScheduledFor()
public AsyncTask setOriginallyScheduledFor(long originallyScheduledFor)
public long getExecuteAt()
public AsyncTask setExecuteAt(long executeAt)
public boolean isNeverRetry()
public AsyncTask setNeverRetry(boolean neverRetry)
public String getLockUuid()
public AsyncTask setLockUuid(String lockUuid)
public String getSecret()
public int getTryCount()
public AsyncTask setTryCount(int tryCount)
public String getErrorMessage()
public AsyncTask setErrorMessage(String errorMessage)
public String getDataJson()
public AsyncTask setDataJson(String data)
public <V> V getData(Class<? extends V> cls)
V
- cls
- public void setData(Object o)
o
- public int compareTo(AsyncTask o)
compareTo
in interface Comparable<AsyncTask>
o
- public String getLocalMode()
public AsyncTask setLocalMode(String localMode)
Copyright © 2016. All rights reserved.