修改任务
由于snail-job支持五种任务类型,并且五种任务类型的配置有些区别,所以这次openapi和新增一样提供了以下五种对应的修改方法。与新增不同的时,更新必须要传入具体任务的ID,需要修改什么参数就更新对应参数即可。
java
com.aizuda.snailjob.client.job.core.openapi.SnailJobOpenApi
/**
* 更新广播定时任务
*
* @param jobId 定时任务ID
* @return {@link BroadcastUpdateHandler}
*/
public static BroadcastUpdateHandler updateBroadcastJob(Long jobId) {
return new BroadcastUpdateHandler(jobId);
}
/**
* 更新集群定时任务
*
* @param jobId 定时任务ID
* @return {@link ClusterUpdateHandler}
*/
public static ClusterUpdateHandler updateClusterJob(Long jobId) {
return new ClusterUpdateHandler(jobId);
}
/**
* 更新MapReduce定时任务
*
* @param jobId 定时任务ID
* @return {@link MapReduceUpdateHandler}
*/
public static MapReduceUpdateHandler updateMapReduceJob(Long jobId) {
return new MapReduceUpdateHandler(jobId);
}
/**
* 更新Map定时任务
*
* @param jobId 定时任务ID
* @return {@link MapUpdateHandler}
*/
public static MapUpdateHandler updateMapJob(Long jobId) {
return new MapUpdateHandler(jobId);
}
/**
* 更新静态分片定时任务
*
* @param jobId 定时任务ID
* @return {@link ShardingUpdateHandler}
*/
public static ShardingUpdateHandler updateShardingJob(Long jobId) {
return new ShardingUpdateHandler(jobId);
}