{
cronTrigger.setCronExpression(cronExpression.toString());
}
catch(ParseException pe)
{
throw new ProviderException(pe);
}
cronTrigger.setStartTime(reportSchedule.getStartDate());
cronTrigger.setPriority(reportSchedule.getSchedulePriority());
cronTrigger.getJobDataMap().put(reportSchedule.getScheduleName(), reportSchedule.getRequestId());
try
{
scheduler.scheduleJob(jobDetail, cronTrigger);
}
catch(SchedulerException e)
{
throw new ProviderException(e);
}
}
else
{
// default to run once...
SimpleTrigger trigger = new SimpleTrigger(reportSchedule.getScheduleName(),
reportSchedule.getScheduleGroup(), reportSchedule.getStartDateTime(), null,
0, 0L);
trigger.setPriority(reportSchedule.getSchedulePriority());
trigger.getJobDataMap().put(reportSchedule.getScheduleName(), reportSchedule.getRequestId());
try
{
scheduler.scheduleJob(jobDetail, trigger);
}
catch(SchedulerException e)
{
throw new ProviderException(e);
}
}
}