package com.capgemini.reports.definition.r15r16r17reports.r15r17reports.r17report;

import com.capgemini.framework.teamcenter.authent.TcSession;
import com.capgemini.framework.teamcenter.exceptions.KurtException;
import com.capgemini.reports.definition.r15r16r17reports.r15r17reports.AbstractR15R17Printer;
import com.capgemini.reports.execution.mapconstructor.IMapConstructor;
import com.capgemini.reports.printing.PrintParameters;
import lombok.EqualsAndHashCode;
import lombok.extern.slf4j.Slf4j;

/**
 * This class is able to put the data gathered by an {@link ExecutionR17} into some {@link PrintParameters} for printing.
 */
@Slf4j
@EqualsAndHashCode(callSuper = true)
public final class R17Printer extends AbstractR15R17Printer<ExecutionR17> implements IMapConstructor<ExecutionR17, ExecutionR17> {

    private static final long serialVersionUID = -5917435254556072157L;

    @Override
    protected void addSpecificParameters(final ExecutionR17 execution, final PrintParameters mainReport) {
        // Nothing to add, all the job is performed by the AbstractR15R17Printer
    }

    @Override
    protected String getTitle(final ExecutionR17 execution) {
        return "Définition technique de l'article et Définition de réalisation de l'article\nPart Definition and Part Manufacturing Definition";
    }

    @Override
    public void constructDataMaps(TcSession session, final PrintParameters printParameters, final ExecutionR17 report) throws KurtException {
        long start = System.currentTimeMillis();
        this.print(report, printParameters);
        log.trace(EXECUTION_TIME_XXX_MS_FOR_YYY, System.currentTimeMillis() - start, "data filtering");
    }
}
