Package org.dspace.checker
Class SimpleReporterServiceImpl
- java.lang.Object
-
- org.dspace.checker.SimpleReporterServiceImpl
-
- All Implemented Interfaces:
SimpleReporterService
public class SimpleReporterServiceImpl extends Object implements SimpleReporterService
Simple Reporter implementation.- Author:
- Jim Downing, Grace Carpenter, Nathan Sarr TODO estimate string buffer sizes.
-
-
Field Summary
Fields Modifier and Type Field Description protected BitstreamServicebitstreamServiceprotected MostRecentChecksumServicemostRecentChecksumService
-
Constructor Summary
Constructors Modifier Constructor Description protectedSimpleReporterServiceImpl()Main Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringapplyDateFormatLong(Date thisDate)protected StringapplyDateFormatShort(Date thisDate)intgetBitstreamNotFoundReport(Context context, Date startDate, Date endDate, OutputStreamWriter osw)Send the bitstream not found report for the specified date range.intgetChangedChecksumReport(Context context, Date startDate, Date endDate, OutputStreamWriter osw)Send the checksum changed report for the specified date range.intgetDeletedBitstreamReport(Context context, Date startDate, Date endDate, OutputStreamWriter osw)Sends the Deleted bitstream report to an administrator.intgetNotToBeProcessedReport(Context context, Date startDate, Date 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 Detail
-
mostRecentChecksumService
@Autowired(required=true) protected MostRecentChecksumService mostRecentChecksumService
-
bitstreamService
@Autowired(required=true) protected BitstreamService bitstreamService
-
-
Method Detail
-
getDeletedBitstreamReport
public int getDeletedBitstreamReport(Context context, Date startDate, Date 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, Date startDate, Date 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, Date startDate, Date 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, Date startDate, Date 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
-
-