Package com.epimorphics.tasks
Interface ProgressMonitor
-
- All Known Subinterfaces:
ProgressMonitorReporter
- All Known Implementing Classes:
LiveProgressMonitor,SimpleProgressMonitor
public interface ProgressMonitorInterface for accessing progress status from an async task such as a web service or shell script.- Author:
- Dave Reynolds
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description List<ProgressMessage>getMessages()Return all progress messages logged so far.List<ProgressMessage>getMessagesSince(int offset)Return all progress messages since the given message number.intgetProgress()Get the progress of the task as a percentage.TaskStategetState()Return the state of the task.booleanmoreMessagesSince(int offset)Return true if there are more progress messages available since the given message number.booleansucceeded()Return true if the task has Terminated and was successful.JSONWritableviewUpdatesSince(int offset)Return a JSON view onto the status of the monitor including any messages since the given offset.
-
-
-
Method Detail
-
getState
TaskState getState()
Return the state of the task. It may be Waiting to start, Running or Terminated.
-
getProgress
int getProgress()
Get the progress of the task as a percentage. Not all monitors will offer fine grained progress but the progress will always be 0 for Waiting tasks, >= 1 for running tasks and 100 for Terminated tasks (even for unsuccessful termination).
-
succeeded
boolean succeeded()
Return true if the task has Terminated and was successful.
-
getMessages
List<ProgressMessage> getMessages()
Return all progress messages logged so far.
-
getMessagesSince
List<ProgressMessage> getMessagesSince(int offset)
Return all progress messages since the given message number.
-
moreMessagesSince
boolean moreMessagesSince(int offset)
Return true if there are more progress messages available since the given message number.
-
viewUpdatesSince
JSONWritable viewUpdatesSince(int offset)
Return a JSON view onto the status of the monitor including any messages since the given offset.
-
-