Class JobEntryNonPersistent
- java.lang.Object
-
- org.apache.turbine.services.schedule.AbstractJobEntry
-
- org.apache.turbine.services.schedule.JobEntryNonPersistent
-
- All Implemented Interfaces:
Comparable<JobEntry>,JobEntry
public class JobEntryNonPersistent extends AbstractJobEntry
This is an implementation of a JobEntry with no persistence. It is used by theTurbineNonPersistentSchedulerService
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.turbine.services.schedule.AbstractJobEntry
AbstractJobEntry.ScheduleType
-
-
Field Summary
-
Fields inherited from class org.apache.turbine.services.schedule.AbstractJobEntry
log
-
-
Constructor Summary
Constructors Constructor Description JobEntryNonPersistent()Default constructorJobEntryNonPersistent(int sec, int min, int hour, int wd, int day_mo, String task)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)intgetDayOfMonth()Get the value of dayOfMonth.intgetHour()Get the value of hour.intgetJobId()Get the value of jobId.intgetMinute()Get the value of minute.intgetSecond()Get the value of second.StringgetTask()Get the value of task.intgetWeekDay()Get the value of weekDay.inthashCode()booleanisNew()Return true, if the entry is not yet persistedvoidsetDayOfMonth(int v)Set the value of dayOfMonth.voidsetHour(int v)Set the value of hour.voidsetJobId(int v)Set the value of jobId.voidsetMinute(int v)Set the value of minute.voidsetSecond(int v)Set the value of second.voidsetTask(String v)Set the value of task.voidsetWeekDay(int v)Set the value of weekDay.-
Methods inherited from class org.apache.turbine.services.schedule.AbstractJobEntry
calcRunTime, compareTo, getNextRunAsString, getNextRunDate, getNextRuntime, isActive, setActive
-
-
-
-
Constructor Detail
-
JobEntryNonPersistent
public JobEntryNonPersistent()
Default constructor
-
JobEntryNonPersistent
public JobEntryNonPersistent(int sec, int min, int hour, int wd, int day_mo, String task) throws TurbineException
Constructor. Schedule a job to run on a certain point of time.
Example 1: Run the DefaultScheduledJob at 8:00am every 15th of the month -
JobEntry je = new JobEntry(0,0,8,15,"DefaultScheduledJob");
Example 2: Run the DefaultScheduledJob at 8:00am every day -
JobEntry je = new JobEntry(0,0,8,-1,"DefaultScheduledJob");
Example 3: Run the DefaultScheduledJob every 2 hours. -
JobEntry je = new JobEntry(0,120,-1,-1,"DefaultScheduledJob");
Example 4: Run the DefaultScheduledJob every 30 seconds. -
JobEntry je = new JobEntry(30,-1,-1,-1,"DefaultScheduledJob");- Parameters:
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.- Throws:
TurbineException- a generic exception.
-
-
Method Detail
-
hashCode
public int hashCode()
- Overrides:
hashCodein classObject- See Also:
Object.hashCode()
-
equals
public boolean equals(Object obj)
- Overrides:
equalsin classObject- See Also:
Object.equals(java.lang.Object)
-
isNew
public boolean isNew()
Return true, if the entry is not yet persisted- Returns:
- true if job is not yet saved, otherwise false
-
getJobId
public int getJobId()
Get the value of jobId.- Specified by:
getJobIdin interfaceJobEntry- Specified by:
getJobIdin classAbstractJobEntry- Returns:
- int
-
setJobId
public void setJobId(int v)
Set the value of jobId.- Specified by:
setJobIdin interfaceJobEntry- Specified by:
setJobIdin classAbstractJobEntry- Parameters:
v- new value
-
getSecond
public int getSecond()
Get the value of second.- Specified by:
getSecondin classAbstractJobEntry- Returns:
- int
-
setSecond
public void setSecond(int v)
Set the value of second.- Specified by:
setSecondin classAbstractJobEntry- Parameters:
v- new value
-
getMinute
public int getMinute()
Get the value of minute.- Specified by:
getMinutein classAbstractJobEntry- Returns:
- int
-
setMinute
public void setMinute(int v)
Set the value of minute.- Specified by:
setMinutein classAbstractJobEntry- Parameters:
v- new value
-
getHour
public int getHour()
Get the value of hour.- Specified by:
getHourin classAbstractJobEntry- Returns:
- int
-
setHour
public void setHour(int v)
Set the value of hour.- Specified by:
setHourin classAbstractJobEntry- Parameters:
v- new value
-
getWeekDay
public int getWeekDay()
Get the value of weekDay.- Specified by:
getWeekDayin classAbstractJobEntry- Returns:
- int
-
setWeekDay
public void setWeekDay(int v)
Set the value of weekDay.- Specified by:
setWeekDayin classAbstractJobEntry- Parameters:
v- new value
-
getDayOfMonth
public int getDayOfMonth()
Get the value of dayOfMonth.- Specified by:
getDayOfMonthin classAbstractJobEntry- Returns:
- int
-
setDayOfMonth
public void setDayOfMonth(int v)
Set the value of dayOfMonth.- Specified by:
setDayOfMonthin classAbstractJobEntry- Parameters:
v- new value
-
getTask
public String getTask()
Get the value of task.- Specified by:
getTaskin interfaceJobEntry- Specified by:
getTaskin classAbstractJobEntry- Returns:
- String
-
-