package org.slc.sli.ingestion.landingzone;

import java.io.File;
import java.io.Serializable;

import org.slc.sli.ingestion.FaultsReport;
import org.slc.sli.ingestion.FileFormat;
import org.slc.sli.ingestion.FileType;
import org.slc.sli.ingestion.validation.ErrorReport;
import org.slc.sli.ingestion.validation.ErrorReportSupport;

/**
 * Represents an Ingestion File Entry which includes the file to ingest along with its
 * metainformation.
 *
 */
public class IngestionFileEntry implements Serializable, ErrorReportSupport {

    private static final long serialVersionUID = 8326156381009199389L;

    // Attributes
    private FileFormat fileFormat;
    private FileType fileType;
    private String fileName;
    private File file;
    private File neutralRecordFile;
    private File deltaNeutralRecordFile;
    private String checksum;
    private FaultsReport faultsReport;

    // Constructors
    public IngestionFileEntry(FileFormat fileFormat, FileType fileType, String fileName, String checksum) {
        this.fileFormat = fileFormat;
        this.fileType = fileType;
        this.fileName = fileName;
        this.checksum = checksum;
        this.faultsReport = new FaultsReport();
    }

    // Methods

    /**
     * Set the Ingestion file format.
     *
     * @param fileFormat
     *            to set
     */
    public void setFileFormat(FileFormat fileFormat) {
        this.fileFormat = fileFormat;
    }

    /**
     * Get the Ingestion file format.
     *
     * @return fileFormat to obtain
     */
    public FileFormat getFileFormat() {
        return this.fileFormat;
    }

    /**
     * Set the Ingestion file type.
     *
     * @param fileType
     *            to set
     */
    public void setFileType(FileType fileType) {
        this.fileType = fileType;
    }

    /**
     * Get the Ingestion file type.
     *
     * @return fileType to obtain
     */
    public FileType getFileType() {
        return this.fileType;
    }

    /**
     * Set the Ingestion file name.
     *
     * @param fileName
     *            to set
     */
    public void setFileName(String fileName) {
        this.fileName = fileName;
    }

    /**
     * Get the Ingestion file name.
     *
     * @return fileName to obtain
     */
    public String getFileName() {
        return this.fileName;
    }

    /**
     * Set the Ingestion file.
     *
     * @param file
     *            to set
     */
    public void setFile(File file) {
        this.file = file;
    }

    /**
     * Get the Ingestion file.
     *
     * @return file to obtain
     */
    public File getFile() {
        return this.file;
    }

    /**
     * Set the Ingestion file checksum.
     *
     * @param checksum
     *            to set
     */
    public void setChecksum(String checksum) {
        this.checksum = checksum;
    }

    /**
     * Get the Ingestion file checksum.
     *
     * @return checksum to obtain
     */
    public String getChecksum() {
        return this.checksum;
    }

    public File getNeutralRecordFile() {
        return neutralRecordFile;
    }

    public void setNeutralRecordFile(File neutralRecordFile) {
        this.neutralRecordFile = neutralRecordFile;
    }

    public File getDeltaNeutralRecordFile() {
        return deltaNeutralRecordFile;
    }

    public void setDeltaNeutralRecordFile(File deltaNeutralRecordFile) {
        this.deltaNeutralRecordFile = deltaNeutralRecordFile;
    }

    public FaultsReport getFaultsReport() {
        return this.faultsReport;
    }

    @Override
    public ErrorReport getErrorReport() {
        return getFaultsReport();
    }

}

@@ -876,16 +876,105 @@
 eport;%0A%0A
+    // will only be set when this is added to a BatchJob%0A    private String batchJobId;%0A%0A
     // C
@@ -3713,10 +3713,176 @@
 %0A    %7D%0A%0A
+    public String getBatchJobId() %7B%0A        return batchJobId;%0A    %7D%0A%0A    public void setBatchJobId(String batchJobId) %7B%0A        this.batchJobId = batchJobId;%0A    %7D%0A%0A
 %7D%0A

add batchJobId to IngestionFileEntry (to be set when added to a batch job)