Interface BackgroundJobInfo
-
- All Known Subinterfaces:
BackgroundJobStatus<T>
- All Known Implementing Classes:
BackgroundJobStatusDecorator
public interface BackgroundJobInfoInformation about a scheduledBackgroundJob.
This interface provides runtime information on a scheduled Job.- Author:
- lukas
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classBackgroundJobInfo.State
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.StringgetDescription()The human-readable description for this job.java.lang.StringgetId()The unique identifier assigned to this job by the scheduler.java.lang.Class<?>getJobClass()The class implementing the actual work.longgetLastModified()longgetStartTime()BackgroundJobInfo.StategetState()intgetWorkDone()Get the amount of work that is already done.intgetWorkTotal()Get the total amount of work.booleanisVisible()
-
-
-
Method Detail
-
getState
BackgroundJobInfo.State getState()
- Returns:
- the current
BackgroundJobInfo.Stateof the job.
-
getWorkDone
int getWorkDone()
Get the amount of work that is already done. Returns the number of "units of work" that have been completed by the job so far. UsegetWorkTotal()to put this into relation.- Returns:
- number of completed "units of work"
-
getWorkTotal
int getWorkTotal()
Get the total amount of work.
Returns the total number of "units of work" comprising this job, including the part that is already done.BackgroundJob-implementations will typically provide a value in an early stage of processing. They are however not obliged to do so, so the expected total amount may not be known yet. In particular,BackgroundJobare allowed to to update this value if new information about the total amount of work to be done becomes available.- Returns:
- the expected total amount of work in "units of work".
-
getId
java.lang.String getId()
The unique identifier assigned to this job by the scheduler.- Returns:
- the id.
-
getDescription
java.lang.String getDescription()
The human-readable description for this job.- Returns:
- the description.
-
getJobClass
java.lang.Class<?> getJobClass()
The class implementing the actual work. This will typically be an Implementation ofBackgroundJob, but Schedulers may choose a different approach.- Returns:
- the implementation of the job.
-
getLastModified
long getLastModified()
- Returns:
- the last time at which progress info or state where updated. (Milliseconds since epoch.)
-
getStartTime
long getStartTime()
-
isVisible
boolean isVisible()
- Returns:
- a
booleanindicating whether this job should be visible to the end user. - Since:
- 1.21
- See Also:
BackgroundJob.isVisible()
-
-