/** * Fill frequency. * * @param model the model * @param ends the ends * @param occurrences the occurrences * @param after the after * @param frequency the frequency * @param df the df * @throws Exception the exception */ private void fillFrequency( ScheduleModel model, String ends, Integer occurrences, String after, Frequency frequency, DateFormat df, String timezone) throws Exception { if (!ends.equals(NEVER)) { frequency.setNeverEnds(false); if (ends.equals(AFTER)) { frequency.setEndsAfterOccurrences(occurrences); } else if (ends.equals(ON)) { frequency.setEndDate( DMConvertUtil.convertDateToUTC( df.parse(after + SPACE + model.getScheduleEventTime()), Integer.valueOf(timezone))); } } else { frequency.setNeverEnds(true); } }