res.setRecurringDay(formatRecurringDayOfWeek(taskSchedule.getDaysToRun()));
}
else if (MonthlySchedule.class.isAssignableFrom(task.getSchedule().getClass())) {
resource = new ScheduledServiceMonthlyResource();
MonthlySchedule taskSchedule = (MonthlySchedule) task.getSchedule();
ScheduledServiceMonthlyResource res = (ScheduledServiceMonthlyResource) resource;
res.setStartDate(formatDate(taskSchedule.getStartDate()));
res.setRecurringTime(formatTime(taskSchedule.getStartDate()));
res.setRecurringDay(formatRecurringDayOfMonth(taskSchedule.getDaysToRun()));
}
else if (CronSchedule.class.isAssignableFrom(task.getSchedule().getClass())) {
resource = new ScheduledServiceAdvancedResource();
CronSchedule taskSchedule = (CronSchedule) task.getSchedule();
ScheduledServiceAdvancedResource res = (ScheduledServiceAdvancedResource) resource;
res.setCronCommand(taskSchedule.getCronString());
}
if (resource != null) {
resource.setId(task.getId());
resource.setEnabled(task.isEnabled());