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
ConstructorDescriptionJobTaskContext
(AbstractJob job, org.quartz.JobExecutionContext jobContext) Creates an instance of aJobTaskContext
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.Get an instance ofProgress
to update the current progress.Get an instance ofProgressLog
to update the current progress log.final int
hashCode()
Returns a hash code value for this object.boolean
boolean
Check if the progress is available.boolean
Check if the progress log is available.job()
Returns the value of thejob
record component.org.quartz.JobExecutionContext
Returns the value of thejobContext
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
JobTaskContext
Creates an instance of aJobTaskContext
record class.- Parameters:
job
- the value for thejob
record componentjobContext
- the value for thejobContext
record component
-
-
Method Details
-
isCancelled
public boolean isCancelled()- Specified by:
isCancelled
in interfaceTaskContext
-
getProgress
Description copied from interface:TaskContext
Get an instance ofProgress
to 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:
getProgress
in interfaceTaskContext
- Returns:
- an instance of
Progress
- See Also:
-
isProgressAvailable
public boolean isProgressAvailable()Description copied from interface:TaskContext
Check if the progress is available.- Specified by:
isProgressAvailable
in interfaceTaskContext
- Returns:
- true if the progress is available, false otherwise.
-
getProgressLog
Description copied from interface:TaskContext
Get an instance ofProgressLog
to 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:
getProgressLog
in interfaceTaskContext
- Returns:
- an instance of
ProgressLog
- See Also:
-
isProgressLogAvailable
public boolean isProgressLogAvailable()Description copied from interface:TaskContext
Check if the progress log is available.- Specified by:
isProgressLogAvailable
in 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 thejob
record component.- Returns:
- the value of the
job
record component
-
jobContext
public org.quartz.JobExecutionContext jobContext()Returns the value of thejobContext
record component.- Returns:
- the value of the
jobContext
record component
-