Package org.dspace.checker
Class MostRecentChecksumServiceImpl
java.lang.Object
org.dspace.checker.MostRecentChecksumServiceImpl
- All Implemented Interfaces:
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
FieldsModifier and TypeFieldDescriptionprotected BitstreamServiceprotected ChecksumResultServiceprotected MostRecentChecksumDAO -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteByBitstream(Context context, Bitstream bitstream) findBitstreamResultTypeReport(Context context, Instant startDate, Instant endDate, ChecksumResultCode resultCode) Select the most recent bitstream for a given date range with the specified status.findByBitstream(Context context, Bitstream bitstream) findNotInHistory(Context context) findNotProcessedBitstreamsReport(Context context, Instant startDate, Instant endDate) Find all bitstreams that were set to not be processed for the specified date range.findOldestRecord(Context context) Get the oldest most recent checksum record.findOldestRecord(Context context, Instant lessThanDate) Returns the oldest bitstream that in the set of bitstreams that are less than the specified date.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 Details
-
mostRecentChecksumDAO
-
checksumResultService
-
bitstreamService
-
-
Constructor Details
-
MostRecentChecksumServiceImpl
protected MostRecentChecksumServiceImpl()
-
-
Method Details
-
getNonPersistedObject
- Specified by:
getNonPersistedObjectin interfaceMostRecentChecksumService
-
findByBitstream
- Specified by:
findByBitstreamin interfaceMostRecentChecksumService- Throws:
SQLException
-
findNotProcessedBitstreamsReport
public List<MostRecentChecksum> findNotProcessedBitstreamsReport(Context context, Instant startDate, Instant 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, Instant startDate, Instant 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
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
- Specified by:
deleteByBitstreamin interfaceMostRecentChecksumService- Throws:
SQLException
-
findOldestRecord
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, Instant 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
- Specified by:
findNotInHistoryin interfaceMostRecentChecksumService- Throws:
SQLException
-
update
- Specified by:
updatein interfaceMostRecentChecksumService- Throws:
SQLException
-