Package com.epimorphics.tasks
Interface ProgressReporter
-
- All Known Subinterfaces:
ProgressMonitorReporter
- All Known Implementing Classes:
LiveProgressMonitor,SimpleProgressMonitor
public interface ProgressReporterInterface through which an async task can report progress.- Author:
- Dave Reynolds
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StringgetId()Return an ID string for this monitor/reporter.TaskStategetState()Return the state of the task.voidreport(String message)Log a progress message, this may be timestamped by the reporter implementation.voidreport(String message, int lineNumber)Log a progress message with an associated line number, this may be timestamped by the reporter implementation.voidreport(String message, int lineNumber, String type)Log a progress message with an associated line number, this may be timestamped by the reporter implementation.voidreport(String message, String type)Log a progress message, this may be timestamped by the reporter implementation.voidreportError(String message)Report an error as a progress message of type "error" and set the status to failedvoidreportError(String message, int lineNumber)Report an error as a progress message of type "error" and set the status to failedvoidsetFailed()Record that a task has completed but with an error.voidsetProgress(int progress)Set the progress percentage.voidsetState(TaskState state)Change the state of the progress report.voidsetSucceeded()Record that a task has completed but successfullyvoidsetSuccess(boolean wasSuccessful)Record whether the task was successful or not.
-
-
-
Method Detail
-
getId
String getId()
Return an ID string for this monitor/reporter. Useful when managing a pool of persistent status reports.
-
setState
void setState(TaskState state)
Change the state of the progress report.
-
setProgress
void setProgress(int progress)
Set the progress percentage.
-
setSuccess
void setSuccess(boolean wasSuccessful)
Record whether the task was successful or not.
-
setSucceeded
void setSucceeded()
Record that a task has completed but successfully
-
setFailed
void setFailed()
Record that a task has completed but with an error.
-
report
void report(String message, String type)
Log a progress message, this may be timestamped by the reporter implementation.- Parameters:
message- the message texttype- the nature of the message e.g. "error", application dependent what types are supported
-
report
void report(String message, int lineNumber, String type)
Log a progress message with an associated line number, this may be timestamped by the reporter implementation.- Parameters:
message- the message texttype- the nature of the message e.g. "error", application dependent what types are supportedlineNumber- the number in some input file corresponding the the message
-
report
void report(String message)
Log a progress message, this may be timestamped by the reporter implementation.
-
reportError
void reportError(String message)
Report an error as a progress message of type "error" and set the status to failed
-
reportError
void reportError(String message, int lineNumber)
Report an error as a progress message of type "error" and set the status to failed
-
report
void report(String message, int lineNumber)
Log a progress message with an associated line number, this may be timestamped by the reporter implementation.- Parameters:
message- the message textlineNumber- the number in some input file corresponding the the message
-
getState
TaskState getState()
Return the state of the task. It may be Waiting to start, Running or Terminated.
-
-