com.atlassian.scheduler.core.status
Class LazyJobDetails
java.lang.Object
com.atlassian.scheduler.core.status.AbstractJobDetails
com.atlassian.scheduler.core.status.LazyJobDetails
- All Implemented Interfaces:
- JobDetails
public class LazyJobDetails
- extends AbstractJobDetails
A job details implementation that waits until the first request to one of
the methods that needs to know the state of the parameters map before trying
to deserialize it. SchedulerService implementations are encouraged
to prefer this implementation when returning multiple JobDetails
objects, as the deserialization is unnecessary if the caller is not going to
use those values.
- Since:
- v1.0
LazyJobDetails
public LazyJobDetails(@Nonnull
JobId jobId,
@Nonnull
JobRunnerKey jobRunnerKey,
@Nonnull
RunMode runMode,
@Nonnull
Schedule schedule,
@Nullable
Date nextRunTime,
@Nonnull
JobRunner jobRunner,
@Nullable
byte[] parameters)
- Creates a lazy job details representation.
WARNING: For efficiency reasons, byte[] parameters is not copied.
- Parameters:
jobId - the job's IDjobRunnerKey - the job runner's keyrunMode - the running mode of the jobschedule - the job's schedulenextRunTime - the next run time for the job, if knownjobRunner - the resolved job runnerparameters - the parameters map in serialized form. For efficiency reasons, this constructor
uses the original array directly without making a safe copy.
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.