com.atlassian.scheduler.core.status
Class AbstractJobDetails

java.lang.Object
  extended by com.atlassian.scheduler.core.status.AbstractJobDetails
All Implemented Interfaces:
JobDetails
Direct Known Subclasses:
LazyJobDetails, SimpleJobDetails, UnusableJobDetails

public abstract class AbstractJobDetails
extends Object
implements JobDetails

Base implementation for JobDetails.

Since:
v1.0

Field Summary
protected  JobId jobId
           
protected  JobRunnerKey jobRunnerKey
           
protected  RunMode runMode
           
protected  Schedule schedule
           
 
Constructor Summary
protected AbstractJobDetails(JobId jobId, JobRunnerKey jobRunnerKey, RunMode runMode, Schedule schedule, Date nextRunTime, byte[] rawParameters)
           
 
Method Summary
protected abstract  void appendToStringDetails(StringBuilder sb)
           
 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.
 byte[] getRawParameters()
          Returns the raw bytes from the job's parameters.
 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.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.atlassian.scheduler.status.JobDetails
getParameters, isRunnable
 

Field Detail

jobId

protected final JobId jobId

jobRunnerKey

protected final JobRunnerKey jobRunnerKey

runMode

protected final RunMode runMode

schedule

protected final Schedule schedule
Constructor Detail

AbstractJobDetails

protected AbstractJobDetails(@Nonnull
                             JobId jobId,
                             @Nonnull
                             JobRunnerKey jobRunnerKey,
                             @Nonnull
                             RunMode runMode,
                             @Nonnull
                             Schedule schedule,
                             @Nullable
                             Date nextRunTime,
                             byte[] rawParameters)
Method Detail

getJobId

@Nonnull
public final JobId getJobId()
Description copied from interface: JobDetails
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.

Specified by:
getJobId in interface JobDetails
Returns:
the job ID

getJobRunnerKey

@Nonnull
public final JobRunnerKey getJobRunnerKey()
Description copied from interface: JobDetails
Returns the job runner key that was specified when this job was scheduled.

Specified by:
getJobRunnerKey in interface JobDetails
Returns:
the job runner key

getRunMode

@Nonnull
public final RunMode getRunMode()
Description copied from interface: JobDetails
Returns the configured run mode that was specified when this job was scheduled.

Specified by:
getRunMode in interface JobDetails
Returns:
the run mode

getSchedule

@Nonnull
public Schedule getSchedule()
Description copied from interface: JobDetails
Returns the schedule that the Job will run under.

Specified by:
getSchedule in interface JobDetails
Returns:
the schedule that the Job will run under.

getNextRunTime

@Nullable
public Date getNextRunTime()
Description copied from interface: JobDetails
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:

Specified by:
getNextRunTime in interface JobDetails
Returns:
the next time at which this job will run, if known; null otherwise.

getRawParameters

@Nullable
public final byte[] getRawParameters()
Returns the raw bytes from the job's parameters. This is not part of the public API; it is intended as a troubleshooting tool for a management interface to use. For example, it might try to deserialize the map with the application's class loader or read the raw serialization data to show the administrator whatever information can be pulled out of it.

Returns:
a copy of the raw bytes that encode the job's parameters, or null if the parameter map was empty.

toString

public final String toString()
Overrides:
toString in class Object

appendToStringDetails

protected abstract void appendToStringDetails(StringBuilder sb)


Copyright © 2014 Atlassian. All Rights Reserved.