parent
12d978ea49
commit
33647f20c2
@ -0,0 +1,162 @@
|
|||||||
|
package com.xxl.job.admin.business.service.impl;
|
||||||
|
|
||||||
|
import com.xxl.job.admin.business.model.XxlJobInfo;
|
||||||
|
import com.xxl.job.admin.business.service.XxlJobService;
|
||||||
|
import com.xxl.job.admin.framework.constant.Consts;
|
||||||
|
import com.xxl.job.core.openapi.admin.AdminJobBiz;
|
||||||
|
import com.xxl.job.core.openapi.admin.dto.JobAddRequest;
|
||||||
|
import com.xxl.job.core.openapi.admin.dto.JobOperateRequest;
|
||||||
|
import com.xxl.job.core.openapi.admin.dto.JobTriggerRequest;
|
||||||
|
import com.xxl.job.core.openapi.admin.dto.JobUpdateRequest;
|
||||||
|
import com.xxl.sso.core.model.LoginInfo;
|
||||||
|
import com.xxl.tool.concurrent.TokenBucket;
|
||||||
|
import com.xxl.tool.json.GsonTool;
|
||||||
|
import com.xxl.tool.response.Response;
|
||||||
|
import com.xxl.tool.response.ResponseCode;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.time.Duration;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* openapi admin job service, delegates to XxlJobService with a system-level LoginInfo
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class AdminJobBizImpl implements AdminJobBiz {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private XxlJobService xxlJobService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* openapi login info
|
||||||
|
*/
|
||||||
|
private final LoginInfo OPENAPI_LOGIN_INFO = new LoginInfo(
|
||||||
|
"0",
|
||||||
|
"openapi",
|
||||||
|
"OpenAPI",
|
||||||
|
null,
|
||||||
|
List.of(Consts.ADMIN_ROLE),
|
||||||
|
null,
|
||||||
|
-1L,
|
||||||
|
null);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* token bucket, for rate limiting
|
||||||
|
*/
|
||||||
|
private final TokenBucket tokenBucket = TokenBucket.create(3, Duration.ofSeconds(30));
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Response<String> addJob(JobAddRequest request) {
|
||||||
|
|
||||||
|
// rate limit
|
||||||
|
if (!tokenBucket.tryAcquire(1, Duration.ofMillis(1000L))) {
|
||||||
|
return Response.of(ResponseCode.CODE_502.getCode(), "Too many requests, please try again later.");
|
||||||
|
}
|
||||||
|
|
||||||
|
// convert JobAddRequest to XxlJobInfo
|
||||||
|
XxlJobInfo jobInfo = new XxlJobInfo();
|
||||||
|
jobInfo.setJobGroup(request.getJobGroup());
|
||||||
|
jobInfo.setJobDesc(request.getJobDesc());
|
||||||
|
jobInfo.setAuthor(request.getAuthor());
|
||||||
|
jobInfo.setAlarmEmail(request.getAlarmEmail());
|
||||||
|
jobInfo.setScheduleType(request.getScheduleType());
|
||||||
|
jobInfo.setScheduleConf(request.getScheduleConf());
|
||||||
|
jobInfo.setMisfireStrategy(request.getMisfireStrategy());
|
||||||
|
jobInfo.setExecutorRouteStrategy(request.getExecutorRouteStrategy());
|
||||||
|
jobInfo.setExecutorHandler(request.getExecutorHandler());
|
||||||
|
jobInfo.setExecutorParam(request.getExecutorParam());
|
||||||
|
jobInfo.setExecutorBlockStrategy(request.getExecutorBlockStrategy());
|
||||||
|
jobInfo.setExecutorTimeout(request.getExecutorTimeout());
|
||||||
|
jobInfo.setExecutorFailRetryCount(request.getExecutorFailRetryCount());
|
||||||
|
jobInfo.setGlueType(request.getGlueType());
|
||||||
|
jobInfo.setGlueSource(request.getGlueSource());
|
||||||
|
jobInfo.setGlueRemark(request.getGlueRemark());
|
||||||
|
jobInfo.setChildJobId(null);
|
||||||
|
|
||||||
|
// add job
|
||||||
|
return xxlJobService.add(jobInfo, OPENAPI_LOGIN_INFO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Response<String> updateJob(JobUpdateRequest request) {
|
||||||
|
|
||||||
|
// rate limit
|
||||||
|
if (!tokenBucket.tryAcquire(1, Duration.ofMillis(1000L))) {
|
||||||
|
return Response.of(ResponseCode.CODE_502.getCode(), "Too many requests, please try again later.");
|
||||||
|
}
|
||||||
|
|
||||||
|
// convert JobUpdateRequest to XxlJobInfo
|
||||||
|
XxlJobInfo jobInfo = new XxlJobInfo();
|
||||||
|
jobInfo.setId(request.getId());
|
||||||
|
jobInfo.setJobGroup(0);
|
||||||
|
jobInfo.setJobDesc(request.getJobDesc());
|
||||||
|
jobInfo.setAuthor(request.getAuthor());
|
||||||
|
jobInfo.setAlarmEmail(request.getAlarmEmail());
|
||||||
|
jobInfo.setScheduleType(request.getScheduleType());
|
||||||
|
jobInfo.setScheduleConf(request.getScheduleConf());
|
||||||
|
jobInfo.setMisfireStrategy(request.getMisfireStrategy());
|
||||||
|
jobInfo.setExecutorRouteStrategy(request.getExecutorRouteStrategy());
|
||||||
|
jobInfo.setExecutorHandler(request.getExecutorHandler());
|
||||||
|
jobInfo.setExecutorParam(request.getExecutorParam());
|
||||||
|
jobInfo.setExecutorBlockStrategy(request.getExecutorBlockStrategy());
|
||||||
|
jobInfo.setExecutorTimeout(request.getExecutorTimeout());
|
||||||
|
jobInfo.setExecutorFailRetryCount(request.getExecutorFailRetryCount());
|
||||||
|
jobInfo.setGlueType(request.getGlueType());
|
||||||
|
jobInfo.setGlueSource(request.getGlueSource());
|
||||||
|
jobInfo.setGlueRemark(request.getGlueRemark());
|
||||||
|
jobInfo.setChildJobId(null);
|
||||||
|
|
||||||
|
// update job
|
||||||
|
return xxlJobService.update(jobInfo, OPENAPI_LOGIN_INFO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Response<String> removeJob(JobOperateRequest request) {
|
||||||
|
|
||||||
|
// rate limit
|
||||||
|
if (!tokenBucket.tryAcquire(1, Duration.ofMillis(1000L))) {
|
||||||
|
return Response.of(ResponseCode.CODE_502.getCode(), "Too many requests, please try again later.");
|
||||||
|
}
|
||||||
|
|
||||||
|
return xxlJobService.remove(request.getId(), OPENAPI_LOGIN_INFO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Response<String> startJob(JobOperateRequest request) {
|
||||||
|
|
||||||
|
// rate limit
|
||||||
|
if (!tokenBucket.tryAcquire(1, Duration.ofMillis(1000L))) {
|
||||||
|
return Response.of(ResponseCode.CODE_502.getCode(), "Too many requests, please try again later.");
|
||||||
|
}
|
||||||
|
|
||||||
|
return xxlJobService.start(request.getId(), OPENAPI_LOGIN_INFO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Response<String> stopJob(JobOperateRequest request) {
|
||||||
|
|
||||||
|
// rate limit
|
||||||
|
if (!tokenBucket.tryAcquire(1, Duration.ofMillis(1000L))) {
|
||||||
|
return Response.of(ResponseCode.CODE_502.getCode(), "Too many requests, please try again later.");
|
||||||
|
}
|
||||||
|
|
||||||
|
return xxlJobService.stop(request.getId(), OPENAPI_LOGIN_INFO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Response<String> triggerJob(JobTriggerRequest request) {
|
||||||
|
|
||||||
|
// rate limit
|
||||||
|
if (!tokenBucket.tryAcquire(1, Duration.ofMillis(1000L))) {
|
||||||
|
return Response.of(ResponseCode.CODE_502.getCode(), "Too many requests, please try again later.");
|
||||||
|
}
|
||||||
|
|
||||||
|
return xxlJobService.trigger(
|
||||||
|
OPENAPI_LOGIN_INFO,
|
||||||
|
request.getId(),
|
||||||
|
request.getExecutorParam(),
|
||||||
|
request.getAddressList());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,140 @@
|
|||||||
|
package com.xxl.job.openapi;
|
||||||
|
|
||||||
|
import com.xxl.job.core.constant.Const;
|
||||||
|
import com.xxl.job.core.openapi.admin.AdminJobBiz;
|
||||||
|
import com.xxl.job.core.openapi.admin.dto.JobAddRequest;
|
||||||
|
import com.xxl.job.core.openapi.admin.dto.JobOperateRequest;
|
||||||
|
import com.xxl.job.core.openapi.admin.dto.JobTriggerRequest;
|
||||||
|
import com.xxl.job.core.openapi.admin.dto.JobUpdateRequest;
|
||||||
|
import com.xxl.tool.http.HttpTool;
|
||||||
|
import com.xxl.tool.response.Response;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* admin job api test
|
||||||
|
*
|
||||||
|
* @author xuxueli
|
||||||
|
*/
|
||||||
|
public class AdminJobBizTest {
|
||||||
|
private static final Logger logger = LoggerFactory.getLogger(AdminJobBizTest.class);
|
||||||
|
|
||||||
|
private static String addressUrl = "http://127.0.0.1:8080";
|
||||||
|
private static String accessToken = "default_token";
|
||||||
|
private static String appname = "xxl-job-executor-sample";
|
||||||
|
|
||||||
|
private AdminJobBiz buildClient() {
|
||||||
|
String finalUrl = addressUrl + "/api";
|
||||||
|
|
||||||
|
return HttpTool.createClient()
|
||||||
|
.url(finalUrl)
|
||||||
|
.timeout(3 * 1000)
|
||||||
|
.header(Const.XXL_JOB_ACCESS_TOKEN, accessToken)
|
||||||
|
.header(Const.XXL_JOB_APPNAME, appname)
|
||||||
|
.proxy(AdminJobBiz.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
private int jobId = 10;
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void jobAdd() throws Exception {
|
||||||
|
AdminJobBiz adminJobBiz = buildClient();
|
||||||
|
|
||||||
|
JobAddRequest request = new JobAddRequest();
|
||||||
|
request.setJobGroup(1);
|
||||||
|
request.setJobDesc("openapi test job");
|
||||||
|
request.setAuthor("openapi");
|
||||||
|
request.setScheduleType("CRON");
|
||||||
|
request.setScheduleConf("0/20 * * * * ?");
|
||||||
|
request.setMisfireStrategy("DO_NOTHING");
|
||||||
|
request.setExecutorRouteStrategy("FIRST");
|
||||||
|
request.setExecutorHandler("demoJobHandler");
|
||||||
|
request.setExecutorBlockStrategy("SERIAL_EXECUTION");
|
||||||
|
request.setExecutorTimeout(0);
|
||||||
|
request.setExecutorFailRetryCount(0);
|
||||||
|
request.setGlueType("BEAN");
|
||||||
|
|
||||||
|
Response<String> returnT = adminJobBiz.addJob(request);
|
||||||
|
assertTrue(returnT.isSuccess());
|
||||||
|
assertNotNull(returnT.getData());
|
||||||
|
jobId = Integer.parseInt(returnT.getData());
|
||||||
|
logger.info("addJob jobId: {}", jobId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void jobUpdate() throws Exception {
|
||||||
|
AdminJobBiz adminJobBiz = buildClient();
|
||||||
|
|
||||||
|
// update the job created by jobAdd (id should exist in test env)
|
||||||
|
JobUpdateRequest request = new JobUpdateRequest();
|
||||||
|
request.setId(jobId);
|
||||||
|
request.setJobDesc("openapi test job update");
|
||||||
|
request.setAuthor("openapi");
|
||||||
|
request.setScheduleType("CRON");
|
||||||
|
request.setScheduleConf("0/10 * * * * ?");
|
||||||
|
request.setMisfireStrategy("DO_NOTHING");
|
||||||
|
request.setExecutorRouteStrategy("FIRST");
|
||||||
|
request.setExecutorHandler("demoJobHandler");
|
||||||
|
request.setExecutorBlockStrategy("SERIAL_EXECUTION");
|
||||||
|
request.setExecutorTimeout(0);
|
||||||
|
request.setExecutorFailRetryCount(0);
|
||||||
|
request.setGlueType("BEAN");
|
||||||
|
|
||||||
|
Response<String> returnT = adminJobBiz.updateJob(request);
|
||||||
|
logger.info("updateJob response: {}", returnT);
|
||||||
|
assertTrue(returnT.isSuccess());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void jobStart() throws Exception {
|
||||||
|
AdminJobBiz adminJobBiz = buildClient();
|
||||||
|
|
||||||
|
JobOperateRequest request = new JobOperateRequest();
|
||||||
|
request.setId(jobId);
|
||||||
|
|
||||||
|
Response<String> returnT = adminJobBiz.startJob(request);
|
||||||
|
logger.info("startJob response: {}", returnT);
|
||||||
|
assertTrue(returnT.isSuccess());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void jobStop() throws Exception {
|
||||||
|
AdminJobBiz adminJobBiz = buildClient();
|
||||||
|
|
||||||
|
JobOperateRequest request = new JobOperateRequest();
|
||||||
|
request.setId(jobId);
|
||||||
|
|
||||||
|
Response<String> returnT = adminJobBiz.stopJob(request);
|
||||||
|
logger.info("stopJob response: {}", returnT);
|
||||||
|
assertTrue(returnT.isSuccess());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void jobTrigger() throws Exception {
|
||||||
|
AdminJobBiz adminJobBiz = buildClient();
|
||||||
|
|
||||||
|
JobTriggerRequest request = new JobTriggerRequest();
|
||||||
|
request.setId(jobId);
|
||||||
|
|
||||||
|
Response<String> returnT = adminJobBiz.triggerJob(request);
|
||||||
|
logger.info("triggerJob response: {}", returnT);
|
||||||
|
assertTrue(returnT.isSuccess());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void jobRemove() throws Exception {
|
||||||
|
AdminJobBiz adminJobBiz = buildClient();
|
||||||
|
|
||||||
|
JobOperateRequest request = new JobOperateRequest();
|
||||||
|
request.setId(jobId);
|
||||||
|
|
||||||
|
Response<String> returnT = adminJobBiz.removeJob(request);
|
||||||
|
logger.info("removeJob response: {}", returnT);
|
||||||
|
assertTrue(returnT.isSuccess());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,46 @@
|
|||||||
|
package com.xxl.job.core.openapi.admin;
|
||||||
|
|
||||||
|
import com.xxl.job.core.openapi.admin.dto.JobAddRequest;
|
||||||
|
import com.xxl.job.core.openapi.admin.dto.JobOperateRequest;
|
||||||
|
import com.xxl.job.core.openapi.admin.dto.JobTriggerRequest;
|
||||||
|
import com.xxl.job.core.openapi.admin.dto.JobUpdateRequest;
|
||||||
|
import com.xxl.tool.response.Response;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* openapi admin job interface for job lifecycle management
|
||||||
|
*
|
||||||
|
* @author xuxueli
|
||||||
|
*/
|
||||||
|
public interface AdminJobBiz {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* add a new job
|
||||||
|
*/
|
||||||
|
Response<String> addJob(JobAddRequest request);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* update existing job config
|
||||||
|
*/
|
||||||
|
Response<String> updateJob(JobUpdateRequest request);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* remove a job by id
|
||||||
|
*/
|
||||||
|
Response<String> removeJob(JobOperateRequest request);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* start / enable a scheduled job
|
||||||
|
*/
|
||||||
|
Response<String> startJob(JobOperateRequest request);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* stop / disable a scheduled job
|
||||||
|
*/
|
||||||
|
Response<String> stopJob(JobOperateRequest request);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* trigger a job manually once
|
||||||
|
*/
|
||||||
|
Response<String> triggerJob(JobTriggerRequest request);
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,163 @@
|
|||||||
|
package com.xxl.job.core.openapi.admin.dto;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* request DTO for adding a new job
|
||||||
|
*/
|
||||||
|
public class JobAddRequest implements Serializable {
|
||||||
|
private static final long serialVersionUID = 42L;
|
||||||
|
|
||||||
|
private int jobGroup;
|
||||||
|
private String jobDesc;
|
||||||
|
|
||||||
|
private String author;
|
||||||
|
private String alarmEmail;
|
||||||
|
|
||||||
|
private String scheduleType; // NONE、CRON、FIX_RATE
|
||||||
|
private String scheduleConf;
|
||||||
|
private String misfireStrategy; // DO_NOTHING、FIRE_ONCE_NOW
|
||||||
|
|
||||||
|
private String executorRouteStrategy; // FIRST、LAST、ROUND、RANDOM、CONSISTENT_HASH、LEAST_FREQUENTLY_USED、LEAST_RECENTLY_USED、FAILOVER、BUSYOVER、SHARDING_BROADCAST
|
||||||
|
private String executorHandler;
|
||||||
|
private String executorParam;
|
||||||
|
private String executorBlockStrategy; // SERIAL_EXECUTION、DISCARD_LATER、COVER_EARLY
|
||||||
|
private int executorTimeout;
|
||||||
|
private int executorFailRetryCount;
|
||||||
|
|
||||||
|
private String glueType; // BEAN、GLUE_GROOVY、GLUE_SHELL、GLUE_PYTHON、GLUE_NODEJS、GLUE_POWERSHELL、GLUE_PHP
|
||||||
|
private String glueSource;
|
||||||
|
private String glueRemark;
|
||||||
|
|
||||||
|
public JobAddRequest() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getJobGroup() {
|
||||||
|
return jobGroup;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setJobGroup(int jobGroup) {
|
||||||
|
this.jobGroup = jobGroup;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getJobDesc() {
|
||||||
|
return jobDesc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setJobDesc(String jobDesc) {
|
||||||
|
this.jobDesc = jobDesc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAuthor() {
|
||||||
|
return author;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAuthor(String author) {
|
||||||
|
this.author = author;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAlarmEmail() {
|
||||||
|
return alarmEmail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAlarmEmail(String alarmEmail) {
|
||||||
|
this.alarmEmail = alarmEmail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getScheduleType() {
|
||||||
|
return scheduleType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setScheduleType(String scheduleType) {
|
||||||
|
this.scheduleType = scheduleType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getScheduleConf() {
|
||||||
|
return scheduleConf;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setScheduleConf(String scheduleConf) {
|
||||||
|
this.scheduleConf = scheduleConf;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMisfireStrategy() {
|
||||||
|
return misfireStrategy;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMisfireStrategy(String misfireStrategy) {
|
||||||
|
this.misfireStrategy = misfireStrategy;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getExecutorRouteStrategy() {
|
||||||
|
return executorRouteStrategy;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExecutorRouteStrategy(String executorRouteStrategy) {
|
||||||
|
this.executorRouteStrategy = executorRouteStrategy;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getExecutorHandler() {
|
||||||
|
return executorHandler;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExecutorHandler(String executorHandler) {
|
||||||
|
this.executorHandler = executorHandler;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getExecutorParam() {
|
||||||
|
return executorParam;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExecutorParam(String executorParam) {
|
||||||
|
this.executorParam = executorParam;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getExecutorBlockStrategy() {
|
||||||
|
return executorBlockStrategy;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExecutorBlockStrategy(String executorBlockStrategy) {
|
||||||
|
this.executorBlockStrategy = executorBlockStrategy;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getExecutorTimeout() {
|
||||||
|
return executorTimeout;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExecutorTimeout(int executorTimeout) {
|
||||||
|
this.executorTimeout = executorTimeout;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getExecutorFailRetryCount() {
|
||||||
|
return executorFailRetryCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExecutorFailRetryCount(int executorFailRetryCount) {
|
||||||
|
this.executorFailRetryCount = executorFailRetryCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getGlueType() {
|
||||||
|
return glueType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGlueType(String glueType) {
|
||||||
|
this.glueType = glueType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getGlueSource() {
|
||||||
|
return glueSource;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGlueSource(String glueSource) {
|
||||||
|
this.glueSource = glueSource;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getGlueRemark() {
|
||||||
|
return glueRemark;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGlueRemark(String glueRemark) {
|
||||||
|
this.glueRemark = glueRemark;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,24 @@
|
|||||||
|
package com.xxl.job.core.openapi.admin.dto;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* request DTO for job operation (remove / start / stop) by id
|
||||||
|
*/
|
||||||
|
public class JobOperateRequest implements Serializable {
|
||||||
|
private static final long serialVersionUID = 42L;
|
||||||
|
|
||||||
|
private int id;
|
||||||
|
|
||||||
|
public JobOperateRequest() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(int id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,42 @@
|
|||||||
|
package com.xxl.job.core.openapi.admin.dto;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* request DTO for manually triggering a job once
|
||||||
|
*/
|
||||||
|
public class JobTriggerRequest implements Serializable {
|
||||||
|
private static final long serialVersionUID = 42L;
|
||||||
|
|
||||||
|
private int id;
|
||||||
|
private String executorParam;
|
||||||
|
private String addressList;
|
||||||
|
|
||||||
|
public JobTriggerRequest() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(int id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getExecutorParam() {
|
||||||
|
return executorParam;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExecutorParam(String executorParam) {
|
||||||
|
this.executorParam = executorParam;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAddressList() {
|
||||||
|
return addressList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAddressList(String addressList) {
|
||||||
|
this.addressList = addressList;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,163 @@
|
|||||||
|
package com.xxl.job.core.openapi.admin.dto;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* request DTO for updating an existing job
|
||||||
|
*/
|
||||||
|
public class JobUpdateRequest implements Serializable {
|
||||||
|
private static final long serialVersionUID = 42L;
|
||||||
|
|
||||||
|
private int id;
|
||||||
|
private String jobDesc;
|
||||||
|
|
||||||
|
private String author;
|
||||||
|
private String alarmEmail;
|
||||||
|
|
||||||
|
private String scheduleType;
|
||||||
|
private String scheduleConf;
|
||||||
|
private String misfireStrategy;
|
||||||
|
|
||||||
|
private String executorRouteStrategy;
|
||||||
|
private String executorHandler;
|
||||||
|
private String executorParam;
|
||||||
|
private String executorBlockStrategy;
|
||||||
|
private int executorTimeout;
|
||||||
|
private int executorFailRetryCount;
|
||||||
|
|
||||||
|
private String glueType;
|
||||||
|
private String glueSource;
|
||||||
|
private String glueRemark;
|
||||||
|
|
||||||
|
public JobUpdateRequest() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(int id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getJobDesc() {
|
||||||
|
return jobDesc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setJobDesc(String jobDesc) {
|
||||||
|
this.jobDesc = jobDesc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAuthor() {
|
||||||
|
return author;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAuthor(String author) {
|
||||||
|
this.author = author;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAlarmEmail() {
|
||||||
|
return alarmEmail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAlarmEmail(String alarmEmail) {
|
||||||
|
this.alarmEmail = alarmEmail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getScheduleType() {
|
||||||
|
return scheduleType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setScheduleType(String scheduleType) {
|
||||||
|
this.scheduleType = scheduleType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getScheduleConf() {
|
||||||
|
return scheduleConf;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setScheduleConf(String scheduleConf) {
|
||||||
|
this.scheduleConf = scheduleConf;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMisfireStrategy() {
|
||||||
|
return misfireStrategy;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMisfireStrategy(String misfireStrategy) {
|
||||||
|
this.misfireStrategy = misfireStrategy;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getExecutorRouteStrategy() {
|
||||||
|
return executorRouteStrategy;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExecutorRouteStrategy(String executorRouteStrategy) {
|
||||||
|
this.executorRouteStrategy = executorRouteStrategy;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getExecutorHandler() {
|
||||||
|
return executorHandler;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExecutorHandler(String executorHandler) {
|
||||||
|
this.executorHandler = executorHandler;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getExecutorParam() {
|
||||||
|
return executorParam;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExecutorParam(String executorParam) {
|
||||||
|
this.executorParam = executorParam;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getExecutorBlockStrategy() {
|
||||||
|
return executorBlockStrategy;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExecutorBlockStrategy(String executorBlockStrategy) {
|
||||||
|
this.executorBlockStrategy = executorBlockStrategy;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getExecutorTimeout() {
|
||||||
|
return executorTimeout;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExecutorTimeout(int executorTimeout) {
|
||||||
|
this.executorTimeout = executorTimeout;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getExecutorFailRetryCount() {
|
||||||
|
return executorFailRetryCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExecutorFailRetryCount(int executorFailRetryCount) {
|
||||||
|
this.executorFailRetryCount = executorFailRetryCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getGlueType() {
|
||||||
|
return glueType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGlueType(String glueType) {
|
||||||
|
this.glueType = glueType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getGlueSource() {
|
||||||
|
return glueSource;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGlueSource(String glueSource) {
|
||||||
|
this.glueSource = glueSource;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getGlueRemark() {
|
||||||
|
return glueRemark;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGlueRemark(String glueRemark) {
|
||||||
|
this.glueRemark = glueRemark;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Reference in new issue