package com.capgemini.reports.execution.actions;

import com.capgemini.framework.teamcenter.authent.TcSession;
import com.capgemini.reports.database.javabean.DbReport;
import com.capgemini.reports.database.javabean.DbUser;
import com.capgemini.reports.exceptions.InvalidDatasetException;
import com.capgemini.reports.exceptions.InvalidInputException;
import com.capgemini.reports.exceptions.NoConfChangesException;
import com.capgemini.reports.exceptions.NotFoundException;
import com.capgemini.reports.execution.AbstractExecutionReport;
import lombok.EqualsAndHashCode;

import java.util.List;

/**
 * This action does nothing. Useful if an action Object is <i>required</i> by an API, but nothing <i>needs</i> to be done.<br>
 * Can be used as a {@link IPreExecutionStep}, a {@link IPostExecutionStep}, and/or a {@link IErrorExecutionStep}.
 */
@EqualsAndHashCode
public class DoNothingAction implements IPreExecutionStep, IPostExecutionStep, IErrorExecutionStep {
    private static final long serialVersionUID = 8222229264738863306L;

    @Override
    public <T extends AbstractExecutionReport<T, ?>> void performPreAction(T abstractExecutionReport, DbReport dbReport, TcSession session) {
        // Let's happily do nothing at all, here. Yay!
    }

    @Override
    public <T extends AbstractExecutionReport<T, ?>> void performPostAction(TcSession session, T report, DbReport theExecutingReport,
                                                                            String fileNameWithExtension) throws NotFoundException, InvalidDatasetException {
        // Let's happily do nothing at all, here. Yay!
    }

    @Override
    public void performTechnicalErrorAction(AbstractExecutionReport<?, ?> report, List<DbUser> owners, Throwable theOrginalException) {
        // Let's happily do nothing at all, here. Yay!
    }

  @Override
  public void performFunctionalErrorAction(AbstractExecutionReport<?, ?> report, List<DbUser> owners, NoConfChangesException theOriginalException) {
    // Let's happily do nothing at all, here. Yay!
  }

    @Override
    public void performFunctionalErrorAction(AbstractExecutionReport<?, ?> report, List<DbUser> owners, InvalidInputException theOriginalException) {
        // Let's happily do nothing at all, here. Yay!
    }
}
