Package org.dspace.checker
Class ChecksumHistoryServiceImpl
- java.lang.Object
-
- org.dspace.checker.ChecksumHistoryServiceImpl
-
- All Implemented Interfaces:
ChecksumHistoryService
public class ChecksumHistoryServiceImpl extends Object implements ChecksumHistoryService
Service implementation for the ChecksumHistory object. This class is responsible for all business logic calls for the ChecksumHistory object and is autowired by spring. This class should never be accessed directly.- Author:
- kevinvandevelde at atmire.com
-
-
Field Summary
Fields Modifier and Type Field Description protected ChecksumHistoryDAOchecksumHistoryDAOprotected ChecksumResultServicechecksumResultServiceprotected MostRecentChecksumServicemostRecentChecksumService
-
Constructor Summary
Constructors Modifier Constructor Description protectedChecksumHistoryServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddHistory(Context context, MostRecentChecksum mostRecentChecksum)voiddeleteByBitstream(Context context, Bitstream bitstream)intdeleteByDateAndCode(Context context, Date retentionDate, ChecksumResultCode checksumResultCode)Delete the history records from the database.intprune(Context context, Map<ChecksumResultCode,Long> interests)Prune the history records from the database.voidupdateMissingBitstreams(Context context)
-
-
-
Field Detail
-
checksumHistoryDAO
@Autowired(required=true) protected ChecksumHistoryDAO checksumHistoryDAO
-
mostRecentChecksumService
@Autowired(required=true) protected MostRecentChecksumService mostRecentChecksumService
-
checksumResultService
@Autowired(required=true) protected ChecksumResultService checksumResultService
-
-
Method Detail
-
updateMissingBitstreams
public void updateMissingBitstreams(Context context) throws SQLException
- Specified by:
updateMissingBitstreamsin interfaceChecksumHistoryService- Throws:
SQLException
-
addHistory
public void addHistory(Context context, MostRecentChecksum mostRecentChecksum) throws SQLException
- Specified by:
addHistoryin interfaceChecksumHistoryService- Throws:
SQLException
-
deleteByDateAndCode
public int deleteByDateAndCode(Context context, Date retentionDate, ChecksumResultCode checksumResultCode) throws SQLException
Delete the history records from the database.- Specified by:
deleteByDateAndCodein interfaceChecksumHistoryService- Parameters:
context- ContextretentionDate- any records older than this data are deleted.checksumResultCode- result code records must have for them to be deleted.- Returns:
- number of records deleted.
- Throws:
SQLException- if database error occurs.
-
deleteByBitstream
public void deleteByBitstream(Context context, Bitstream bitstream) throws SQLException
- Specified by:
deleteByBitstreamin interfaceChecksumHistoryService- Throws:
SQLException
-
prune
public int prune(Context context, Map<ChecksumResultCode,Long> interests) throws SQLException
Description copied from interface:ChecksumHistoryServicePrune the history records from the database.- Specified by:
prunein interfaceChecksumHistoryService- Parameters:
context- contextinterests- set of results and the duration of time before they are removed from the database- Returns:
- number of bitstreams deleted
- Throws:
SQLException- if database error
-
-