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 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 |
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 |
setResult(V result)
Store the result in the descriptor.
|
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()
TaskDescriptor
getResult
in interface TaskDescriptor<V extends Serializable>
public boolean isStarted()
TaskDescriptor
isStarted
in interface TaskDescriptor<V extends Serializable>
public boolean isFinished()
TaskDescriptor
isFinished
in interface TaskDescriptor<V extends Serializable>
public Long getTaskId()
TaskDescriptor
getTaskId
in interface TaskDescriptor<V extends Serializable>
public Date getStartedTimestamp()
TaskDescriptor
getStartedTimestamp
in interface TaskDescriptor<V extends Serializable>
null
will be returned if the task has not started executing.public Date getFinishedTimestamp()
TaskDescriptor
getFinishedTimestamp
in interface TaskDescriptor<V extends Serializable>
null
will be returned if the task has not finished
executing.public Date getSubmittedTimestamp()
TaskDescriptor
getSubmittedTimestamp
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()
TaskDescriptor
getElapsedRunTime
in interface TaskDescriptor<V extends Serializable>
public String getUserName()
TaskDescriptor
getUserName
in interface TaskDescriptor<V extends Serializable>
public String getDescription()
TaskDescriptor
getDescription
in interface TaskDescriptor<V extends Serializable>
public TaskContext getTaskContext()
TaskDescriptor
getTaskContext
in interface TaskDescriptor<V extends Serializable>
null
as a task must always
have a context.public String getProgressURL()
TaskDescriptor
TaskContext
.getProgressURL
in interface TaskDescriptor<V extends Serializable>
null
cannot be returned.public TaskProgressIndicator getTaskProgressIndicator()
TaskDescriptor
TaskProgressIndicator
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)
TaskDescriptor
setResult
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()
TaskDescriptor
isCancelled
in interface TaskDescriptor<V extends Serializable>
true
if cancellation has been requested,
and false
otherwisepublic void setCancelled(boolean cancelled)
TaskDescriptor
setCancelled
in interface TaskDescriptor<V extends Serializable>
cancelled
- Cancelled flagpublic boolean isCancellable()
TaskDescriptor
isCancellable
in interface TaskDescriptor<V extends Serializable>
true
if cancellation is supported,
and false
otherwisepublic void setCancelable(boolean isCancelable)
public String getNodeId()
TaskDescriptor
getNodeId
in interface TaskDescriptor<V extends Serializable>
@Nullable public SpanningOperation getSpanningOperation()
TaskDescriptor
getSpanningOperation
in interface TaskDescriptor<V extends Serializable>
public void setSpanningOperation(SpanningOperation spanningOperation)
Copyright © 2002-2019 Atlassian. All Rights Reserved.