mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-04-15 04:02:53 +00:00
[AB-xx] improving scheduling interface
moving renaming module to int removing duplicated starboard feature validator sonar fixes
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
package dev.sheldan.abstracto.scheduling.model;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
public class JobParameters {
|
||||
@Builder.Default
|
||||
private Map<Object, Object> parameters = new HashMap<>();
|
||||
}
|
||||
@@ -22,36 +22,43 @@ public class SchedulerJob implements Serializable {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* The name of the job
|
||||
*/
|
||||
@Column(name = "name")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* The group of the job
|
||||
*/
|
||||
@Column(name = "group_name")
|
||||
private String groupName;
|
||||
|
||||
/**
|
||||
* The absolute path of a class extending {@link org.springframework.scheduling.quartz.QuartzJobBean} which should be executed by this job
|
||||
*/
|
||||
@Column(name = "clazz")
|
||||
private String clazz;
|
||||
|
||||
/**
|
||||
* If the job should be executed based on a cron expression, this contains this expression. If it is a one-time job this needs to be null.
|
||||
*/
|
||||
@Column(name = "cron_expression")
|
||||
private String cronExpression;
|
||||
|
||||
/**
|
||||
* Whether or not the job is active and available to be scheduled.
|
||||
*/
|
||||
@Column(name = "active")
|
||||
private boolean active;
|
||||
|
||||
/**
|
||||
* Whether or not the job should be re-tried in an recovery of fail over situation.
|
||||
*/
|
||||
@Column(name = "recovery")
|
||||
private boolean recovery;
|
||||
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package dev.sheldan.abstracto.scheduling.service;
|
||||
|
||||
import dev.sheldan.abstracto.scheduling.model.JobParameters;
|
||||
import dev.sheldan.abstracto.scheduling.model.database.SchedulerJob;
|
||||
import org.quartz.JobDataMap;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@@ -59,14 +59,14 @@ public interface SchedulerService {
|
||||
boolean executeJob(SchedulerJob job);
|
||||
|
||||
/**
|
||||
* Executes the job identified by name and group with the given {@link JobDataMap} as parameters on the given {@link Date}
|
||||
* Executes the job identified by name and group with the given {@link JobParameters} as parameters on the given {@link Date}
|
||||
* @param name The name of the job to execute
|
||||
* @param group The group of the job to execute
|
||||
* @param dataMap The {@link JobDataMap} made available to the group
|
||||
* @param dataMap The {@link JobParameters} made available to the group
|
||||
* @param date The {@link Date} at which the job should be execute at.
|
||||
* @return The trigger key which triggers the job at the given date
|
||||
*/
|
||||
String executeJobWithParametersOnce(String name, String group, JobDataMap dataMap, Date date);
|
||||
String executeJobWithParametersOnce(String name, String group, JobParameters dataMap, Date date);
|
||||
|
||||
/**
|
||||
* Stops the trigger identified by the trigger key.
|
||||
|
||||
Reference in New Issue
Block a user