package cc.smtweb.framework.core.mvc.controller.access;

import cc.smtweb.framework.core.annotation.SwScheduling;
import com.serotonin.timer.CronTimerTrigger;
import com.serotonin.timer.TimerTrigger;
import lombok.Getter;

import java.text.ParseException;

@Getter
public class SchedulerMethodAccess {
    private final MethodAccess methodAccess;
    private final SwScheduling swScheduling;
    private final TimerTrigger timerTrigger;

    public SchedulerMethodAccess(MethodAccess methodAccess, SwScheduling swScheduling) throws ParseException {
        this.timerTrigger = new CronTimerTrigger(swScheduling.value());
        this.methodAccess = methodAccess;
        this.swScheduling = swScheduling;
    }
}
