package com.capgemini.reports.execution.actions;

import com.capgemini.reports.database.javabean.DbUser;
import com.capgemini.reports.exceptions.InvalidInputException;
import com.capgemini.reports.exceptions.NoConfChangesException;
import com.capgemini.reports.execution.AbstractExecutionReport;

import java.io.Serializable;
import java.util.List;

/** Interface for ations to be taken in case of functional/technical error encountered during a report execution. */
public interface IErrorExecutionStep extends Serializable {

    /**
     * Action to be performed in case of Technical error. <br>
     * <b>Note</B> these actions may never fail, please do catch and handle any exception.
     * 
     * @param report the report whose execution failed
     * @param owners the owners of the failed report
     */
    void performTechnicalErrorAction(AbstractExecutionReport<?, ?> report, List<DbUser> owners, Throwable theOriginalException);

    /**
     * Action to be performed in case of Functional error. <br>
     * <b>Note</B> these actions may never fail, please do catch and handle any exception.
     *
     * @param report               the report whose execution failed
     * @param owners               the owners of the failed report
     * @param theOriginalException the exception that cause mayhem
     */
    void performFunctionalErrorAction(AbstractExecutionReport<?, ?> report, List<DbUser> owners, NoConfChangesException theOriginalException);

    /**
     * Action to be performed in case of Functional error. <br>
     * <b>Note</B> these actions may never fail, please do catch and handle any exception.
     *  @param report the report whose execution failed
     * @param owners the owners of the failed report
     * @param theOriginalException the exception that cause mayhem
     */
    void performFunctionalErrorAction(AbstractExecutionReport<?, ?> report, List<DbUser> owners, InvalidInputException theOriginalException);
}
