org.dspace.checker
Class ChecksumHistoryDAO

java.lang.Object
  extended by org.dspace.checker.DAOSupport
      extended by org.dspace.checker.ChecksumHistoryDAO

public class ChecksumHistoryDAO
extends DAOSupport

This is the data access for the checksum history information. All update,insert and delete database operations should go through this class for checksum history operations.

Author:
Jim Downing, Grace Carpenter, Nathan Sarr

Constructor Summary
ChecksumHistoryDAO()
           
 
Method Summary
protected  int deleteHistoryByDateAndCode(Date retentionDate, String result, Connection conn)
          Delete the history records from the database.
protected  int deleteHistoryForBitstreamInfo(int id, Connection conn)
          Deletes the bitstream from the bitstream_history table if it exist.
 void insertHistory(BitstreamInfo info)
          Inserts results of checksum check into checksum_history table for a given bitstream.
 int prune(Map interests)
          Prune the history records from the database.
protected  void updateMissingBitstreams(Connection conn)
           
 
Methods inherited from class org.dspace.checker.DAOSupport
cleanup, cleanup, cleanup, cleanup
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChecksumHistoryDAO

public ChecksumHistoryDAO()
Method Detail

insertHistory

public void insertHistory(BitstreamInfo info)
Inserts results of checksum check into checksum_history table for a given bitstream.

Parameters:
info - the BitstreamInfo representing a checksum check.
Throws:
IllegalArgumentException - if the BitstreamInfo is null.

deleteHistoryForBitstreamInfo

protected int deleteHistoryForBitstreamInfo(int id,
                                            Connection conn)
Deletes the bitstream from the bitstream_history table if it exist.

Parameters:
id - the bitstream id.
Returns:
number of records deleted

updateMissingBitstreams

protected void updateMissingBitstreams(Connection conn)
                                throws SQLException
Parameters:
conn -
Throws:
SQLException

deleteHistoryByDateAndCode

protected int deleteHistoryByDateAndCode(Date retentionDate,
                                         String result,
                                         Connection conn)
                                  throws SQLException
Delete the history records from the database.

Parameters:
retentionDate - any records older than this data are deleted.
result - result code records must have for them to be deleted.
conn - database connection.
Returns:
number of records deleted.
Throws:
SQLException - if database error occurs.

prune

public int prune(Map interests)
Prune the history records from the database.

Parameters:
interests - set of results and the duration of time before they are removed from the database
Returns:
number of bitstreams deleted


Copyright © 2010 DuraSpace. All Rights Reserved.