Package org.dspace.checker
Class MostRecentChecksumServiceImpl
- java.lang.Object
-
- org.dspace.checker.MostRecentChecksumServiceImpl
-
- All Implemented Interfaces:
MostRecentChecksumService
public class MostRecentChecksumServiceImpl extends Object implements MostRecentChecksumService
Service implementation for the MostRecentChecksum object. This class is responsible for all business logic calls for the MostRecentChecksum 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 BitstreamServicebitstreamServiceprotected ChecksumResultServicechecksumResultServiceprotected MostRecentChecksumDAOmostRecentChecksumDAO
-
Constructor Summary
Constructors Modifier Constructor Description protectedMostRecentChecksumServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddeleteByBitstream(Context context, Bitstream bitstream)List<MostRecentChecksum>findBitstreamResultTypeReport(Context context, Date startDate, Date endDate, ChecksumResultCode resultCode)Select the most recent bitstream for a given date range with the specified status.MostRecentChecksumfindByBitstream(Context context, Bitstream bitstream)List<MostRecentChecksum>findNotInHistory(Context context)List<MostRecentChecksum>findNotProcessedBitstreamsReport(Context context, Date startDate, Date endDate)Find all bitstreams that were set to not be processed for the specified date range.MostRecentChecksumfindOldestRecord(Context context)Get the oldest most recent checksum record.MostRecentChecksumfindOldestRecord(Context context, Date lessThanDate)Returns the oldest bitstream that in the set of bitstreams that are less than the specified date.MostRecentChecksumgetNonPersistedObject()voidupdate(Context context, MostRecentChecksum mostRecentChecksum)voidupdateMissingBitstreams(Context context)Queries the bitstream table for bitstream IDs that are not yet in the most_recent_checksum table, and inserts them into the most_recent_checksum and checksum_history tables.
-
-
-
Field Detail
-
mostRecentChecksumDAO
@Autowired(required=true) protected MostRecentChecksumDAO mostRecentChecksumDAO
-
checksumResultService
@Autowired(required=true) protected ChecksumResultService checksumResultService
-
bitstreamService
@Autowired(required=true) protected BitstreamService bitstreamService
-
-
Method Detail
-
getNonPersistedObject
public MostRecentChecksum getNonPersistedObject()
- Specified by:
getNonPersistedObjectin interfaceMostRecentChecksumService
-
findByBitstream
public MostRecentChecksum findByBitstream(Context context, Bitstream bitstream) throws SQLException
- Specified by:
findByBitstreamin interfaceMostRecentChecksumService- Throws:
SQLException
-
findNotProcessedBitstreamsReport
public List<MostRecentChecksum> findNotProcessedBitstreamsReport(Context context, Date startDate, Date endDate) throws SQLException
Find all bitstreams that were set to not be processed for the specified date range.- Specified by:
findNotProcessedBitstreamsReportin interfaceMostRecentChecksumService- Parameters:
context- ContextstartDate- the start of the date rangeendDate- the end of the date range- Returns:
- a list of BitstreamHistoryInfo objects
- Throws:
SQLException- if database error
-
findBitstreamResultTypeReport
public List<MostRecentChecksum> findBitstreamResultTypeReport(Context context, Date startDate, Date endDate, ChecksumResultCode resultCode) throws SQLException
Select the most recent bitstream for a given date range with the specified status.- Specified by:
findBitstreamResultTypeReportin interfaceMostRecentChecksumService- Parameters:
context- ContextstartDate- the start date rangeendDate- the end date range.resultCode- the result code- Returns:
- a list of BitstreamHistoryInfo objects
- Throws:
SQLException- if database error
-
updateMissingBitstreams
public void updateMissingBitstreams(Context context) throws SQLException
Queries the bitstream table for bitstream IDs that are not yet in the most_recent_checksum table, and inserts them into the most_recent_checksum and checksum_history tables.- Specified by:
updateMissingBitstreamsin interfaceMostRecentChecksumService- Parameters:
context- Context- Throws:
SQLException- if database error
-
deleteByBitstream
public void deleteByBitstream(Context context, Bitstream bitstream) throws SQLException
- Specified by:
deleteByBitstreamin interfaceMostRecentChecksumService- Throws:
SQLException
-
findOldestRecord
public MostRecentChecksum findOldestRecord(Context context) throws SQLException
Get the oldest most recent checksum record. If more than one found the first one in the result set is returned.- Specified by:
findOldestRecordin interfaceMostRecentChecksumService- Parameters:
context- COntext- Returns:
- the oldest MostRecentChecksum or NULL if the table is empty
- Throws:
SQLException- if database error
-
findOldestRecord
public MostRecentChecksum findOldestRecord(Context context, Date lessThanDate) throws SQLException
Returns the oldest bitstream that in the set of bitstreams that are less than the specified date. If no bitstreams are found -1 is returned.- Specified by:
findOldestRecordin interfaceMostRecentChecksumService- Parameters:
context- contextlessThanDate- date- Returns:
- id of olded bitstream or -1 if not bitstreams are found
- Throws:
SQLException- if database error
-
findNotInHistory
public List<MostRecentChecksum> findNotInHistory(Context context) throws SQLException
- Specified by:
findNotInHistoryin interfaceMostRecentChecksumService- Throws:
SQLException
-
update
public void update(Context context, MostRecentChecksum mostRecentChecksum) throws SQLException
- Specified by:
updatein interfaceMostRecentChecksumService- Throws:
SQLException
-
-