@Override
public void delete(Context context, Bitstream bitstream) throws SQLException, AuthorizeException {
authorizeService.authorizeAction(context, bitstream, Constants.DELETE);
log.info(LogManager.getHeader(context, "delete_bitstream",
"bitstream_id=" + bitstream.getID()));
context.addEvent(new Event(Event.DELETE, Constants.BITSTREAM, bitstream.getID(),
String.valueOf(bitstream.getSequenceID()), getIdentifiers(context, bitstream)));
bitstream.setDeleted(true);
update(context, bitstream);
final List<Bundle> bundles = bitstream.getBundles();
for (Bundle bundle : bundles) {
bundle.removeBitstream(bitstream);
}
bundles.clear();
authorizeService.removeAllPolicies(context, bitstream);
}