Added performing tours and docs
This commit is contained in:
@ -119,25 +119,52 @@ public class AppConfig {
|
||||
return AppState.NO_TOUR;
|
||||
}
|
||||
|
||||
/**
|
||||
* get cron expression of first tour end
|
||||
*
|
||||
* @return spring cron expression
|
||||
*/
|
||||
public CronTrigger getFirstTourEndCron() {
|
||||
return getCron(this.firstTourEnd);
|
||||
}
|
||||
|
||||
/**
|
||||
* get cron expression of second tour end
|
||||
*
|
||||
* @return spring cron expression
|
||||
*/
|
||||
public CronTrigger getSecondTourEndCron() {
|
||||
return getCron(this.secondTourEnd);
|
||||
}
|
||||
|
||||
/**
|
||||
* get cron expression of first tour start
|
||||
*
|
||||
* @return spring cron expression
|
||||
*/
|
||||
public CronTrigger getFirstTourStartCron() {
|
||||
return getCron(this.firstTourStart);
|
||||
}
|
||||
|
||||
/**
|
||||
* get cron expression of second tour start
|
||||
*
|
||||
* @return spring cron expression
|
||||
*/
|
||||
public CronTrigger getSecondTourStartCron() {
|
||||
return getCron(this.secondTourStart);
|
||||
}
|
||||
|
||||
/**
|
||||
* create spring cron expression
|
||||
*
|
||||
* @param date date to create cron exp from
|
||||
* @return spring cron expression. Remember that spring's cron deosn't contain
|
||||
* year in it.
|
||||
*/
|
||||
private CronTrigger getCron(Date date) {
|
||||
final LocalDate tourEnd = date.toLocalDate();
|
||||
return new CronTrigger("0 0 0 " + tourEnd.getDayOfMonth() + " " + tourEnd.getMonthValue() + " ?",
|
||||
return new CronTrigger("0 11 11 " + tourEnd.getDayOfMonth() + " " + tourEnd.getMonthValue() + " ?",
|
||||
TimeZone.getTimeZone(TimeZone.getDefault().getID()));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user