in src/java/org/apache/turbine/services/schedule/AbstractJobEntry.java [304:375]
private ScheduleType evaluateJobType()
throws TurbineException
{
// First start by checking if it's a day of the month job.
if (getDayOfMonth() < 0)
{
// Not a day of the month job... check weekday.
if (getWeekDay() < 0)
{
// Not a weekday job...check if by the hour.
if (getHour() < 0)
{
// Not an hourly job...check if it is by the minute
if (getMinute() < 0)
{
// Not a by the minute job so must be by the second
if (getSecond() < 0)
{
throw new TurbineException("Error in JobEntry. Bad Job parameter.");
}
return ScheduleType.SECOND;
}
else
{
// Must be a job run by the minute so we need minutes and
// seconds.
if (getMinute() < 0 || getSecond() < 0)
{
throw new TurbineException("Error in JobEntry. Bad Job parameter.");
}
return ScheduleType.MINUTE;
}
}
else
{
// Must be a daily job by hours minutes, and seconds. In
// this case, we need the minute, second, and hour params.
if (getMinute() < 0 || getHour() < 0 || getSecond() < 0)
{
throw new TurbineException("Error in JobEntry. Bad Job parameter.");
}
return ScheduleType.DAILY;
}
}
else
{
// Must be a weekday job. In this case, we need
// minute, second, and hour params
if (getMinute() < 0 || getHour() < 0 || getSecond() < 0)
{
throw new TurbineException("Error in JobEntry. Bad Job parameter.");
}
return ScheduleType.WEEK_DAY;
}
}
else
{
// Must be a day of the month job. In this case, we need
// minute, second, and hour params
if (getMinute() < 0 || getHour() < 0)
{
throw new TurbineException("Error in JobEntry. Bad Job parameter.");
}
return ScheduleType.DAY_OF_MONTH;
}
}