public class MockTaskDescriptor<V extends Serializable> extends Object implements TaskDescriptor<V>
| Constructor and Description |
|---|
MockTaskDescriptor() |
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
String |
getDescription()
Return the description of the task passed when it was created.
|
long |
getElapsedRunTime()
This returns number of milliseconds the task has been running for.
|
Date |
getFinishedTimestamp()
Return the date when the task was finished.
|
String |
getProgressURL()
Returns the URL that displays progress on this task.
|
V |
getResult()
This returns the result of the long running task.
|
Date |
getStartedTimestamp()
Return the date when the task was started.
|
Date |
getSubmittedTimestamp()
Return the date when the task was submitted.
|
TaskContext |
getTaskContext()
Return he context of task.
|
Long |
getTaskId()
Reuturn the identifier for this task.
|
TaskProgressIndicator |
getTaskProgressIndicator()
Return the
TaskProgressIndicator associated with the task. |
String |
getUserName()
Return the user that started to task.
|
boolean |
isCancellable()
Returns whether this supports requests to cancel it.
|
boolean |
isCancelled()
Returns whether cancellation of task has been requested.
|
boolean |
isFinished()
Tells if caller if the task has finished running or not.
|
boolean |
isStarted()
True if the task has been started.
|
void |
setCancelled(boolean cancelled)
Set flag to indicate this task has been cancelled;
|
void |
setDescription(String description) |
void |
setElapsedRunTime(long elapsedRunTime) |
void |
setFinishedTime(Date finishedTime) |
void |
setResult(V result)
Store the result in the descriptor.
|
void |
setStartedTime(Date startedTime) |
void |
setSubmittedTime(Date submittedTime) |
void |
setTaskContext(TaskContext taskContext) |
void |
setTaskId(Long taskId) |
void |
setTaskProgressIndicator(TaskProgressIndicator taskProgressIndicator) |
void |
setUserName(String userName) |
public void clear()
public V getResult()
TaskDescriptorgetResult in interface TaskDescriptor<V extends Serializable>public boolean isStarted()
TaskDescriptorisStarted in interface TaskDescriptor<V extends Serializable>public boolean isFinished()
TaskDescriptorisFinished in interface TaskDescriptor<V extends Serializable>public Long getTaskId()
TaskDescriptorgetTaskId in interface TaskDescriptor<V extends Serializable>public Date getStartedTimestamp()
TaskDescriptorgetStartedTimestamp in interface TaskDescriptor<V extends Serializable>null will be returned if the task has not started executing.public Date getFinishedTimestamp()
TaskDescriptorgetFinishedTimestamp in interface TaskDescriptor<V extends Serializable>null will be returned if the task has not finished
executing.public Date getSubmittedTimestamp()
TaskDescriptorgetSubmittedTimestamp in interface TaskDescriptor<V extends Serializable>TaskManager. A null
value will never be returned as the task will always have a submission time.public long getElapsedRunTime()
TaskDescriptorgetElapsedRunTime in interface TaskDescriptor<V extends Serializable>public String getUserName()
TaskDescriptorgetUserName in interface TaskDescriptor<V extends Serializable>public String getDescription()
TaskDescriptorgetDescription in interface TaskDescriptor<V extends Serializable>public TaskContext getTaskContext()
TaskDescriptorgetTaskContext in interface TaskDescriptor<V extends Serializable>null as a task must always
have a context.public String getProgressURL()
TaskDescriptorTaskContext.getProgressURL in interface TaskDescriptor<V extends Serializable>null cannot be returned.public TaskProgressIndicator getTaskProgressIndicator()
TaskDescriptorTaskProgressIndicator associated with the task. A task will only have an indictator if its
callable implements the ProvidesTaskProgress interface.getTaskProgressIndicator in interface TaskDescriptor<V extends Serializable>TaskProgressIndicator associated with the task or null if there isn't one.public void setResult(V result)
TaskDescriptorsetResult in interface TaskDescriptor<V extends Serializable>result - The Resultpublic void setSubmittedTime(Date submittedTime)
public void setStartedTime(Date startedTime)
public void setFinishedTime(Date finishedTime)
public void setTaskProgressIndicator(TaskProgressIndicator taskProgressIndicator)
public void setDescription(String description)
public void setTaskId(Long taskId)
public void setElapsedRunTime(long elapsedRunTime)
public void setTaskContext(TaskContext taskContext)
public void setUserName(String userName)
public boolean isCancelled()
TaskDescriptorisCancelled in interface TaskDescriptor<V extends Serializable>true if cancellation has been requested,
and false otherwisepublic void setCancelled(boolean cancelled)
TaskDescriptorsetCancelled in interface TaskDescriptor<V extends Serializable>cancelled - Cancelled flagpublic boolean isCancellable()
TaskDescriptorisCancellable in interface TaskDescriptor<V extends Serializable>true if cancellation is supported,
and false otherwiseCopyright © 2002-2015 Atlassian. All Rights Reserved.