Package ch.tocco.nice2.rest.action.spi
Interface TaskContext
- All Known Implementing Classes:
JobTaskContext
public interface TaskContext
-
Method Summary
Modifier and TypeMethodDescriptionGet an instance ofProgress
to update the current progress.Get an instance ofProgressLog
to update the current progress log.boolean
boolean
Check if the progress is available.boolean
Check if the progress log is available.
-
Method Details
-
isCancelled
boolean isCancelled() -
getProgress
Progress getProgress()Get an instance ofProgress
to update the current progress.Note: will throw an IllegalStateException if the progress is not available. This might be the case if the task is not trackable or if no RemoteContext is available.
Check if the progress is available by calling
isProgressAvailable()
if you're not sure.- Returns:
- an instance of
Progress
- See Also:
-
isProgressAvailable
boolean isProgressAvailable()Check if the progress is available.- Returns:
- true if the progress is available, false otherwise.
-
getProgressLog
ProgressLog getProgressLog()Get an instance ofProgressLog
to update the current progress log.Note: will throw an IllegalStateException if the progress log is not available. This might be the case if the task is not trackable.
Check if the progress log is available by calling
isProgressLogAvailable()
if you're not sure.- Returns:
- an instance of
ProgressLog
- See Also:
-
isProgressLogAvailable
boolean isProgressLogAvailable()Check if the progress log is available.- Returns:
- true if the progress log is available, false otherwise.
-