com.atlassian.scheduler.core.status
Class SimpleJobDetails

java.lang.Object
  extended by com.atlassian.scheduler.core.status.AbstractJobDetails
      extended by com.atlassian.scheduler.core.status.SimpleJobDetails
All Implemented Interfaces:
JobDetails

public final class SimpleJobDetails
extends AbstractJobDetails

A simple, concrete implementation of JobDetails that has the parameter map present.

Since:
v1.0

Field Summary
 
Fields inherited from class com.atlassian.scheduler.core.status.AbstractJobDetails
jobId, jobRunnerKey, runMode, schedule
 
Constructor Summary
SimpleJobDetails(JobId jobId, JobRunnerKey jobRunnerKey, RunMode runMode, Schedule schedule, Date nextRunTime, byte[] rawParameters, Map<String,Serializable> parameters)
           
 
Method Summary
protected  void appendToStringDetails(StringBuilder sb)
           
 Map<String,Serializable> getParameters()
          Returns the configured runtime parameters for this job.
 boolean isRunnable()
          Returns true if this job could be successfully run at this time.
 
Methods inherited from class com.atlassian.scheduler.core.status.AbstractJobDetails
getJobId, getJobRunnerKey, getNextRunTime, getRawParameters, getRunMode, getSchedule, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SimpleJobDetails

public SimpleJobDetails(JobId jobId,
                        JobRunnerKey jobRunnerKey,
                        RunMode runMode,
                        Schedule schedule,
                        Date nextRunTime,
                        byte[] rawParameters,
                        Map<String,Serializable> parameters)
Method Detail

getParameters

@Nonnull
public Map<String,Serializable> getParameters()
Description copied from interface: JobDetails
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 JobDetails.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.

isRunnable

public boolean isRunnable()
Description copied from interface: JobDetails
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

appendToStringDetails

protected void appendToStringDetails(StringBuilder sb)
Specified by:
appendToStringDetails in class AbstractJobDetails


Copyright © 2014 Atlassian. All Rights Reserved.