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 |
getNodeId()
Returns node id from where task was submitted
|
String |
getProgressURL()
Returns the URL that displays progress on this task.
|
V |
getResult()
This returns the result of the long running task.
|
SpanningOperation |
getSpanningOperation()
Return operation that this task is part of.
|
Date |
getStartedTimestamp()
Return the date when the task was started.
|
Date |
getSubmittedTimestamp()
Return the date when the task was submitted.
|
TaskContext |
getTaskContext()
Return the context of task.
|
Long |
getTaskId()
Return 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 |
isSelfRecovering()
Returns whether the task will be automatically picked up again by the cluster if the node
that was executing it crashes.
|
boolean |
isStarted()
True if the task has been started.
|
void |
setCancelable(boolean isCancelable) |
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 |
setNodeId(String nodeId) |
void |
setResult(V result)
Store the result in the descriptor.
|
void |
setSelfRecovering(boolean selfRecovering) |
void |
setSpanningOperation(SpanningOperation spanningOperation) |
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 indicator 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 isSelfRecovering()
TaskDescriptorUsed by Jira to determine which tasks it should clean up after detecting such crashed node.
isSelfRecovering in interface TaskDescriptor<V extends Serializable>SelfRecoveringpublic void setSelfRecovering(boolean selfRecovering)
public boolean isCancellable()
TaskDescriptorisCancellable in interface TaskDescriptor<V extends Serializable>true if cancellation is supported,
and false otherwisepublic void setCancelable(boolean isCancelable)
public String getNodeId()
TaskDescriptorgetNodeId in interface TaskDescriptor<V extends Serializable>public void setNodeId(String nodeId)
@Nullable public SpanningOperation getSpanningOperation()
TaskDescriptorgetSpanningOperation in interface TaskDescriptor<V extends Serializable>public void setSpanningOperation(SpanningOperation spanningOperation)
Copyright © 2002-2022 Atlassian. All Rights Reserved.