@Override public void expunge(Context context, Bitstream bitstream) throws SQLException, AuthorizeException { authorizeService.authorizeAction(context, bitstream, Constants.DELETE); if (!bitstream.isDeleted()) { throw new IllegalStateException("Bitstream must be deleted before it can be removed from the database"); } bitstreamDAO.delete(context, bitstream); }
buf.append(msg("format-id")).append(" = ").append( info.getFormat(context).getID()).append("\n"); buf.append(msg("deleted")).append(" = ").append(info.isDeleted()) .append("\n"); buf.append(msg("bitstream-id")).append(" = ").append(
LOG.info(msg("bitstream-id") + ": " + bitstream.getID()); LOG.info(msg("bitstream-info-found") + ": " + info.isInfoFound()); LOG.info(msg("bitstream-marked-deleted") + ": " + bitstream.isDeleted()); LOG.info(msg("bitstream-found") + ": " + info.isBitstreamFound()); LOG.info(msg("to-be-processed") + ": " + info.isToBeProcessed());
mostRecentChecksum.setBitstream(bitstream); mostRecentChecksum.setToBeProcessed(!bitstream.isDeleted()); if (bitstream.getChecksum() == null) { mostRecentChecksum.setCurrentChecksum(""); if (bitstream.isDeleted()) { checksumResult = checksumResultService.findByCode(context, ChecksumResultCode.BITSTREAM_MARKED_DELETED); } else {
} else if (info.getBitstream().isDeleted()) {
@Override public void addHistory(Context context, MostRecentChecksum mostRecentChecksum) throws SQLException { ChecksumHistory checksumHistory = new ChecksumHistory(); checksumHistory.setBitstream(mostRecentChecksum.getBitstream()); checksumHistory.setProcessStartDate(mostRecentChecksum.getProcessStartDate()); checksumHistory.setProcessEndDate(mostRecentChecksum.getProcessEndDate()); checksumHistory.setChecksumExpected(mostRecentChecksum.getExpectedChecksum()); checksumHistory.setChecksumCalculated(mostRecentChecksum.getCurrentChecksum()); ChecksumResult checksumResult; if (mostRecentChecksum.getBitstream().isDeleted()) { checksumResult = checksumResultService.findByCode(context, ChecksumResultCode.BITSTREAM_MARKED_DELETED); } else { checksumResult = checksumResultService.findByCode(context, ChecksumResultCode.CHECKSUM_MATCH); } checksumHistory.setResult(checksumResult); checksumHistoryDAO.create(context, checksumHistory); checksumHistoryDAO.save(context, checksumHistory); }