com.atlassian.scheduler.status
Interface JobDetails

All Known Implementing Classes:
AbstractJobDetails, LazyJobDetails, SimpleJobDetails, UnusableJobDetails

@Immutable
@PublicApi
public interface JobDetails

All the static details for a given scheduled job. This is similar to a JobConfig, but also includes information about the job's current state, such as whether it is currently runnable.

See Also:
JobConfig, RunDetails

Method Summary
 JobId getJobId()
          Returns the job ID that was used to schedule this job, or the one that was generated for it if the job was scheduled without specifying one.
 JobRunnerKey getJobRunnerKey()
          Returns the job runner key that was specified when this job was scheduled.
 Date getNextRunTime()
          Returns the next time at which this job will run, if known.
 Map<String,Serializable> getParameters()
          Returns the configured runtime parameters for this job.
 RunMode getRunMode()
          Returns the configured run mode that was specified when this job was scheduled.
 Schedule getSchedule()
          Returns the schedule that the Job will run under.
 boolean isRunnable()
          Returns true if this job could be successfully run at this time.
 

Method Detail

getJobId

@Nonnull
JobId getJobId()
Returns the job ID that was used to schedule this job, or the one that was generated for it if the job was scheduled without specifying one.

Returns:
the job ID

getJobRunnerKey

@Nonnull
JobRunnerKey getJobRunnerKey()
Returns the job runner key that was specified when this job was scheduled.

Returns:
the job runner key

getRunMode

@Nonnull
RunMode getRunMode()
Returns the configured run mode that was specified when this job was scheduled.

Returns:
the run mode

getSchedule

@Nonnull
Schedule getSchedule()
Returns the schedule that the Job will run under.

Returns:
the schedule that the Job will run under.

getNextRunTime

@CheckForNull
Date getNextRunTime()
Returns the next time at which this job will run, if known.

OPTIONAL — Scheduler implementations are not required to provide this information. The return value will be null if:

Returns:
the next time at which this job will run, if known; null otherwise.

getParameters

@Nonnull
Map<String,Serializable> getParameters()
Returns the configured runtime parameters for this job.

WARNING: If this job was created by a plugin that is not currently active, then it may not actually be possible to access the job's parameters, and this method will throw a SchedulerRuntimeException. Callers are encouraged to first call the isRunnable() method, as a false return value from that method usually guarantees that this method will fail.

Returns:
the configured runtime parameters for this job.
Throws:
SchedulerRuntimeException - if the parameters could not be loaded, likely because the job runner is not registered

isRunnable

boolean isRunnable()
Returns true if this job could be successfully run at this time. This requires it to have a registered JobRunner whose class loader can successfully reconstruct the job's parameter map.

Returns:
true if this job is currently runnable; false otherwise


Copyright © 2014 Atlassian. All Rights Reserved.