com.atlassian.scheduler
Interface JobRunnerRequest


@PublicApi
public interface JobRunnerRequest

Represents a request to run a job, providing information such as the job's configuration and intended start time.

Since:
v1.0

Method Summary
 JobConfig getJobConfig()
          Returns the job's configuration, such as its schedule and parameters.
 JobId getJobId()
          Returns the job ID that was used to schedule this job.
 Date getStartTime()
          Returns the time at which the job was started.
 boolean isCancellationRequested()
          Returns true if the job runner should terminate its activities as gracefully as possible and exit; false to continue running normally.
 

Method Detail

getStartTime

@Nonnull
Date getStartTime()
Returns the time at which the job was started. When this job completes, the RunDetails that stores the result will use this exact time for RunDetails.getStartTime().

Returns:
the time at which the job was started.

getJobId

@Nonnull
JobId getJobId()
Returns the job ID that was used to schedule this job.

Returns:
the job ID that was used to schedule this job.

getJobConfig

@Nonnull
JobConfig getJobConfig()
Returns the job's configuration, such as its schedule and parameters.

Returns:
the job's configuration

isCancellationRequested

boolean isCancellationRequested()
Returns true if the job runner should terminate its activities as gracefully as possible and exit; false to continue running normally.

Job cancellation is entirely cooperative. If a job is likely to take longer than a few seconds to complete its work, then it should periodically check this value and react to it. Normally, cancellation is requested because the application is trying to shut down, and continuing to run after this flag has been set increases the chance that the system administrator will grow impatient and forcibly kill the application.

Returns:
true if cancellation is requested; false otherwise


Copyright © 2015 Atlassian. All rights reserved.