Package ch.tocco.nice2.rest.action.spi
Record Class JobTaskContext
java.lang.Object
java.lang.Record
ch.tocco.nice2.rest.action.spi.JobTaskContext
- All Implemented Interfaces:
TaskContext
public record JobTaskContext(AbstractJob job, org.quartz.JobExecutionContext jobContext)
extends Record
implements TaskContext
-
Constructor Summary
ConstructorsConstructorDescriptionJobTaskContext(AbstractJob job, org.quartz.JobExecutionContext jobContext) Creates an instance of aJobTaskContextrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.Get an instance ofProgressto update the current progress.Get an instance ofProgressLogto update the current progress log.final inthashCode()Returns a hash code value for this object.booleanbooleanCheck if the progress is available.booleanCheck if the progress log is available.job()Returns the value of thejobrecord component.org.quartz.JobExecutionContextReturns the value of thejobContextrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
JobTaskContext
Creates an instance of aJobTaskContextrecord class.- Parameters:
job- the value for thejobrecord componentjobContext- the value for thejobContextrecord component
-
-
Method Details
-
isCancelled
public boolean isCancelled()- Specified by:
isCancelledin interfaceTaskContext
-
getProgress
Description copied from interface:TaskContextGet an instance ofProgressto update the current progress.Note: will throw an IllegalStateException if the progress is not available. This might be the case if the task is not trackable or if no RemoteContext is available.
Check if the progress is available by calling
TaskContext.isProgressAvailable()if you're not sure.- Specified by:
getProgressin interfaceTaskContext- Returns:
- an instance of
Progress - See Also:
-
isProgressAvailable
public boolean isProgressAvailable()Description copied from interface:TaskContextCheck if the progress is available.- Specified by:
isProgressAvailablein interfaceTaskContext- Returns:
- true if the progress is available, false otherwise.
-
getProgressLog
Description copied from interface:TaskContextGet an instance ofProgressLogto update the current progress log.Note: will throw an IllegalStateException if the progress log is not available. This might be the case if the task is not trackable.
Check if the progress log is available by calling
TaskContext.isProgressLogAvailable()if you're not sure.- Specified by:
getProgressLogin interfaceTaskContext- Returns:
- an instance of
ProgressLog - See Also:
-
isProgressLogAvailable
public boolean isProgressLogAvailable()Description copied from interface:TaskContextCheck if the progress log is available.- Specified by:
isProgressLogAvailablein interfaceTaskContext- Returns:
- true if the progress log is available, false otherwise.
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
job
Returns the value of thejobrecord component.- Returns:
- the value of the
jobrecord component
-
jobContext
public org.quartz.JobExecutionContext jobContext()Returns the value of thejobContextrecord component.- Returns:
- the value of the
jobContextrecord component
-