Interface BackgroundJobInfo
- All Known Subinterfaces:
BackgroundJobStatus<T>
- All Known Implementing Classes:
BackgroundJobStatusDecorator
public interface BackgroundJobInfo
Information about a scheduled
This interface provides runtime information on a scheduled Job.
BackgroundJob. This interface provides runtime information on a scheduled Job.
- Author:
- lukas
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionThe human-readable description for this job.getId()The unique identifier assigned to this job by the scheduler.Class<?>The class implementing the actual work.longlonggetState()intGet the amount of work that is already done.intGet the total amount of work.boolean
-
Method Details
-
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
String getId()The unique identifier assigned to this job by the scheduler.- Returns:
- the id.
-
getDescription
String getDescription()The human-readable description for this job.- Returns:
- the description.
-
getJobClass
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:
-