I am trying to build a Trigger in Quartz Scheduler API which should get executed with following criteria.
I have created the following expression
newTrigger().withIdentity(cronTriggerDTO.getTiggerId(), "simpleGroup")
.startAt(getTriggerExecutionDate(cronTriggerDTO))
.withSchedule(calendarIntervalSchedule().withIntervalInWeeks
(cronTriggerDTO.getWeeklyInterval())).build();
but I am confused how I should add the condition to execute this trigger on particular days of week
Use DailyTimeIntervalScheduleBuilder
Set daysOfWeek = new HashSet();
daysOfWeek.add(1);
daysOfWeek.add(2);
daysOfWeek.add(5);
newTrigger().withIdentity(cronTriggerDTO.getTiggerId(), "simpleGroup")
.startAt(getTriggerExecutionDate(cronTriggerDTO))
.withSchedule(dailyTimeIntervalSchedule()
.onDaysOfTheWeek(daysOfWeek)
.startingDailyAt(new TimeOfDay(8,0)))
.build();