protected void setString(final AutoTimer timer, final String value) { timer.getScheduleExpression().month(value); } },
public ScheduleExpression getScheduleExpression() { if (this.scheduleExpression == null) { this.scheduleExpression = new ScheduleExpression(); this.scheduleExpression.second(this.scheduleExprSecond).minute(this.scheduleExprMinute).hour(this.scheduleExprHour).dayOfWeek(this.scheduleExprDayOfWeek) .dayOfMonth(this.scheduleExprDayOfMonth).month(this.scheduleExprMonth).year(this.scheduleExprYear).timezone(this.scheduleExprTimezone) .start(this.scheduleExprStartDate).end(this.scheduleExprEndDate); } return scheduleExpression; }
s.dayOfWeek(builder.scheduleExprDayOfWeek); s.dayOfMonth(builder.scheduleExprDayOfMonth); s.month(builder.scheduleExprMonth); s.year(builder.scheduleExprYear); s.start(builder.scheduleExprStartDate);
private ScheduleExpression clone(ScheduleExpression schedule) { // clone the schedule ScheduleExpression clonedSchedule = new ScheduleExpression(); clonedSchedule.second(schedule.getSecond()); clonedSchedule.minute(schedule.getMinute()); clonedSchedule.hour(schedule.getHour()); clonedSchedule.dayOfWeek(schedule.getDayOfWeek()); clonedSchedule.dayOfMonth(schedule.getDayOfMonth()); clonedSchedule.month(schedule.getMonth()); clonedSchedule.year(schedule.getYear()); clonedSchedule.timezone(schedule.getTimezone()); clonedSchedule.start(schedule.getStart()); clonedSchedule.end(schedule.getEnd()); return clonedSchedule; }
scheduleExpression.hour(schedule.getHour()); scheduleExpression.minute(schedule.getMinute()); scheduleExpression.month(schedule.getMonth()); scheduleExpression.second(schedule.getSecond()); scheduleExpression.year(schedule.getYear());
public ScheduleExpression month(int month) { return month(Integer.toString(month)); }
protected void setString(final AutoTimer timer, final String value) { timer.getScheduleExpression().month(value); } },
public void createCustomer(Customer04 customer) { em.persist(customer); ScheduleExpression birthDay = new ScheduleExpression().dayOfMonth(customer.getBirthDay()).month(customer.getBirthMonth()); timerService.createCalendarTimer(birthDay, new TimerConfig(customer, true)); }
/** * {@inheritDoc} */ @Override public Object convert(String value, Context context) throws IllegalArgumentException { String[] tokens = value.split("\\s+"); if (tokens.length < 6 || tokens.length > 7) { throw new IllegalArgumentException( "expression must include 6 or 7 space-delimited tokens; got '" + value + "'"); } ScheduleExpression se = new ScheduleExpression(); se.second(tokens[0]); se.minute(tokens[1]); se.hour(tokens[2]); se.dayOfMonth(tokens[3]); se.month(tokens[4]); se.dayOfWeek(tokens[5]); if (tokens.length == 7) { se.year(tokens[6]); } return se; } }
private ScheduleExpression getScheduleExpression(String cronSchedule) { ScheduleExpression schedule = new ScheduleExpression(); String[] fields = cronSchedule.split(" "); if (fields.length > 8) { throw new IllegalArgumentException( "Too many fields in cronexpression: " + cronSchedule); } if (fields.length > 1) { schedule.second(fields[0]); } if (fields.length > 2) { schedule.minute(fields[1]); } if (fields.length > 3) { schedule.hour(fields[2]); } if (fields.length > 4) { schedule.dayOfMonth(fields[3]); } if (fields.length > 5) { schedule.month(fields[4]); } if (fields.length > 6) { schedule.dayOfWeek(fields[5]); } if (fields.length > 7) { schedule.year(fields[6]); } return schedule; }
private ScheduleExpression getScheduleExpression(String cronSchedule) { ScheduleExpression schedule = new ScheduleExpression(); String[] fields = cronSchedule.split(" "); if (fields.length > 8) { throw new IllegalArgumentException( "Too many fields in cronexpression: " + cronSchedule); } if (fields.length > 1) { schedule.second(fields[0]); } if (fields.length > 2) { schedule.minute(fields[1]); } if (fields.length > 3) { schedule.hour(fields[2]); } if (fields.length > 4) { schedule.dayOfMonth(fields[3]); } if (fields.length > 5) { schedule.month(fields[4]); } if (fields.length > 6) { schedule.dayOfWeek(fields[5]); } if (fields.length > 7) { schedule.year(fields[6]); } return schedule; }
public ScheduleExpression getScheduleExpression() { return new ScheduleExpression(). second(second_). minute(minute_). hour(hour_). dayOfMonth(dayOfMonth_). month(month_). dayOfWeek(dayOfWeek_). year(year_). timezone(timezone_). start(start_). end(end_); }
public ScheduleExpression getScheduleExpression() { if (this.scheduleExpression == null) { this.scheduleExpression = new ScheduleExpression(); this.scheduleExpression.second(this.scheduleExprSecond).minute(this.scheduleExprMinute).hour(this.scheduleExprHour).dayOfWeek(this.scheduleExprDayOfWeek) .dayOfMonth(this.scheduleExprDayOfMonth).month(this.scheduleExprMonth).year(this.scheduleExprYear).timezone(this.scheduleExprTimezone) .start(this.scheduleExprStartDate).end(this.scheduleExprEndDate); } return scheduleExpression; }
private void addSchedulesToMethod(final MethodContext methodContext, final MethodScheduleInfo info) { if (methodContext == null) { return; } for (final ScheduleInfo scheduleInfo : info.schedules) { final ScheduleExpression expr = new ScheduleExpression(); expr.second(scheduleInfo.second == null ? "0" : scheduleInfo.second); expr.minute(scheduleInfo.minute == null ? "0" : scheduleInfo.minute); expr.hour(scheduleInfo.hour == null ? "0" : scheduleInfo.hour); expr.dayOfWeek(scheduleInfo.dayOfWeek == null ? "*" : scheduleInfo.dayOfWeek); expr.dayOfMonth(scheduleInfo.dayOfMonth == null ? "*" : scheduleInfo.dayOfMonth); expr.month(scheduleInfo.month == null ? "*" : scheduleInfo.month); expr.year(scheduleInfo.year == null ? "*" : scheduleInfo.year); expr.timezone(scheduleInfo.timezone); expr.start(scheduleInfo.start); expr.end(scheduleInfo.end); final TimerConfig config = new TimerConfig(); config.setInfo(scheduleInfo.info); config.setPersistent(scheduleInfo.persistent); methodContext.getSchedules().add(new ScheduleData(config, expr)); } }
private void addSchedulesToMethod(final MethodContext methodContext, final MethodScheduleInfo info) { if (methodContext == null) { return; } for (final ScheduleInfo scheduleInfo : info.schedules) { final ScheduleExpression expr = new ScheduleExpression(); expr.second(scheduleInfo.second == null ? "0" : scheduleInfo.second); expr.minute(scheduleInfo.minute == null ? "0" : scheduleInfo.minute); expr.hour(scheduleInfo.hour == null ? "0" : scheduleInfo.hour); expr.dayOfWeek(scheduleInfo.dayOfWeek == null ? "*" : scheduleInfo.dayOfWeek); expr.dayOfMonth(scheduleInfo.dayOfMonth == null ? "*" : scheduleInfo.dayOfMonth); expr.month(scheduleInfo.month == null ? "*" : scheduleInfo.month); expr.year(scheduleInfo.year == null ? "*" : scheduleInfo.year); expr.timezone(scheduleInfo.timezone); expr.start(scheduleInfo.start); expr.end(scheduleInfo.end); final TimerConfig config = new TimerConfig(); config.setInfo(scheduleInfo.info); config.setPersistent(scheduleInfo.persistent); methodContext.getSchedules().add(new ScheduleData(config, expr)); } }
public ScheduleExpression getScheduleExpression() { return new ScheduleExpression(). second(getSecond()). minute(getMinute()). hour(getHour()). dayOfMonth(getDayOfMonth()). month(getMonth()). dayOfWeek(getDayOfWeek()). year(getYear()). timezone(getTimeZoneID()). start(getStart()). end(getEnd()); }
private ScheduleExpression clone(ScheduleExpression schedule) { // clone the schedule ScheduleExpression clonedSchedule = new ScheduleExpression(); clonedSchedule.second(schedule.getSecond()); clonedSchedule.minute(schedule.getMinute()); clonedSchedule.hour(schedule.getHour()); clonedSchedule.dayOfWeek(schedule.getDayOfWeek()); clonedSchedule.dayOfMonth(schedule.getDayOfMonth()); clonedSchedule.month(schedule.getMonth()); clonedSchedule.year(schedule.getYear()); clonedSchedule.timezone(schedule.getTimezone()); clonedSchedule.start(schedule.getStart()); clonedSchedule.end(schedule.getEnd()); return clonedSchedule; }
private ScheduleExpression copy(final ScheduleExpression scheduleExpression) { final ScheduleExpression scheduleExpressionCopy = new ScheduleExpression(); scheduleExpressionCopy.year(scheduleExpression.getYear()); scheduleExpressionCopy.month(scheduleExpression.getMonth()); scheduleExpressionCopy.dayOfMonth(scheduleExpression.getDayOfMonth()); scheduleExpressionCopy.dayOfWeek(scheduleExpression.getDayOfWeek()); scheduleExpressionCopy.hour(scheduleExpression.getHour()); scheduleExpressionCopy.minute(scheduleExpression.getMinute()); scheduleExpressionCopy.second(scheduleExpression.getSecond()); scheduleExpressionCopy.start(scheduleExpression.getStart()); scheduleExpressionCopy.end(scheduleExpression.getEnd()); scheduleExpressionCopy.timezone(scheduleExpression.getTimezone()); return scheduleExpressionCopy; }
private ScheduleExpression copy(final ScheduleExpression scheduleExpression) { final ScheduleExpression scheduleExpressionCopy = new ScheduleExpression(); scheduleExpressionCopy.year(scheduleExpression.getYear()); scheduleExpressionCopy.month(scheduleExpression.getMonth()); scheduleExpressionCopy.dayOfMonth(scheduleExpression.getDayOfMonth()); scheduleExpressionCopy.dayOfWeek(scheduleExpression.getDayOfWeek()); scheduleExpressionCopy.hour(scheduleExpression.getHour()); scheduleExpressionCopy.minute(scheduleExpression.getMinute()); scheduleExpressionCopy.second(scheduleExpression.getSecond()); scheduleExpressionCopy.start(scheduleExpression.getStart()); scheduleExpressionCopy.end(scheduleExpression.getEnd()); scheduleExpressionCopy.timezone(scheduleExpression.getTimezone()); return scheduleExpressionCopy; } }
private ScheduleExpression clone(ScheduleExpression schedule) { // clone the schedule ScheduleExpression clonedSchedule = new ScheduleExpression(); clonedSchedule.second(schedule.getSecond()); clonedSchedule.minute(schedule.getMinute()); clonedSchedule.hour(schedule.getHour()); clonedSchedule.dayOfWeek(schedule.getDayOfWeek()); clonedSchedule.dayOfMonth(schedule.getDayOfMonth()); clonedSchedule.month(schedule.getMonth()); clonedSchedule.year(schedule.getYear()); clonedSchedule.timezone(schedule.getTimezone()); clonedSchedule.start(schedule.getStart()); clonedSchedule.end(schedule.getEnd()); return clonedSchedule; }