mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-03-24 05:39:44 +00:00
renamed feature display to feature config
added concept of feature dependencies, if one feature depends on another feature, and it gets enabled, the other feature is enabled as well changed some feature related apis added ability to automatically decay warnings (separate feature) added command to trigger the warn decay manually added command to decay all active warnings added method to scheduler service to directly start a cron job
This commit is contained in:
@@ -44,6 +44,15 @@ public class QuartzConfigFactory {
|
||||
.build();
|
||||
}
|
||||
|
||||
public CronTrigger createBasicCronTrigger(String jobName, String jobGroup, Date startTime, String cronExpression, JobDataMap jobDataMap) {
|
||||
return newTrigger()
|
||||
.withSchedule(cronSchedule(cronExpression).inTimeZone(TimeZone.getTimeZone("UTC")).withMisfireHandlingInstructionDoNothing())
|
||||
.startAt(startTime)
|
||||
.usingJobData(jobDataMap)
|
||||
.forJob(jobName, jobGroup)
|
||||
.build();
|
||||
}
|
||||
|
||||
public Trigger createSimpleOnceOnlyTrigger(Date startTime) {
|
||||
return newTrigger()
|
||||
.startAt(startTime)
|
||||
|
||||
@@ -159,6 +159,18 @@ public class SchedulerServiceBean implements SchedulerService {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String startCronJobWithParameters(String name, String group, JobDataMap dataMap, String cronExpression) {
|
||||
Trigger cronTrigger = scheduleCreator.createBasicCronTrigger(name, group, new Date(), cronExpression, dataMap);
|
||||
try {
|
||||
schedulerFactoryBean.getScheduler().scheduleJob(cronTrigger);
|
||||
return cronTrigger.getKey().getName();
|
||||
} catch (SchedulerException e) {
|
||||
log.error("Failed to start new job - {}", name, e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stopTrigger(String triggerKey) {
|
||||
try {
|
||||
|
||||
@@ -7,24 +7,15 @@ import java.util.Date;
|
||||
|
||||
public interface SchedulerService {
|
||||
void startScheduledJobs();
|
||||
|
||||
void scheduleJob(SchedulerJob job);
|
||||
|
||||
void updateJob(SchedulerJob job, Date startDate);
|
||||
|
||||
boolean unScheduleJob(String jobName);
|
||||
|
||||
boolean deleteJob(SchedulerJob job);
|
||||
|
||||
boolean pauseJob(SchedulerJob job);
|
||||
|
||||
boolean continueJob(SchedulerJob job);
|
||||
|
||||
boolean executeJob(SchedulerJob job);
|
||||
|
||||
String executeJobWithParametersOnce(String name, String group, JobDataMap dataMap, Date date);
|
||||
|
||||
String startCronJobWithParameters(String name, String group, JobDataMap dataMap, String cronExpression);
|
||||
void stopTrigger(String triggerKey);
|
||||
|
||||
void startScheduler();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user