Package org.dspace.checker
Class SimpleReporterServiceImpl
java.lang.Object
org.dspace.checker.SimpleReporterServiceImpl
- All Implemented Interfaces:
SimpleReporterService
Simple Reporter implementation.
- Author:
- Jim Downing, Grace Carpenter, Nathan Sarr TODO estimate string buffer sizes.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringapplyDateFormatLong(Instant thisDate) protected StringapplyDateFormatShort(Instant thisDate) intgetBitstreamNotFoundReport(Context context, Instant startDate, Instant endDate, OutputStreamWriter osw) Send the bitstream not found report for the specified date range.intgetChangedChecksumReport(Context context, Instant startDate, Instant endDate, OutputStreamWriter osw) Send the checksum changed report for the specified date range.intgetDeletedBitstreamReport(Context context, Instant startDate, Instant endDate, OutputStreamWriter osw) Sends the Deleted bitstream report to an administrator. for the specified date range.intgetNotToBeProcessedReport(Context context, Instant startDate, Instant endDate, OutputStreamWriter osw) Send the bitstreams that were set to not be processed report for the specified date range.intgetUncheckedBitstreamsReport(Context context, OutputStreamWriter osw) Get any bitstreams that are not checked by the checksum checker.protected voidprintDSpaceInfoRecords(Context context, List<Bitstream> bitstreams, OutputStreamWriter osw) Create a list of the found history records.protected voidprintHistoryRecords(List<MostRecentChecksum> mostRecentChecksums, OutputStreamWriter osw) Create a list of the found history records.
-
Field Details
-
mostRecentChecksumService
-
bitstreamService
-
-
Constructor Details
-
SimpleReporterServiceImpl
protected SimpleReporterServiceImpl()Main Constructor.
-
-
Method Details
-
getDeletedBitstreamReport
public int getDeletedBitstreamReport(Context context, Instant startDate, Instant endDate, OutputStreamWriter osw) throws IOException, SQLException Sends the Deleted bitstream report to an administrator. for the specified date range.- Specified by:
getDeletedBitstreamReportin interfaceSimpleReporterService- Parameters:
context- contextstartDate- the start date for the rangeendDate- the end date for the rangeosw- the output stream writer to write to.- Returns:
- number of bitstreams found
- Throws:
IOException- if IO error if io error occursSQLException- if database error
-
getChangedChecksumReport
public int getChangedChecksumReport(Context context, Instant startDate, Instant endDate, OutputStreamWriter osw) throws IOException, SQLException Send the checksum changed report for the specified date range.- Specified by:
getChangedChecksumReportin interfaceSimpleReporterService- Parameters:
context- contextstartDate- the start date for the rangeendDate- the end date for the rangeosw- the output stream writer to write to.- Returns:
- number of bitstreams found
- Throws:
IOException- if IO error if io error occursSQLException- if database error
-
getBitstreamNotFoundReport
public int getBitstreamNotFoundReport(Context context, Instant startDate, Instant endDate, OutputStreamWriter osw) throws IOException, SQLException Send the bitstream not found report for the specified date range.- Specified by:
getBitstreamNotFoundReportin interfaceSimpleReporterService- Parameters:
context- contextstartDate- the start date for the range.endDate- the end date for the range.osw- the output stream writer to write to.- Returns:
- number of bitstreams found
- Throws:
IOException- if IO error if io error occursSQLException- if database error
-
getNotToBeProcessedReport
public int getNotToBeProcessedReport(Context context, Instant startDate, Instant endDate, OutputStreamWriter osw) throws IOException, SQLException Send the bitstreams that were set to not be processed report for the specified date range.- Specified by:
getNotToBeProcessedReportin interfaceSimpleReporterService- Parameters:
context- contextstartDate- the start date for the rangeendDate- the end date for the rangeosw- the output stream writer to write to.- Returns:
- number of bitstreams found
- Throws:
IOException- if IO error if io error occursSQLException- if database error
-
getUncheckedBitstreamsReport
public int getUncheckedBitstreamsReport(Context context, OutputStreamWriter osw) throws IOException, SQLException Get any bitstreams that are not checked by the checksum checker.- Specified by:
getUncheckedBitstreamsReportin interfaceSimpleReporterService- Parameters:
context- contextosw- the OutputStreamWriter to write to- Returns:
- the number of unchecked bitstreams
- Throws:
IOException- if IO error if io error occursSQLException- if database error
-
printHistoryRecords
protected void printHistoryRecords(List<MostRecentChecksum> mostRecentChecksums, OutputStreamWriter osw) throws IOException Create a list of the found history records.- Parameters:
mostRecentChecksums- the list of history records to be iterated over.osw- the output stream writer to write to.- Throws:
IOException- if IO error if io error occurs
-
printDSpaceInfoRecords
protected void printDSpaceInfoRecords(Context context, List<Bitstream> bitstreams, OutputStreamWriter osw) throws IOException, SQLException Create a list of the found history records.- Parameters:
context- contextbitstreams- the list of history records to be iterated over.osw- the output stream to write to.- Throws:
IOException- if IO error if io error occursSQLException- if database error
-
applyDateFormatLong
-
applyDateFormatShort
-