Java Code Examples for org.quartz.Trigger.TriggerState#ordinal()

The following examples show how to use org.quartz.Trigger.TriggerState#ordinal() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: QuartzUtils.java    From quartz-web with Apache License 2.0 6 votes vote down vote up
/**
 * 将TriggerState英文翻译成中文
 * @param triggerState
 * @return
 */
public static String triggerStateEN2CN(TriggerState triggerState){
    if (TriggerState.NORMAL.ordinal() == triggerState.ordinal()) {
        return "正常";
    } else if (TriggerState.PAUSED.ordinal() == triggerState.ordinal()) {
        return "暂停";
    } else if (TriggerState.COMPLETE.ordinal() == triggerState.ordinal()) {
        return "完成";
    } else if (TriggerState.ERROR.ordinal() == triggerState.ordinal()) {
        return "错误";
    } else if (TriggerState.BLOCKED.ordinal() == triggerState.ordinal()) {
        return "阻塞";
    } else {
        return "无";
    }
}
 
Example 2
Source File: QuartzUtils.java    From quartz-web with Apache License 2.0 2 votes vote down vote up
/**
 * 对比两个Trigger是否相等
 * @param trigger
 * @param triggerState
 * @param scheduler
 * @return
 * @throws SchedulerException
 */
public static boolean triggerStateEquals(Trigger trigger, TriggerState triggerState, Scheduler scheduler)
        throws SchedulerException {
    TriggerState sourceTriggerState = scheduler.getTriggerState(trigger.getKey());
    return sourceTriggerState.ordinal() == triggerState.ordinal();
}