T - The type that the scheduler implementation uses as its internal representation
of a job.public abstract class AbstractJobDetailsFactory<T> extends Object
JobDetails. This class produces LazyJobDetails instances when
the JobRunner is registered as opposed to deserializing the parameters
immediately.| Modifier | Constructor and Description |
|---|---|
protected |
AbstractJobDetailsFactory(AbstractSchedulerService schedulerService) |
| Modifier and Type | Method and Description |
|---|---|
JobDetails |
buildJobDetails(JobId jobId,
T jobData,
RunMode runMode)
Transforms the scheduler's internal representation of a job into a
JobDetails. |
protected abstract JobRunnerKey |
getJobRunnerKey(T jobData)
Provided by the scheduler implementation to extract the job's
JobRunnerKey from
the scheduler's internal representation of the job. |
protected abstract Date |
getNextRunTime(T jobData)
Provided by the scheduler implementation to extract the job's next scheduled run time from
the scheduler's internal representation of the job.
|
protected abstract Schedule |
getSchedule(T jobData)
Provided by the scheduler implementation to extract the job's
Schedule from
the scheduler's internal representation of the job. |
protected abstract byte[] |
getSerializedParameters(T jobData)
Provided by the scheduler implementation to extract the job's parameters map (in
serialized form) from the scheduler's internal representation of the job.
|
protected AbstractJobDetailsFactory(AbstractSchedulerService schedulerService)
public JobDetails buildJobDetails(JobId jobId, T jobData, RunMode runMode)
JobDetails.
This will attempt to reconstruct the job's parameters using the ClassLoader of the
job's JobRunner and return an UnusableJobDetails if the job runner
is not registered or its class loader cannot deserialize the parameters map.jobId - the job's IDjobData - the internal representation of the jobrunMode - the expected run mode of the job@Nonnull protected abstract JobRunnerKey getJobRunnerKey(T jobData)
JobRunnerKey from
the scheduler's internal representation of the job.jobData - the scheduler's internal representation of the job@Nonnull protected abstract Schedule getSchedule(T jobData)
Schedule from
the scheduler's internal representation of the job.jobData - the scheduler's internal representation of the jobSchedule@Nullable protected abstract Date getNextRunTime(T jobData)
jobData - the scheduler's internal representation of the jobnull if the job will not be run again or
if the scheduler does not provide information about future run times@Nullable protected abstract byte[] getSerializedParameters(T jobData)
jobData - the scheduler's internal representation of the jobnull,
in which case an empty map will be substitutedCopyright © 2017 Atlassian. All rights reserved.