return new CronTrigger(jobName, groupName, jobName, groupName, on.createCronExpression());
}
else if (times instanceof ScheduleRepeated)
{
ScheduleRepeated repeated = (ScheduleRepeated) times;
return new SimpleTrigger(jobName, groupName, jobName, groupName, repeated.getFrom(), repeated.getUntil(),
repeated.isIndefinitely() ? SimpleTrigger.REPEAT_INDEFINITELY : repeated.getCount(),
repeated.getInterval());
}
throw new Exception("Unknown ScheduleTimes instance");
}