Class TaskProgress
java.lang.Object
org.dlese.dpc.schemedit.threadedservices.TaskProgress
Class to report progress of a
MonitoredTask via a json object.The monitoredTask updates the TaskProgress object as it runs, and the TaskProgress can also query the Task for other properties, such as whether the task is actually running.
- Author:
- ostwald
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetDone()Gets the done attribute of the TaskProgress objectbooleangetError()Gets the error attribute of the TaskProgress objectgetMsg()Gets the msg attribute of the TaskProgress objectfloatPercentage of task completedReports the current progress as a JSON stringintgetTotal()Gets the total attribute of the TaskProgress objectvoidinit(int total) Initialize with total items to be processedvoidInitialize with total items to be processed and a message that is part of progress reportsbooleanisActive()Reports whether this TaskProgress' task is processing.voidreset()NOT YET DOCUMENTEDvoidsetDone(int done) Sets the done attribute of the TaskProgress objectvoidsetError(boolean error) Sets the error attribute of the TaskProgress objectvoidSets the msg attribute of the TaskProgress objectvoidsetTotal(int total) Sets the total attribute of the TaskProgress object
-
Field Details
-
debug
protected static boolean debug
-
-
Constructor Details
-
TaskProgress
Constructor for the TaskProgress object- Parameters:
task- the task for which we report progress
-
-
Method Details
-
init
public void init(int total) Initialize with total items to be processed- Parameters:
total- number of items to be processed
-
init
Initialize with total items to be processed and a message that is part of progress reports- Parameters:
total- number of items to be processedmsg- message used in reporting
-
isActive
public boolean isActive()Reports whether this TaskProgress' task is processing.- Returns:
- The active value
-
getMsg
Gets the msg attribute of the TaskProgress object- Returns:
- The msg value
-
setMsg
Sets the msg attribute of the TaskProgress object- Parameters:
msg- The new msg value
-
getDone
public int getDone()Gets the done attribute of the TaskProgress object- Returns:
- The done value
-
setDone
public void setDone(int done) Sets the done attribute of the TaskProgress object- Parameters:
done- The new done value
-
getTotal
public int getTotal()Gets the total attribute of the TaskProgress object- Returns:
- The total value
-
setTotal
public void setTotal(int total) Sets the total attribute of the TaskProgress object- Parameters:
total- The new total value
-
getError
public boolean getError()Gets the error attribute of the TaskProgress object- Returns:
- The error value
-
setError
public void setError(boolean error) Sets the error attribute of the TaskProgress object- Parameters:
error- The new error value
-
getPercentComplete
public float getPercentComplete()Percentage of task completedCan be calculated by client!?
- Returns:
- NOT YET DOCUMENTED
-
getProgressReport
Reports the current progress as a JSON string- Returns:
- The progressReport value
-
reset
public void reset()NOT YET DOCUMENTED
-