// Path: scheduled-actions-core/src/main/java/com/netflix/scheduledactions/exceptions/ActionInstanceNotFoundException.java
// public class ActionInstanceNotFoundException extends Exception {
// 
//     public ActionInstanceNotFoundException(String message) {
//         super(message);
//     }
// 
//     public ActionInstanceNotFoundException(String message, Throwable throwable) {
//         super(message, throwable);
//     }
// }
// 
// Path: scheduled-actions-core/src/main/java/com/netflix/scheduledactions/persistence/ExecutionDao.java
// public interface ExecutionDao {
// 
//     public String createExecution(String actionInstanceId, Execution execution);
//     public void updateExecution(Execution execution);
//     public Execution getExecution(String executionId);
//     public void deleteExecution(String actionInstanceId, Execution execution);
//     public List<Execution> getExecutions(String actionInstanceId, int count);
//     public List<Execution> getExecutions(String actionInstanceId);
// 
// }


import com.netflix.fenzo.triggers.TriggerOperator;
import com.netflix.fenzo.triggers.exceptions.SchedulerException;
import com.netflix.scheduledactions.exceptions.ActionInstanceNotFoundException;
import com.netflix.scheduledactions.exceptions.ExecutionNotFoundException;
import com.netflix.scheduledactions.executors.LocalThreadPoolBlockingExecutor;
import com.netflix.scheduledactions.persistence.ActionInstanceDao;
import com.netflix.scheduledactions.persistence.ExecutionDao;
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import java.util.Collections;
import java.util.List;
import java.util.UUID;
import java.util.concurrent.atomic.AtomicBoolean;
    }

    /**
     * Returns a list of {@code Execution}s for a given actionInstance
     */
    public List<Execution> getExecutions(String actionInstanceId) {
        List<Execution> executions = executionDao.getExecutions(actionInstanceId);
        if (executions != null) {
            Collections.sort(executions);
        }
        return executions;
    }

    public Execution getExecution(String executionId) {
        return executionDao.getExecution(executionId);
    }

    /**
     * Registers a {@code ActionInstance} with actionInstance service
     */
    public String registerActionInstance(ActionInstance actionInstance) {
        checkInitialized();
        return actionOperationsDelegate.register(actionInstance);
    }

    /**
     * Disables the {@code ActionInstance}. If the {@code ActionInstance} is disabled it will NOT execute
     * @throws ActionInstanceNotFoundException
     * @throws com.netflix.scheduledactions.exceptions.ActionOperationException
     */
// Path: scheduled-actions-core/src/main/java/com/netflix/scheduledactions/exceptions/ActionInstanceNotFoundException.java
// public class ActionInstanceNotFoundException extends Exception {
// 
//     public ActionInstanceNotFoundException(String message) {
//         super(message);
//     }
// 
//     public ActionInstanceNotFoundException(String message, Throwable throwable) {
//         super(message, throwable);
//     }
// }
// 
// Path: scheduled-actions-core/src/main/java/com/netflix/scheduledactions/persistence/ExecutionDao.java
// public interface ExecutionDao {
// 
//     public String createExecution(String actionInstanceId, Execution execution);
//     public void updateExecution(Execution execution);
//     public Execution getExecution(String executionId);
//     public void deleteExecution(String actionInstanceId, Execution execution);
//     public List<Execution> getExecutions(String actionInstanceId, int count);
//     public List<Execution> getExecutions(String actionInstanceId);
// 
// }


// Path: scheduled-actions-core/src/main/java/com/netflix/scheduledactions/ActionsOperator.java
import com.netflix.fenzo.triggers.TriggerOperator;
import com.netflix.fenzo.triggers.exceptions.SchedulerException;
import com.netflix.scheduledactions.exceptions.ActionInstanceNotFoundException;
import com.netflix.scheduledactions.exceptions.ExecutionNotFoundException;
import com.netflix.scheduledactions.executors.LocalThreadPoolBlockingExecutor;
import com.netflix.scheduledactions.persistence.ActionInstanceDao;
import com.netflix.scheduledactions.persistence.ExecutionDao;
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import java.util.Collections;
import java.util.List;
import java.util.UUID;
import java.util.concurrent.atomic.AtomicBoolean;

    }

    /**
     * Returns a list of {@code Execution}s for a given actionInstance
     */
    public List<Execution> getExecutions(String actionInstanceId) {
        List<Execution> executions = executionDao.getExecutions(actionInstanceId);
        if (executions != null) {
            Collections.sort(executions);
        }
        return executions;
    }

    public Execution getExecution(String executionId) {
        return executionDao.getExecution(executionId);
    }

    /**
     * Registers a {@code ActionInstance} with actionInstance service
     */
    public String registerActionInstance(ActionInstance actionInstance) {
        checkInitialized();
        return actionOperationsDelegate.register(actionInstance);
    }

    /**
     * Disables the {@code ActionInstance}. If the {@code ActionInstance} is disabled it will NOT execute
     * @throws ActionInstanceNotFoundException
     * @throws com.netflix.scheduledactions.exceptions.ActionOperationException
     */
    public ActionInstance disableActionInstance(String actionInstanceId) throws ActionInstanceNotFoundException {