/*
 * Copyright 2009 Lari Natri <lari.natri@gmail.com>
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 * 
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 * 
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package compid.data;

import compid.data.tuples.DatasetInfo;
import compid.data.tuples.Protein;
import java.util.Collection;

/**
 *
 * @author Lari Natri
 */
public interface UpdateHandler {


    public void addFullDataset(FullDataset ds) throws DAOException;

    /**
     * Updates proteins' sequence references to table PROTSEQ. Adds needed
     * sequences, but does not add proteins if they don't exist in database
     * already
     * @param prots Proteins to be updated. Each Protein must hold a pointer to
     *              ProtSeqs
     * @return amount of updated proteins
     * @throws compid.data.DAOException
     */
    public int updateSequenceRefs(Collection<Protein> prots)
            throws DAOException;

    public int deleteDatasets(Collection<DatasetInfo> dataSetInfos)
            throws DAOException;

    /**
     * Updates PROTEIN.PROTSEQ_ID, if its ACCESSION is as given
     * @param accession accession to search
     * @param id the new PROTSEQ_ID
     * @return true if an update was made, false otherwise
     * @throws DAOException
     */
    public boolean updateProteinsSeqId(String accession, int id)
            throws DAOException;

}
