Class TaskProgress
- java.lang.Object
-
- org.ametys.workspaces.repository.maintenance.TaskProgress
-
public class TaskProgress extends Object
TaskProgress
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTaskProgress.StateProgress state
-
Field Summary
Fields Modifier and Type Field Description private Exception_exceptionprivate float_progressprivate TaskProgress.State_stateprivate float_total
-
Constructor Summary
Constructors Constructor Description TaskProgress(float total)CtorTaskProgress(float total, float start)Overriden Ctor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ExceptiongetException()getExceptionMap<String,Object>getProgressInfo()Returns information this progress object.floatgetProgressPercentage()getProgressPercentageTaskProgress.StategetState()getStatebooleanisFinished()isFinishedbooleanisInErrorState()isInErrorStatebooleanisNotStarted()isNotStartedbooleanisRunning()isRunningvoidprogress()Unit progressvoidprogress(float quantity)Quantitative progressvoidprogressRelativePercentage(int percentage)Progress by a percentage relative to the range [current progress; total]voidprogressTotalPercentage(int percentage)Progress by a given percentagevoidsetFinished()setFinishedvoidsetInErrorState()setInErrorStatevoidsetInErrorState(Exception e)setInErrorStatevoidsetRunning()setRunningStringtoString()
-
-
-
Field Detail
-
_total
private final float _total
-
_progress
private float _progress
-
_state
private TaskProgress.State _state
-
_exception
private Exception _exception
-
-
Constructor Detail
-
TaskProgress
public TaskProgress(float total)
Ctor- Parameters:
total- The total progress
-
TaskProgress
public TaskProgress(float total, float start)
Overriden Ctor- Parameters:
total- The total progressstart- The progress start
-
-
Method Detail
-
progress
public void progress()
Unit progress
-
progress
public void progress(float quantity)
Quantitative progress- Parameters:
quantity- The quantity to progress
-
progressRelativePercentage
public void progressRelativePercentage(int percentage)
Progress by a percentage relative to the range [current progress; total]- Parameters:
percentage- must be in the [0; 100] range
-
progressTotalPercentage
public void progressTotalPercentage(int percentage)
Progress by a given percentage- Parameters:
percentage- must be in the [0; 100] range
-
getProgressPercentage
public float getProgressPercentage()
getProgressPercentage- Returns:
- int
-
setRunning
public void setRunning()
setRunning
-
setFinished
public void setFinished()
setFinished
-
setInErrorState
public void setInErrorState()
setInErrorState
-
setInErrorState
public void setInErrorState(Exception e)
setInErrorState- Parameters:
e- The exception responsible for the error state
-
isNotStarted
public boolean isNotStarted()
isNotStarted- Returns:
- boolean
-
isRunning
public boolean isRunning()
isRunning- Returns:
- boolean
-
isFinished
public boolean isFinished()
isFinished- Returns:
- boolean
-
isInErrorState
public boolean isInErrorState()
isInErrorState- Returns:
- boolean
-
getException
public Exception getException()
getException- Returns:
- Exception
-
getState
public TaskProgress.State getState()
getState- Returns:
- State
-
getProgressInfo
public Map<String,Object> getProgressInfo()
Returns information this progress object.- Returns:
- a map containing information on the progress status
-
-