@Test public void testDelete() throws SQLException, AuthorizeException, IOException { int id = b.getID(); b.delete(); context.commit(); assertThat("testDelete 0", Bundle.find(context, id), nullValue()); }
void delete() throws SQLException, AuthorizeException, IOException { log.info(LogManager.getHeader(ourContext, "delete_bundle", "bundle_id=" + getID())); ourContext.addEvent(new Event(Event.DELETE, Constants.BUNDLE, getID(), getName())); ourContext.removeCached(this, getID()); Bitstream[] bs = getBitstreams(); for (int i = 0; i < bs.length; i++) { removeBitstream(bs[i]); } AuthorizeManager.removeAllPolicies(ourContext, this); DatabaseManager.delete(ourContext, bundleRow); }
Bundle extends DSpaceObject { void delete() throws SQLException, AuthorizeException, IOException { log.info(LogManager.getHeader(ourContext, "delete_bundle", "bundle_id=" + getID())); ourContext.addEvent(new Event(Event.DELETE, Constants.BUNDLE, getID(), getName())); ourContext.removeCached(this, getID()); Bitstream[] bs = getBitstreams(); for (int i = 0; i < bs.length; i++) { removeBitstream(bs[i]); } AuthorizeManager.removeAllPolicies(ourContext, this); DatabaseManager.delete(ourContext, bundleRow); } }
Bundle extends DSpaceObject { void delete() throws SQLException, AuthorizeException, IOException { log.info(LogManager.getHeader(ourContext, "delete_bundle", "bundle_id=" + getID())); ourContext.addEvent(new Event(Event.DELETE, Constants.BUNDLE, getID(), getName())); ourContext.removeCached(this, getID()); Bitstream[] bs = getBitstreams(); for (int i = 0; i < bs.length; i++) { removeBitstream(bs[i]); } AuthorizeManager.removeAllPolicies(ourContext, this); DatabaseManager.delete(ourContext, bundleRow); } Bundle(Context context, TableRow row); }
Bundle extends DSpaceObject { void delete() throws SQLException, AuthorizeException, IOException { log.info(LogManager.getHeader(ourContext, "delete_bundle", "bundle_id=" + getID())); ourContext.addEvent(new Event(Event.DELETE, Constants.BUNDLE, getID(), getName())); ourContext.removeCached(this, getID()); Bitstream[] bs = getBitstreams(); for (int i = 0; i < bs.length; i++) { removeBitstream(bs[i]); } AuthorizeManager.removeAllPolicies(ourContext, this); DatabaseManager.delete(ourContext, bundleRow); } Bundle(Context context, TableRow row); static Bundle find(Context context, int id); int getID(); String getName(); void setName(String name); int getPrimaryBitstreamID(); void setPrimaryBitstreamID(int bitstreamID); void unsetPrimaryBitstreamID(); String getHandle(); Bitstream getBitstreamByName(String name); Bitstream[] getBitstreams(); Item[] getItems(); Bitstream createBitstream(InputStream is); Bitstream registerBitstream(int assetstore, String bitstreamPath); void addBitstream(Bitstream b); void setOrder(int bitstreamIds[]); void removeBitstream(Bitstream b); void update(); int getType(); void inheritCollectionDefaultPolicies(Collection c); void replaceAllBitstreamPolicies(List<ResourcePolicy> newpolicies); List<ResourcePolicy> getBundlePolicies(); List<ResourcePolicy> getBitstreamPolicies(); DSpaceObject getAdminObject(int action); DSpaceObject getParentObject(); }
Bundle extends DSpaceObject { void delete() throws SQLException, AuthorizeException, IOException { log.info(LogManager.getHeader(ourContext, "delete_bundle", "bundle_id=" + getID())); ourContext.addEvent(new Event(Event.DELETE, Constants.BUNDLE, getID(), getName())); ourContext.removeCached(this, getID()); Bitstream[] bs = getBitstreams(); for (int i = 0; i < bs.length; i++) { removeBitstream(bs[i]); } AuthorizeManager.removeAllPolicies(ourContext, this); DatabaseManager.delete(ourContext, bundleRow); } Bundle(Context context, TableRow row); static Bundle find(Context context, int id); int getID(); String getName(); void setName(String name); int getPrimaryBitstreamID(); void setPrimaryBitstreamID(int bitstreamID); void unsetPrimaryBitstreamID(); String getHandle(); Bitstream getBitstreamByName(String name); Bitstream[] getBitstreams(); Item[] getItems(); Bitstream createBitstream(InputStream is); Bitstream registerBitstream(int assetstore, String bitstreamPath); void addBitstream(Bitstream b); void setOrder(int bitstreamIds[]); void removeBitstream(Bitstream b); void update(); int getType(); void inheritCollectionDefaultPolicies(Collection c); void replaceAllBitstreamPolicies(List<ResourcePolicy> newpolicies); List<ResourcePolicy> getBundlePolicies(); List<ResourcePolicy> getBitstreamPolicies(); DSpaceObject getAdminObject(int action); DSpaceObject getParentObject();  }