|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.turbine.om.BaseObject | +--org.apache.turbine.services.schedule.JobEntry
This is a wrapper for a scheduled job. It is modeled after the Unix scheduler cron.
Field Summary | |
private static int |
DAILY
|
private int |
day_of_month
Valid entry ( 1-31 ). |
private static int |
DAY_OF_MONTH
|
private java.lang.String |
email
E-mail address to send notification of job run. |
private int |
hour
Valid entry ( 0-23 ). |
private boolean |
jobIsActive
indicates if job is currently running |
private java.util.Hashtable |
jobProp
Storage for additional properties |
private int |
minute
Valid entry ( 0-59 ). |
private static int |
MINUTE
|
private long |
runtime
Next runtime. |
private int |
second
Valid entry ( 0-60 ). |
private static int |
SECOND
schedule types |
private java.lang.String |
task
The Task to perform. |
private static int |
WEEK_DAY
|
private int |
weekday
Valid entry ( 1-7 ). |
Fields inherited from class org.apache.turbine.om.BaseObject |
errMsg, is_new, modified, NEW_ID, primaryKey |
Constructor Summary | |
JobEntry(int sec,
int min,
int hour,
int wd,
int day_mo,
java.lang.String task)
Constuctor. |
Method Summary | |
void |
calcRunTime()
Calculate how long before the next runtime. The runtime determines it's position in the job queue. |
boolean |
equals(java.lang.Object je)
Compare this Job with another. |
private int |
evaluateJobType()
What schedule am I on? I know this is kinda ugly! If you can think of a cleaner way to do this, please jump in! |
int |
getDay_of_month()
Get the value of day_of_month. |
java.lang.String |
getEmail()
Return the e-mail address for notification. |
int |
getHour()
Get the value of hour. |
int |
getMinute()
Get the value of minute. |
java.lang.String |
getNextRunAsString()
Get the next runtime for this job as a String. |
long |
getNextRuntime()
Get the next runtime for this job as a long. |
java.util.Hashtable |
getProperty()
Get extra job properties |
int |
getSecond()
Get the value of second. |
java.lang.String |
getTask()
Return the task for this job. |
int |
getWeekday()
Get the value of weekday. |
boolean |
isActive()
Check to see if job is currently active/running |
void |
save()
Self-preservation. |
void |
setActive(boolean isActive)
Sets whether the job is running. |
void |
setDay_of_month(int v)
Set the value of day_of_month. |
void |
setEmail(java.lang.String mail)
The address to send mail notifications to. |
void |
setHour(int v)
Set the value of hour. |
void |
setMinute(int v)
Set the value of minute. |
void |
setProperty(java.util.Hashtable prop)
Set job properties |
void |
setSecond(int v)
Set the value of second. |
void |
setTask(java.lang.String task)
Set the task name for this job. |
void |
setWeekday(int v)
Set the value of weekday. |
Methods inherited from class org.apache.turbine.om.BaseObject |
equals, getByName, getByPeerName, getByPosition, getPrimaryKey, getPrimaryKeyAsBigDecimal, getPrimaryKeyAsInt, getPrimaryKeyAsLong, getPrimaryKeyAsString, hashCode, isModified, isNew, resetModified, setModified, setNew, setPrimaryKey, setPrimaryKey, setPrimaryKey, setPrimaryKey, setPrimaryKey |
Methods inherited from class java.lang.Object |
|
Field Detail |
private int second
private int minute
private int hour
private int weekday
private int day_of_month
private java.lang.String task
private long runtime
private java.lang.String email
private boolean jobIsActive
private static final int SECOND
private static final int MINUTE
private static final int WEEK_DAY
private static final int DAY_OF_MONTH
private static final int DAILY
private java.util.Hashtable jobProp
Constructor Detail |
public JobEntry(int sec, int min, int hour, int wd, int day_mo, java.lang.String task) throws java.lang.Exception
sec
- Value for entry "seconds".min
- Value for entry "minutes".hour
- Value for entry "hours".wd
- Value for entry "week days".day_mo
- Value for entry "month days".task
- Task to execute.Exception,
- a generic exception.Method Detail |
public void calcRunTime() throws java.lang.Exception
Exception,
- a generic exception.public long getNextRuntime()
public java.lang.String getNextRunAsString()
public void setEmail(java.lang.String mail)
mail
- The email address.public java.lang.String getEmail()
public java.lang.String getTask()
public void setTask(java.lang.String task)
task
- A String with the name of the job.public int getSecond()
public void setSecond(int v)
v
- Value to assign to second.public int getMinute()
public void setMinute(int v)
v
- Value to assign to minute.public int getHour()
public void setHour(int v)
v
- Value to assign to hour.public int getWeekday()
public void setWeekday(int v)
v
- Value to assign to weekday.public int getDay_of_month()
public void setDay_of_month(int v)
v
- Value to assign to day_of_month.public void save() throws java.lang.Exception
save
in class BaseObject
Exception,
- a generic exception.private int evaluateJobType() throws java.lang.Exception
Exception,
- a generic exception.public boolean equals(java.lang.Object je)
equals
in class BaseObject
je
- The JobEntry object to compare to.public void setActive(boolean isActive)
isActive
- Whether the job is running.public boolean isActive()
public void setProperty(java.util.Hashtable prop)
public java.util.Hashtable getProperty()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |