added scheduling support

added remind command
added support for parameters with spaces (they are contained by ")
fixed support for remainder parameters
added maxlength support for parameters
added ability to embed templates, to have a text as well
moved properties to a more appropriate position
added method do parse a duration
This commit is contained in:
Sheldan
2020-03-28 20:12:59 +01:00
parent e0474a4c98
commit 03e81a025b
64 changed files with 1318 additions and 125 deletions

View File

@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>dev.sheldan.abstracto.scheduling</groupId>
<artifactId>scheduling</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging>
<artifactId>scheduling-int</artifactId>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-quartz</artifactId>
</dependency>
</dependencies>
</project>

View File

@@ -0,0 +1,30 @@
package dev.sheldan.abstracto.scheduling.model;
import lombok.*;
import javax.persistence.*;
@Getter
@Setter
@Entity
@Builder
@Table(name = "scheduler_job")
@NoArgsConstructor
@AllArgsConstructor
public class SchedulerJob {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String name;
private String groupName;
private String clazz;
private String cronExpression;
private boolean active;
}

View File

@@ -0,0 +1,25 @@
package dev.sheldan.abstracto.scheduling.model;
import org.quartz.JobDataMap;
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);
boolean executeJobWithParametersOnce(String name, String group, JobDataMap dataMap, Date date);
}