// Path: src/main/java/com/yiji/falcon/agent/common/SchedulerFactory.java
// public class SchedulerFactory {
// 
//     /**
//      * 获取调度器
//      * @return
//      * @throws SchedulerException
//      * 调度器获取失败异常
//      */
//     public static Scheduler getScheduler() throws SchedulerException {
//         org.quartz.SchedulerFactory sf = new StdSchedulerFactory(AgentConfiguration.INSTANCE.getQuartzConfPath());
//         return sf.getScheduler();
//     }
// 
// }
// 
// Path: src/main/java/com/yiji/falcon/agent/vo/sceduler/ScheduleJobResult.java
// @Data
// public class ScheduleJobResult implements Serializable {
// 
//     private TriggerKey triggerKey;
//     private JobKey jobKey;
//     private JobDetail jobDetail;
//     private Trigger trigger;
//     private ScheduleJobStatus scheduleJobStatus;
// 
// }
// 
// Path: src/main/java/com/yiji/falcon/agent/vo/sceduler/ScheduleJobStatus.java
// public enum ScheduleJobStatus {
// 
//     /**
//      * 任务创建成功
//      */
//     SUCCESS,
//     /**
//      * 已存在相同的任务(key)
//      */
//     ISEXIST,
//     /**
//      * 传入的对象条不满足任务的创建条件
//      */
//     DISCONTENT,
//     /**
//      * 创建任务失败
//      */
//     FAILED;
// 
// }


import com.yiji.falcon.agent.common.SchedulerFactory;
import com.yiji.falcon.agent.vo.sceduler.ScheduleJobResult;
import com.yiji.falcon.agent.vo.sceduler.ScheduleJobStatus;
import lombok.extern.slf4j.Slf4j;
import org.quartz.JobDetail;
import org.quartz.Scheduler;
import org.quartz.SchedulerException;
import org.quartz.Trigger;
/*
 * www.yiji.com Inc.
 * Copyright (c) 2016 All Rights Reserved
 */
package com.yiji.falcon.agent.util;


/*
 * 修订记录:
 * guqiu@yiji.com 2016-06-22 17:48 创建
 */

/**
 * 计划任务辅助工具类
 * @author guqiu@yiji.com
 */
@Slf4j
public class SchedulerUtil {

    /**
     * 执行计划任务
     * @param job
     * @param trigger
     * @return
     * @throws SchedulerException
     */
// Path: src/main/java/com/yiji/falcon/agent/common/SchedulerFactory.java
// public class SchedulerFactory {
// 
//     /**
//      * 获取调度器
//      * @return
//      * @throws SchedulerException
//      * 调度器获取失败异常
//      */
//     public static Scheduler getScheduler() throws SchedulerException {
//         org.quartz.SchedulerFactory sf = new StdSchedulerFactory(AgentConfiguration.INSTANCE.getQuartzConfPath());
//         return sf.getScheduler();
//     }
// 
// }
// 
// Path: src/main/java/com/yiji/falcon/agent/vo/sceduler/ScheduleJobResult.java
// @Data
// public class ScheduleJobResult implements Serializable {
// 
//     private TriggerKey triggerKey;
//     private JobKey jobKey;
//     private JobDetail jobDetail;
//     private Trigger trigger;
//     private ScheduleJobStatus scheduleJobStatus;
// 
// }
// 
// Path: src/main/java/com/yiji/falcon/agent/vo/sceduler/ScheduleJobStatus.java
// public enum ScheduleJobStatus {
// 
//     /**
//      * 任务创建成功
//      */
//     SUCCESS,
//     /**
//      * 已存在相同的任务(key)
//      */
//     ISEXIST,
//     /**
//      * 传入的对象条不满足任务的创建条件
//      */
//     DISCONTENT,
//     /**
//      * 创建任务失败
//      */
//     FAILED;
// 
// }


// Path: src/main/java/com/yiji/falcon/agent/util/SchedulerUtil.java
import com.yiji.falcon.agent.common.SchedulerFactory;
import com.yiji.falcon.agent.vo.sceduler.ScheduleJobResult;
import com.yiji.falcon.agent.vo.sceduler.ScheduleJobStatus;
import lombok.extern.slf4j.Slf4j;
import org.quartz.JobDetail;
import org.quartz.Scheduler;
import org.quartz.SchedulerException;
import org.quartz.Trigger;

/*
 * www.yiji.com Inc.
 * Copyright (c) 2016 All Rights Reserved
 */
package com.yiji.falcon.agent.util;


/*
 * 修订记录:
 * guqiu@yiji.com 2016-06-22 17:48 创建
 */

/**
 * 计划任务辅助工具类
 * @author guqiu@yiji.com
 */
@Slf4j
public class SchedulerUtil {

    /**
     * 执行计划任务
     * @param job
     * @param trigger
     * @return
     * @throws SchedulerException
     */
    public static ScheduleJobResult executeScheduleJob(JobDetail job, Trigger trigger) throws SchedulerException {