Interface JobEntry
-
- All Superinterfaces:
Comparable<JobEntry>
- All Known Implementing Classes:
AbstractJobEntry,BaseJobEntryTorque,JobEntryNonPersistent,JobEntryQuartz,JobEntryTorque
public interface JobEntry extends Comparable<JobEntry>
This is a interface for a scheduled job. It does not specify how to configure when to run, that is left to subclasses. See the JobEntryTorque for an example of a JobEntry backed by Torque objects.- Version:
- $Id$
- Author:
- Eric Pugh, Dave Bryson, Quinton McCombs
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcalcRunTime()Calculate how long before the next runtime.intgetJobId()Get the value of jobId.StringgetNextRunAsString()Get the next runtime for this job as a String.DategetNextRunDate()Gets the next runtime as a datelonggetNextRuntime()Get the next runtime for this job as a long.StringgetTask()Get the TaskbooleanisActive()Check to see if job is currently active/runningbooleanisNew()Check to see if job is newvoidsetActive(boolean isActive)Sets whether the job is running.voidsetJobId(int v)Set the value of jobId.voidsetTask(String v)Set the value of Task-
Methods inherited from interface java.lang.Comparable
compareTo
-
-
-
-
Method Detail
-
setActive
void setActive(boolean isActive)
Sets whether the job is running.- Parameters:
isActive- Whether the job is running.
-
isActive
boolean isActive()
Check to see if job is currently active/running- Returns:
- true if job is currently being run by the worker thread, otherwise false
-
isNew
boolean isNew()
Check to see if job is new- Returns:
- true if job is not yet saved, otherwise false
-
getJobId
int getJobId()
Get the value of jobId.- Returns:
- int
-
setJobId
void setJobId(int v)
Set the value of jobId.- Parameters:
v- new value
-
getNextRuntime
long getNextRuntime()
Get the next runtime for this job as a long.- Returns:
- The next run time as a long.
-
getNextRunDate
Date getNextRunDate()
Gets the next runtime as a date- Returns:
- Next run date
-
getNextRunAsString
String getNextRunAsString()
Get the next runtime for this job as a String.- Returns:
- The next run time as a String.
-
calcRunTime
void calcRunTime() throws TurbineException
Calculate how long before the next runtime.
The runtime determines it's position in the job queue. Here's the logic:
1. Create a date the represents when this job is to run.
2. If this date has expired, them "roll" appropriate date fields forward to the next date.
3. Calculate the diff in time between the current time and the next run time.- Throws:
TurbineException- a generic exception.
-
-