package com.leanwo.activiti.service.base;

import org.quartz.SchedulerException;

import com.leanwo.activiti.dto.BaseResponse;
import com.leanwo.activiti.dto.base.TaskDefineDto;

/**
 * 任务调度框架 引擎
 * 
 * @author YangZhiJie 20190329
 *
 */
public interface QuartzEngine {
	public static final String AccountId = "AccountId";
	public static final String TaskDefineDto = "taskDefineDto";
	public static final String ProcessReportTiggerGroup = "ProcessReportTiggerGroup";
	public static final String ProcessReportJobGroup = "ProcessReportJobGroup";
	public static final String HttpTask = "HttpTask";
	public static final String HttpTaskTiggerGroup = "HttpTaskTiggerGroup";
	public static final String HttpTaskJobGroup = "HttpTaskJobGroup";

	/**
	 * 启动调度引擎
	 * 
	 * @throws SchedulerException
	 * @author YangZhiJie 20190329
	 */
	public void start() throws SchedulerException;

	/**
	 * 关闭调度引擎
	 * 
	 * @throws SchedulerException
	 * @author YangZhiJie 20190329
	 */
	public void stop() throws SchedulerException;

	/**
	 * 增加流程报表定时执行任务
	 * 
	 * @param accountId
	 *            账套id
	 * @param processReportExecutorDto
	 *            流程报表定时执行定义
	 * @throws SchedulerException
	 */
	public void addProcessJob(Long accountId, TaskDefineDto taskDefineDto) throws SchedulerException;

	/**
	 * 删除流程报表定时执行任务
	 * 
	 * @param accountId
	 *            账套id
	 * @param processReportExecutorDto
	 *            流程报表定时执行定义
	 * @throws SchedulerException
	 */
	public void deleteProcessJob(Long accountId, TaskDefineDto taskDefineDto) throws SchedulerException;

	/**
	 * 增加HTTP定时任务
	 * 
	 * @param accountId
	 *            账套id
	 * @param httpTask
	 *            Http任务
	 * @throws SchedulerException
	 */
	public void addHttpJob(Long accountId, TaskDefineDto taskDefineDto) throws SchedulerException;

	/**
	 * 删除HTTP定时执行任务
	 * 
	 * @param accountId
	 *            账套id
	 * @param processReportExecutorDto
	 *            流程报表定时执行定义
	 * @throws SchedulerException
	 */
	public void deleteHttpJob(Long accountId, TaskDefineDto taskDefineDto) throws SchedulerException;

}
